summaryrefslogtreecommitdiff
path: root/libavfilter/opencl.c
diff options
context:
space:
mode:
authorJarek Samic <cldfire3@gmail.com>2019-08-08 09:24:30 -0400
committerMark Thompson <sw@jkqxz.net>2019-08-22 23:11:25 +0100
commitd3cd33ab1b23fb459e25ae92a0cd7fbfe7c1c169 (patch)
tree9b0dd1d637ef2d9ea4bcd3b1acd6468530caa1fc /libavfilter/opencl.c
parent3a09dbdb4a2f66558367a1350b37ad470aa71fac (diff)
lavfi: add utilities to reduce OpenCL boilerplate code
Diffstat (limited to 'libavfilter/opencl.c')
-rw-r--r--libavfilter/opencl.c10
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;
+}