Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
893a6481
Commit
893a6481
authored
Oct 12, 2015
by
Timothy Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opencl: Print compilation log
Useful when debugging.
parent
d2a10297
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
opencl.c
libavutil/opencl.c
+30
-3
No files found.
libavutil/opencl.c
View file @
893a6481
...
...
@@ -449,12 +449,14 @@ end:
cl_program
av_opencl_compile
(
const
char
*
program_name
,
const
char
*
build_opts
)
{
int
i
;
cl_int
status
;
cl_int
status
,
build_status
;
int
kernel_code_idx
=
0
;
const
char
*
kernel_source
;
size_t
kernel_code_len
;
char
*
ptr
=
NULL
;
cl_program
program
=
NULL
;
size_t
log_size
;
char
*
log
=
NULL
;
LOCK_OPENCL
;
for
(
i
=
0
;
i
<
opencl_ctx
.
kernel_code_count
;
i
++
)
{
...
...
@@ -481,11 +483,36 @@ cl_program av_opencl_compile(const char *program_name, const char *build_opts)
program
=
NULL
;
goto
end
;
}
status
=
clBuildProgram
(
program
,
1
,
&
(
opencl_ctx
.
device_id
),
build_opts
,
NULL
,
NULL
);
build_status
=
clBuildProgram
(
program
,
1
,
&
(
opencl_ctx
.
device_id
),
build_opts
,
NULL
,
NULL
);
status
=
clGetProgramBuildInfo
(
program
,
opencl_ctx
.
device_id
,
CL_PROGRAM_BUILD_LOG
,
0
,
NULL
,
&
log_size
);
if
(
status
!=
CL_SUCCESS
)
{
av_log
(
&
opencl_ctx
,
AV_LOG_WARNING
,
"Failed to get compilation log: %s
\n
"
,
av_opencl_errstr
(
status
));
}
else
{
log
=
av_malloc
(
log_size
);
if
(
log
)
{
status
=
clGetProgramBuildInfo
(
program
,
opencl_ctx
.
device_id
,
CL_PROGRAM_BUILD_LOG
,
log_size
,
log
,
NULL
);
if
(
status
!=
CL_SUCCESS
)
{
av_log
(
&
opencl_ctx
,
AV_LOG_WARNING
,
"Failed to get compilation log: %s
\n
"
,
av_opencl_errstr
(
status
));
}
else
{
int
level
=
build_status
==
CL_SUCCESS
?
AV_LOG_DEBUG
:
AV_LOG_ERROR
;
av_log
(
&
opencl_ctx
,
level
,
"Compilation log:
\n
%s
\n
"
,
log
);
}
}
av_freep
(
&
log
);
}
if
(
build_status
!=
CL_SUCCESS
)
{
av_log
(
&
opencl_ctx
,
AV_LOG_ERROR
,
"Compilation failed with OpenCL program '%s': %s
\n
"
,
program_name
,
av_opencl_errstr
(
status
));
program_name
,
av_opencl_errstr
(
build_
status
));
program
=
NULL
;
goto
end
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment