32 #ifndef AVUTIL_OPENCL_H 
   33 #define AVUTIL_OPENCL_H 
   35 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 1 
   37 #include <OpenCL/cl.h> 
   46 #define AV_OPENCL_KERNEL( ... )# __VA_ARGS__ 
  245                                  uint8_t **src_data, 
int *plane_size, 
int plane_num);
 
  258                                 cl_mem src_cl_buf, 
size_t cl_buffer_size);
 
const char const char void * val
void av_opencl_free_device_list(AVOpenCLDeviceList **device_list)
Free OpenCL device list. 
void av_opencl_free_option(void)
Free option values of the global OpenCL context. 
int av_opencl_buffer_write_image(cl_mem dst_cl_buf, size_t cl_buffer_size, int dst_cl_offset, uint8_t **src_data, int *plane_size, int plane_num)
Write image data from memory to OpenCL buffer. 
int64_t av_opencl_benchmark(AVOpenCLDeviceNode *device, cl_platform_id platform, int64_t(*benchmark)(AVOpenCLExternalEnv *ext_opencl_env))
Benchmark an OpenCL device with a user defined callback function. 
int av_opencl_buffer_read_image(uint8_t **dst_data, int *plane_size, int plane_num, cl_mem src_cl_buf, size_t cl_buffer_size)
Read image data from OpenCL buffer. 
void av_opencl_uninit(void)
Release OpenCL environment. 
Libavutil version macros. 
int av_opencl_get_device_list(AVOpenCLDeviceList **device_list)
Get OpenCL device list. 
cl_platform_id platform_id
void av_opencl_free_external_env(AVOpenCLExternalEnv **ext_opencl_env)
Free OpenCL external environment. 
const char * av_opencl_errstr(cl_int status)
Get OpenCL error string. 
cl_command_queue av_opencl_get_command_queue(void)
get OpenCL command queue 
cl_device_type device_type
AVOpenCLPlatformNode ** platform_node
int av_opencl_buffer_create(cl_mem *cl_buf, size_t cl_buf_size, int flags, void *host_ptr)
Create OpenCL buffer. 
cl_command_queue command_queue
AVOpenCLExternalEnv * av_opencl_alloc_external_env(void)
Allocate OpenCL external environment. 
int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t buf_size)
Write OpenCL buffer with data from src_buf. 
int av_opencl_buffer_read(uint8_t *dst_buf, cl_mem src_cl_buf, size_t buf_size)
Read data from OpenCL buffer to memory buffer. 
int av_opencl_register_kernel_code(const char *kernel_code)
Register kernel code. 
int av_opencl_init(AVOpenCLExternalEnv *ext_opencl_env)
Initialize the run time OpenCL environment. 
int av_opencl_get_option(const char *key, uint8_t **out_val)
Get option value from the global OpenCL context. 
void av_opencl_buffer_release(cl_mem *cl_buf)
Release OpenCL buffer. 
cl_program av_opencl_compile(const char *program_name, const char *build_opts)
compile specific OpenCL kernel source 
int av_opencl_set_option(const char *key, const char *val)
Set option in the global OpenCL context. 
const char program_name[]
program name, defined by the program for show_version().