1 #ifndef LIBOPENCL_STUB_H 2 #define LIBOPENCL_STUB_H 15 typedef void (*f_pfn_notify)(
const char *,
const void *, size_t,
void *);
17 typedef cl_int (*f_clGetPlatformIDs) (cl_uint, cl_platform_id *, cl_uint *);
19 typedef cl_int (*f_clGetPlatformInfo) (cl_platform_id, cl_platform_info, size_t,
void *,
size_t *);
21 typedef cl_int (*f_clGetDeviceIDs) (cl_platform_id, cl_device_type, cl_uint, cl_device_id *, cl_uint *);
23 typedef cl_int (*f_clGetDeviceInfo) (cl_device_id, cl_device_info, size_t,
void *,
size_t *);
25 typedef cl_int (*f_clCreateSubDevices) (cl_device_id,
const cl_device_partition_property *,
26 cl_uint, cl_device_id *, cl_uint *);
28 typedef cl_int (*f_clRetainDevice) (cl_device_id);
30 typedef cl_int (*f_clReleaseDevice) (cl_device_id);
32 typedef cl_context (*f_clCreateContext) (
const cl_context_properties *, cl_uint,
const cl_device_id *,
33 f_pfn_notify,
void *, cl_int *);
35 typedef cl_context (*f_clCreateContextFromType) (
const cl_context_properties *, cl_device_type,
36 f_pfn_notify,
void *, cl_int *);
38 typedef cl_int (*f_clRetainContext) (cl_context);
40 typedef cl_int (*f_clReleaseContext) (cl_context);
42 typedef cl_int (*f_clGetContextInfo) (cl_context, cl_context_info, size_t,
void *,
size_t *);
44 typedef cl_command_queue (*f_clCreateCommandQueue) (cl_context, cl_device_id, cl_command_queue_properties, cl_int *);
46 typedef cl_int (*f_clRetainCommandQueue) (cl_command_queue);
48 typedef cl_int (*f_clReleaseCommandQueue) (cl_command_queue);
50 typedef cl_int (*f_clGetCommandQueueInfo) (cl_command_queue, cl_command_queue_info, size_t,
void *,
size_t *);
52 typedef cl_mem (*f_clCreateBuffer) (cl_context, cl_mem_flags, size_t,
void *, cl_int *);
54 typedef cl_mem (*f_clCreateSubBuffer) (cl_mem, cl_mem_flags, cl_buffer_create_type,
const void *, cl_int *);
58 typedef cl_int (*f_clRetainMemObject) (cl_mem);
60 typedef cl_int (*f_clReleaseMemObject) (cl_mem);
62 typedef cl_int (*f_clGetMemObjectInfo) (cl_mem, cl_mem_info, size_t,
void *,
size_t *);
64 typedef cl_int (*f_clGetImageInfo) (cl_mem, cl_image_info, size_t,
void *,
size_t *);
66 typedef cl_int (*f_clSetMemObjectDestructorCallback) (cl_mem, void (*pfn_notify)( cl_mem memobj,
void* user_data),
void *);
68 typedef cl_int (*f_clGetSupportedImageFormats) (cl_context, cl_mem_flags, cl_mem_object_type, cl_uint, cl_image_format *, cl_uint *);
70 typedef cl_sampler (*f_clCreateSampler) (cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int *);
72 typedef cl_int (*f_clRetainSampler) (cl_sampler);
74 typedef cl_int (*f_clReleaseSampler) (cl_sampler);
76 typedef cl_int (*f_clGetSamplerInfo) (cl_sampler, cl_sampler_info, size_t,
void *,
size_t *);
78 typedef cl_program (*f_clCreateProgramWithSource) (cl_context, cl_uint,
const char **,
const size_t *, cl_int *);
80 typedef cl_program (*f_clCreateProgramWithBinary) (cl_context, cl_uint,
const cl_device_id *,
81 const size_t *,
const unsigned char **, cl_int *, cl_int *);
83 typedef cl_program (*f_clCreateProgramWithBuiltInKernels) (cl_context, cl_uint,
const cl_device_id *,
const char *, cl_int *);
85 typedef cl_int (*f_clRetainProgram) (cl_program);
87 typedef cl_int (*f_clReleaseProgram) (cl_program);
89 typedef cl_int (*f_clBuildProgram) (cl_program, cl_uint,
const cl_device_id *,
const char *,
90 void (*pfn_notify)(cl_program program,
void * user_data),
void *);
92 typedef cl_int (*f_clCompileProgram) (cl_program, cl_uint,
const cl_device_id *,
const char *, cl_uint,
const cl_program *,
93 const char **, void (*pfn_notify)(cl_program program,
void * user_data),
void *);
95 typedef cl_program (*f_clLinkProgram) (cl_context, cl_uint,
const cl_device_id *,
const char *, cl_uint,
const cl_program *,
96 void (*pfn_notify)(cl_program program,
void * user_data),
void *, cl_int *);
98 typedef cl_int (*f_clUnloadPlatformCompiler)(cl_platform_id);
100 typedef cl_int (*f_clGetProgramInfo) (cl_program, cl_program_info, size_t,
void *,
size_t *);
102 typedef cl_int (*f_clGetProgramBuildInfo) (cl_program, cl_device_id, cl_program_build_info, size_t,
void *,
size_t *);
104 typedef cl_kernel (*f_clCreateKernel) (cl_program,
const char *, cl_int *);
106 typedef cl_int (*f_clCreateKernelsInProgram) (cl_program, cl_uint, cl_kernel *, cl_uint *);
108 typedef cl_int (*f_clRetainKernel) (cl_kernel);
110 typedef cl_int (*f_clReleaseKernel) (cl_kernel);
112 typedef cl_int (*f_clSetKernelArg) (cl_kernel, cl_uint, size_t,
const void *);
114 typedef cl_int (*f_clGetKernelInfo) (cl_kernel, cl_kernel_info, size_t,
void *,
size_t *);
116 typedef cl_int (*f_clGetKernelArgInfo) (cl_kernel, cl_uint, cl_kernel_arg_info, size_t,
void *,
size_t *);
118 typedef cl_int (*f_clGetKernelWorkGroupInfo) (cl_kernel, cl_device_id, cl_kernel_work_group_info, size_t,
void *,
size_t *);
120 typedef cl_int (*f_clWaitForEvents) (cl_uint,
const cl_event *);
122 typedef cl_int (*f_clGetEventInfo) (cl_event, cl_event_info, size_t,
void *,
size_t *);
124 typedef cl_event (*f_clCreateUserEvent) (cl_context, cl_int *);
126 typedef cl_int (*f_clRetainEvent) (cl_event);
128 typedef cl_int (*f_clReleaseEvent) (cl_event);
130 typedef cl_int (*f_clSetUserEventStatus) (cl_event, cl_int);
132 typedef cl_int (*f_clSetEventCallback) (cl_event, cl_int, void (*pfn_notify)(cl_event, cl_int,
void *),
void *);
134 typedef cl_int (*f_clGetEventProfilingInfo) (cl_event, cl_profiling_info, size_t,
void *,
size_t *);
136 typedef cl_int (*f_clFlush) (cl_command_queue);
138 typedef cl_int (*f_clFinish) (cl_command_queue);
140 typedef cl_int (*f_clEnqueueReadBuffer) (cl_command_queue, cl_mem, cl_bool, size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
142 typedef cl_int (*f_clEnqueueReadBufferRect) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
const size_t *,
143 size_t, size_t, size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
145 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 *);
147 typedef cl_int (*f_clEnqueueWriteBufferRect) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
const size_t *,
148 size_t, size_t, size_t, size_t,
const void *, cl_uint,
const cl_event *, cl_event *);
150 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 *);
152 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 *);
154 typedef cl_int (*f_clEnqueueCopyBufferRect) (cl_command_queue, cl_mem, cl_mem,
const size_t *,
const size_t *,
const size_t *,
155 size_t, size_t, size_t, size_t, cl_uint,
const cl_event *, cl_event *);
157 typedef cl_int (*f_clEnqueueReadImage) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
158 size_t, size_t,
void *, cl_uint,
const cl_event *, cl_event *);
160 typedef cl_int (*f_clEnqueueWriteImage) (cl_command_queue, cl_mem, cl_bool,
const size_t *,
const size_t *,
161 size_t, size_t,
const void *, cl_uint,
const cl_event *, cl_event *);
163 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 *);
165 typedef cl_int (*f_clEnqueueCopyImage) (cl_command_queue, cl_mem, cl_mem,
const size_t *,
const size_t *,
const size_t *,
166 cl_uint,
const cl_event *, cl_event *);
168 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 *);
170 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 *);
172 typedef void * (*f_clEnqueueMapBuffer) (cl_command_queue, cl_mem, cl_bool, cl_map_flags, size_t,
173 size_t, cl_uint,
const cl_event *, cl_event *, cl_int *);
175 typedef void * (*f_clEnqueueMapImage) (cl_command_queue, cl_mem, cl_bool, cl_map_flags,
const size_t *,
const size_t *,
176 size_t *,
size_t *, cl_uint,
const cl_event *, cl_event *, cl_int *);
178 typedef cl_int (*f_clEnqueueUnmapMemObject) (cl_command_queue, cl_mem,
void *, cl_uint,
const cl_event *, cl_event *);
180 typedef cl_int (*f_clEnqueueMigrateMemObjects)(cl_command_queue, cl_uint,
const cl_mem *, cl_mem_migration_flags,
181 cl_uint,
const cl_event *, cl_event *);
183 typedef cl_int (*f_clEnqueueNDRangeKernel)(cl_command_queue, cl_kernel, cl_uint,
const size_t *,
const size_t *,
184 const size_t *, cl_uint,
const cl_event *, cl_event *);
186 typedef cl_int (*f_clEnqueueTask)(cl_command_queue, cl_kernel, cl_uint,
const cl_event *, cl_event *);
188 typedef cl_int (*f_clEnqueueNativeKernel)(cl_command_queue, void (*user_func)(
void *),
void *,
size_t,
189 cl_uint,
const cl_mem *,
const void **, cl_uint,
const cl_event *, cl_event *);
191 typedef cl_int (*f_clEnqueueMarkerWithWaitList)(cl_command_queue, cl_uint,
const cl_event *, cl_event *);
193 typedef cl_int (*f_clEnqueueBarrierWithWaitList)(cl_command_queue, cl_uint,
const cl_event *, cl_event *);
195 typedef void * (*f_clGetExtensionFunctionAddressForPlatform)(cl_platform_id,
const char *);
197 typedef cl_mem (*f_clCreateImage2D)(cl_context, cl_mem_flags,
const cl_image_format *, size_t, size_t,
198 size_t,
void *, cl_int *);
200 typedef cl_mem (*f_clCreateImage3D)(cl_context, cl_mem_flags,
const cl_image_format *, size_t,
201 size_t, size_t, size_t, size_t,
void *, cl_int *);
203 typedef cl_int (*f_clEnqueueMarker)(cl_command_queue, cl_event *);
205 typedef cl_int(*f_clEnqueueWaitForEvents)(cl_command_queue, cl_uint,
const cl_event *);
207 typedef cl_int (*f_clEnqueueBarrier)(cl_command_queue);
209 typedef cl_int (*f_clUnloadCompiler)(void);
211 typedef void * (*f_clGetExtensionFunctionAddress)(
const char *);
213 typedef cl_mem (*f_clCreateFromGLBuffer) (cl_context, cl_mem_flags, cl_GLuint,
int *);
215 typedef cl_mem (*f_clCreateFromGLTexture) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
217 typedef cl_mem (*f_clCreateFromGLRenderbuffer) (cl_context, cl_mem_flags, cl_GLuint, cl_int *);
219 typedef cl_int (*f_clGetGLObjectInfo) (cl_mem memobj, cl_gl_object_type *, cl_GLuint *);
221 typedef cl_int (*f_clGetGLTextureInfo) (cl_mem, cl_gl_texture_info, size_t,
void *,
size_t *);
223 typedef cl_int (*f_clEnqueueAcquireGLObjects) (cl_command_queue, cl_uint,
const cl_mem *, cl_uint,
224 const cl_event *, cl_event *);
226 typedef cl_int (*f_clEnqueueReleaseGLObjects) (cl_command_queue, cl_uint,
const cl_mem *, cl_uint,
227 const cl_event *, cl_event *);
229 typedef cl_mem (*f_clCreateFromGLTexture2D) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
231 typedef cl_mem (*f_clCreateFromGLTexture3D) (cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *);
234 typedef cl_int (*f_clGetGLContextInfoKHR) (
const cl_context_properties *, cl_gl_context_info, size_t,
239 void stubOpenclReset();
242 int open_libopencl_so();
243 cl_int get_libopencl_path(
char** cl_path);
249 #endif // LIBOPENCL_STUB_H