]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/opencl.h
wtv: make ff_format_videoinfo2 visible to wtv encoder
[ffmpeg] / libavutil / opencl.h
index e4ecbf812c93c157410e276987eeb1ef8a678f68..cf0abd797519131cea2ff03bb5d2f8581c6b87d0 100644 (file)
@@ -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 */