diff options
author | Jarek Samic <cldfire3@gmail.com> | 2019-08-08 09:24:30 -0400 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2019-08-22 23:11:25 +0100 |
commit | d3cd33ab1b23fb459e25ae92a0cd7fbfe7c1c169 (patch) | |
tree | 9b0dd1d637ef2d9ea4bcd3b1acd6468530caa1fc /libavfilter/opencl.c | |
parent | 3a09dbdb4a2f66558367a1350b37ad470aa71fac (diff) | |
download | ffmpeg-d3cd33ab1b23fb459e25ae92a0cd7fbfe7c1c169.tar.gz |
lavfi: add utilities to reduce OpenCL boilerplate code
Diffstat (limited to 'libavfilter/opencl.c')
-rw-r--r-- | libavfilter/opencl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavfilter/opencl.c b/libavfilter/opencl.c index 95f0bfc604..8e96543467 100644 --- a/libavfilter/opencl.c +++ b/libavfilter/opencl.c @@ -350,3 +350,13 @@ void ff_opencl_print_const_matrix_3x3(AVBPrint *buf, const char *name_str, } av_bprintf(buf, "};\n"); } + +cl_ulong ff_opencl_get_event_time(cl_event event) { + cl_ulong time_start; + cl_ulong time_end; + + clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_START, sizeof(time_start), &time_start, NULL); + clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_END, sizeof(time_end), &time_end, NULL); + + return time_end - time_start; +} |