summaryrefslogtreecommitdiff
path: root/libavutil/opencl.h
diff options
context:
space:
mode:
authorLenny Wang <lwanghpc@gmail.com>2013-12-08 21:01:00 -0600
committerMichael Niedermayer <michaelni@gmx.at>2013-12-09 21:21:36 +0100
commit64f73acd1d3853e55a7cd7631987dfd83c4171e7 (patch)
treecdb797b8e3dbe005c675d6ebab4f45cc94b49efd /libavutil/opencl.h
parent8e702bd3a8f5a4271590ab5aa38a41087ceaab1b (diff)
cmdutils & opencl: add -opencl_bench option to test and show available OpenCL devices
Reviewed-by: Wei Gao <highgod0401@gmail.com> Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/opencl.h')
-rw-r--r--libavutil/opencl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/opencl.h b/libavutil/opencl.h
index e4ecbf812c..cf0abd7975 100644
--- a/libavutil/opencl.h
+++ b/libavutil/opencl.h
@@ -310,4 +310,20 @@ void av_opencl_release_kernel(AVOpenCLKernelEnv *env);
*/
void av_opencl_uninit(void);
+/**
+ * Benchmark an OpenCL device with a user defined callback function. This function
+ * sets up an external OpenCL environment including context and command queue on
+ * the device then tears it down in the end. The callback function should perform
+ * the rest of the work.
+ *
+ * @param device pointer to the OpenCL device to be used
+ * @param platform cl_platform_id handle to which the device belongs to
+ * @param benchmark callback function to perform the benchmark, return a
+ * negative value in case of failure
+ * @return the score passed from the callback function, a negative error code in case
+ * of failure
+ */
+int64_t av_opencl_benchmark(AVOpenCLDeviceNode *device, cl_platform_id platform,
+ int64_t (*benchmark)(AVOpenCLExternalEnv *ext_opencl_env));
+
#endif /* LIBAVUTIL_OPENCL_H */