1 #ifndef LIBOPENCL_STUB_H 2 #define LIBOPENCL_STUB_H 14 typedef void (*f_pfn_notify)(
const char *,
const void *, size_t,
void *);
16 typedef cl_int (*f_clGetPlatformIDs) (cl_uint, cl_platform_id *, cl_uint *);
18 typedef cl_int (*f_clGetPlatformInfo) (cl_platform_id, cl_platform_info, size_t,
void *,
size_t *);
20 typedef cl_int (*f_clGetDeviceIDs) (cl_platform_id, cl_device_type, cl_uint, cl_device_id *, cl_uint *);
22 typedef cl_int (*f_clGetDeviceInfo) (cl_device_id, cl_device_info, size_t,
void *,
size_t *);
24 typedef cl_int (*f_clCreateSubDevices) (cl_device_id,
const cl_device_partition_property *,
25 cl_uint, cl_device_id *, cl_uint *);
27 typedef cl_int (*f_clRetainDevice) (cl_device_id);
29 typedef cl_int (*f_clReleaseDevice) (cl_device_id);
31 typedef cl_context (*f_clCreateContext) (
const cl_context_properties *, cl_uint,
const cl_device_id *,
32 f_pfn_notify,
void *, cl_int *);
34 typedef cl_context (*f_clCreateContextFromType) (
const cl_context_properties *, cl_device_type,
35 f_pfn_notify,
void *, cl_int *);
37 typedef cl_int (*f_clRetainContext) (cl_context);
39 typedef cl_int (*f_clReleaseContext) (cl_context);
41 typedef cl_int (*f_clGetContextInfo) (cl_context, cl_context_info, size_t,
void *,
size_t *);
43 typedef cl_command_queue (*f_clCreateCommandQueue) (cl_context, cl_device_id, cl_command_queue_properties, cl_int *);
45 typedef cl_int (*f_clRetainCommandQueue) (cl_command_queue);
47 typedef cl_int (*f_clReleaseCommandQueue) (cl_command_queue);
49 typedef cl_int (*f_clGetCommandQueueInfo) (cl_command_queue, cl_command_queue_info, size_t,
void *,
size_t *);
51 typedef cl_mem (*f_clCreateBuffer) (cl_context, cl_mem_flags, size_t,
void *, cl_int *);
53 typedef cl_mem (*f_clCreateSubBuffer) (cl_mem, cl_mem_flags, cl_buffer_create_type,
const void *, cl_int *);
57 typedef cl_int (*f_clRetainMemObject) (cl_mem);
59 typedef cl_int (*f_clReleaseMemObject) (cl_mem);
61 typedef cl_int (*f_clGetMemObjectInfo) (cl_mem, cl_mem_info, size_t,
void *,
size_t *);
63 typedef cl_int (*f_clGetImageInfo) (cl_mem, cl_image_info, size_t,
void *,
size_t *);
65 typedef cl_int (*f_clSetMemObjectDestructorCallback) (cl_mem, void (*pfn_notify)( cl_mem memobj,
void* user_data),
void *);
67 typedef cl_int (*f_clGetSupportedImageFormats) (cl_context, cl_mem_flags, cl_mem_object_type, cl_uint, cl_image_format *, cl_uint *);
69 typedef cl_sampler (*f_clCreateSampler) (cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int *);
71 typedef cl_int (*f_clRetainSampler) (cl_sampler);
73 typedef cl_int (*f_clReleaseSampler) (cl_sampler);
75 typedef cl_int (*f_clGetSamplerInfo) (cl_sampler, cl_sampler_info, size_t,
void *,
size_t *);
77 typedef cl_program (*f_clCreateProgramWithSource) (cl_context, cl_uint,
const char **,
const size_t *, cl_int *);
79 typedef cl_program (*f_clCreateProgramWithBinary) (cl_context, cl_uint,
const cl_device_id *,
80 const size_t *,
const unsigned char **, cl_int *, cl_int *);
82 typedef cl_program (*f_clCreateProgramWithBuiltInKernels) (cl_context, cl_uint,
const cl_device_id *,
const char *, cl_int *);
84 typedef cl_int (*f_clRetainProgram) (cl_program);
86 typedef cl_int (*f_clReleaseProgram) (cl_program);
88 typedef cl_int (*f_clBuildProgram) (cl_program, cl_uint,
const cl_device_id *,
const char *,
89 void (*pfn_notify)(cl_program program,
void * user_data),
void *);
91 typedef cl_int (*f_clCompileProgram) (cl_program, cl_uint,
const cl_device_id *,
const char *, cl_uint,
const cl_program *,
92 const char **, void (*pfn_notify)(cl_program program,
void * user_data),
void *);
94 typedef cl_program (*f_clLinkProgram) (cl_context, cl_uint,
const cl_device_id *,
const char *, cl_uint,
const cl_program *,
95 void (*pfn_notify)(cl_program program,
void * user_data),
void *, cl_int *);
97 typedef cl_int (*f_clUnloadPlatformCompiler)(cl_platform_id);
99 typedef cl_int (*f_clGetProgramInfo) (cl_program, cl_program_info, size_t,
void *,
size_t *);
101 typedef cl_int (*f_clGetProgramBuildInfo) (cl_program, cl_device_id, cl_program_build_info, size_t,
void *,
size_t *);
103 typedef cl_kernel (*f_clCreateKernel) (cl_program,
const char *, cl_int *);
105 typedef cl_int (*f_clCreateKernelsInProgram) (cl_program, cl_uint, cl_kernel *, cl_uint *);
107 typedef cl_int (*f_clRetainKernel) (cl_kernel);
109 typedef cl_int (*f_clReleaseKernel) (cl_kernel);
111 typedef cl_int (*f_clSetKernelArg) (cl_kernel, cl_uint, size_t,
const void *);
113 typedef cl_int (*f_clGetKernelInfo) (cl_kernel, cl_kernel_info, size_t,
void *,
size_t *);
115 typedef cl_int (*f_clGetKernelArgInfo) (cl_kernel, cl_uint, cl_kernel_arg_info, size_t,
void *,
size_t *);
117 typedef cl_int (*f_clGetKernelWorkGroupInfo) (cl_kernel, cl_device_id, cl_kernel_work_group_info, size_t,
void *,
size_t *);
119 typedef cl_int (*f_clWaitForEvents) (cl_uint,
const cl_event *);
121 typedef cl_int (*f_clGetEventInfo) (cl_event, cl_event_info, size_t,
void *,
size_t *);
123 typedef cl_event (*f_clCreateUserEvent) (cl_context, cl_int *);
125 typedef cl_int (*f_clRetainEvent) (cl_event);
127 typedef cl_int (*f_clReleaseEvent) (cl_event);
129 typedef cl_int (*f_clSetUserEventStatus) (cl_event, cl_int);
131 typedef cl_int (*f_clSetEventCallback) (cl_event, cl_int, void (*pfn_notify)(cl_event, cl_int,
void *),
void *);
133 typedef cl_int (*f_clGetEventProfilingInfo) (cl_event, cl_profiling_info, size_t,
void *,
size_t *);
135 typedef cl_int (*f_clFlush) (cl_command_queue);
137 typedef cl_int (*f_clFinish) (cl_command_queue);
139 typedef cl_int (*f_clEnqueueReadBuffer) (cl_command_queue, cl_mem, cl_bool, size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
141 typedef cl_int (*f_clEnqueueReadBufferRect) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
const size_t *,
142 size_t, size_t, size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
144 typedef cl_int (*f_clEnqueueWriteBuffer) (cl_command_queue, cl_mem, cl_bool, size_t, size_t,
const void *, cl_uint,
const cl_event *, cl_event *);
146 typedef cl_int (*f_clEnqueueWriteBufferRect) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
const size_t *,
147 size_t, size_t, size_t, size_t,
const void *, cl_uint,
const cl_event *, cl_event *);
149 typedef cl_int (*f_clEnqueueFillBuffer) (cl_command_queue, cl_mem,
const void *, size_t, size_t, size_t, cl_uint,
const cl_event *, cl_event *);
151 typedef cl_int (*f_clEnqueueCopyBuffer) (cl_command_queue, cl_mem, cl_mem, size_t, size_t, size_t, cl_uint,
const cl_event *, cl_event *);
153 typedef cl_int (*f_clEnqueueCopyBufferRect) (cl_command_queue, cl_mem, cl_mem,
const size_t *,
const size_t *,
const size_t *,
154 size_t, size_t, size_t, size_t, cl_uint,
const cl_event *, cl_event *);
156 typedef cl_int (*f_clEnqueueReadImage) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
157 size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
159 typedef cl_int (*f_clEnqueueWriteImage) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
160 size_t, size_t,
const void *, cl_uint,
const cl_event *, cl_event *);
162 typedef cl_int (*f_clEnqueueFillImage) (cl_command_queue, cl_mem,
const void *,
const size_t *,
const size_t *, cl_uint,
const cl_event *, cl_event *);
164 typedef cl_int (*f_clEnqueueCopyImage) (cl_command_queue, cl_mem, cl_mem,
const size_t *,
const size_t *,
const size_t *,
165 cl_uint,
const cl_event *, cl_event *);
167 typedef cl_int (*f_clEnqueueCopyImageToBuffer) (cl_command_queue, cl_mem, cl_mem,
const size_t *,
const size_t *, size_t, cl_uint,
const cl_event *, cl_event *);
169 typedef cl_int (*f_clEnqueueCopyBufferToImage) (cl_command_queue, cl_mem, cl_mem, size_t,
const size_t *,
const size_t *, cl_uint,
const cl_event *, cl_event *);
171 typedef void * (*f_clEnqueueMapBuffer) (cl_command_queue, cl_mem, cl_bool, cl_map_flags, size_t,
172 size_t, cl_uint,
const cl_event *, cl_event *, cl_int *);
174 typedef void * (*f_clEnqueueMapImage) (cl_command_queue, cl_mem, cl_bool, cl_map_flags,
const size_t *,
const size_t *,
175 size_t *,
size_t *, cl_uint,
const cl_event *, cl_event *, cl_int *);
177 typedef cl_int (*f_clEnqueueUnmapMemObject) (cl_command_queue, cl_mem,
void *, cl_uint,
const cl_event *, cl_event *);
179 typedef cl_int (*f_clEnqueueMigrateMemObjects)(cl_command_queue, cl_uint,
const cl_mem *, cl_mem_migration_flags,
180 cl_uint,
const cl_event *, cl_event *);
182 typedef cl_int (*f_clEnqueueNDRangeKernel)(cl_command_queue, cl_kernel, cl_uint,
const size_t *,
const size_t *,
183 const size_t *, cl_uint,
const cl_event *, cl_event *);
185 typedef cl_int (*f_clEnqueueTask)(cl_command_queue, cl_kernel, cl_uint,
const cl_event *, cl_event *);
187 typedef cl_int (*f_clEnqueueNativeKernel)(cl_command_queue, void (*user_func)(
void *),
void *,
size_t,
188 cl_uint,
const cl_mem *,
const void **, cl_uint,
const cl_event *, cl_event *);
190 typedef cl_int (*f_clEnqueueMarkerWithWaitList)(cl_command_queue, cl_uint,
const cl_event *, cl_event *);
192 typedef cl_int (*f_clEnqueueBarrierWithWaitList)(cl_command_queue, cl_uint,
const cl_event *, cl_event *);
194 typedef void * (*f_clGetExtensionFunctionAddressForPlatform)(cl_platform_id,
const char *);
196 typedef cl_mem (*f_clCreateImage2D)(cl_context, cl_mem_flags,
const cl_image_format *, size_t, size_t,
197 size_t,
void *, cl_int *);
199 typedef cl_mem (*f_clCreateImage3D)(cl_context, cl_mem_flags,
const cl_image_format *, size_t,
200 size_t, size_t, size_t, size_t,
void *, cl_int *);
202 typedef cl_int (*f_clEnqueueMarker)(cl_command_queue, cl_event *);
204 typedef cl_int(*f_clEnqueueWaitForEvents)(cl_command_queue, cl_uint,
const cl_event *);
206 typedef cl_int (*f_clEnqueueBarrier)(cl_command_queue);
208 typedef cl_int (*f_clUnloadCompiler)(void);
210 typedef void * (*f_clGetExtensionFunctionAddress)(
const char *);
212 typedef cl_mem (*f_clCreateFromGLBuffer) (cl_context, cl_mem_flags, cl_GLuint,
int *);
214 typedef cl_mem (*f_clCreateFromGLTexture) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
216 typedef cl_mem (*f_clCreateFromGLRenderbuffer) (cl_context, cl_mem_flags, cl_GLuint, cl_int *);
218 typedef cl_int (*f_clGetGLObjectInfo) (cl_mem memobj, cl_gl_object_type *, cl_GLuint *);
220 typedef cl_int (*f_clGetGLTextureInfo) (cl_mem, cl_gl_texture_info, size_t,
void *,
size_t *);
222 typedef cl_int (*f_clEnqueueAcquireGLObjects) (cl_command_queue, cl_uint,
const cl_mem *, cl_uint,
223 const cl_event *, cl_event *);
225 typedef cl_int (*f_clEnqueueReleaseGLObjects) (cl_command_queue, cl_uint,
const cl_mem *, cl_uint,
226 const cl_event *, cl_event *);
228 typedef cl_mem (*f_clCreateFromGLTexture2D) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
230 typedef cl_mem (*f_clCreateFromGLTexture3D) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
233 typedef cl_int (*f_clGetGLContextInfoKHR) (
const cl_context_properties *, cl_gl_context_info, size_t,
238 void stubOpenclReset();
241 int open_libopencl_so();
242 cl_int get_libopencl_path(
char** cl_path);
248 #endif // LIBOPENCL_STUB_H