1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from cl.xml.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // libOpenCL_autogen.cpp: Implements the exported CL functions.
9 
10 #include "libOpenCL/dispatch.h"
11 
12 extern "C" {
13 
14 // CL 1.0
clGetPlatformIDs(cl_uint num_entries,cl_platform_id * platforms,cl_uint * num_platforms)15 cl_int CL_API_CALL clGetPlatformIDs(cl_uint num_entries,
16                                     cl_platform_id *platforms,
17                                     cl_uint *num_platforms)
18 {
19     return cl::GetDispatch().clGetPlatformIDs(num_entries, platforms, num_platforms);
20 }
21 
clGetPlatformInfo(cl_platform_id platform,cl_platform_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)22 cl_int CL_API_CALL clGetPlatformInfo(cl_platform_id platform,
23                                      cl_platform_info param_name,
24                                      size_t param_value_size,
25                                      void *param_value,
26                                      size_t *param_value_size_ret)
27 {
28     return cl::GetDispatch().clGetPlatformInfo(platform, param_name, param_value_size, param_value,
29                                                param_value_size_ret);
30 }
31 
clGetDeviceIDs(cl_platform_id platform,cl_device_type device_type,cl_uint num_entries,cl_device_id * devices,cl_uint * num_devices)32 cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform,
33                                   cl_device_type device_type,
34                                   cl_uint num_entries,
35                                   cl_device_id *devices,
36                                   cl_uint *num_devices)
37 {
38     return cl::GetDispatch().clGetDeviceIDs(platform, device_type, num_entries, devices,
39                                             num_devices);
40 }
41 
clGetDeviceInfo(cl_device_id device,cl_device_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)42 cl_int CL_API_CALL clGetDeviceInfo(cl_device_id device,
43                                    cl_device_info param_name,
44                                    size_t param_value_size,
45                                    void *param_value,
46                                    size_t *param_value_size_ret)
47 {
48     return cl::GetDispatch().clGetDeviceInfo(device, param_name, param_value_size, param_value,
49                                              param_value_size_ret);
50 }
51 
clCreateContext(const cl_context_properties * properties,cl_uint num_devices,const cl_device_id * devices,void (CL_CALLBACK * pfn_notify)(const char * errinfo,const void * private_info,size_t cb,void * user_data),void * user_data,cl_int * errcode_ret)52 cl_context CL_API_CALL clCreateContext(const cl_context_properties *properties,
53                                        cl_uint num_devices,
54                                        const cl_device_id *devices,
55                                        void(CL_CALLBACK *pfn_notify)(const char *errinfo,
56                                                                      const void *private_info,
57                                                                      size_t cb,
58                                                                      void *user_data),
59                                        void *user_data,
60                                        cl_int *errcode_ret)
61 {
62     return cl::GetDispatch().clCreateContext(properties, num_devices, devices, pfn_notify,
63                                              user_data, errcode_ret);
64 }
65 
66 cl_context CL_API_CALL
clCreateContextFromType(const cl_context_properties * properties,cl_device_type device_type,void (CL_CALLBACK * pfn_notify)(const char * errinfo,const void * private_info,size_t cb,void * user_data),void * user_data,cl_int * errcode_ret)67 clCreateContextFromType(const cl_context_properties *properties,
68                         cl_device_type device_type,
69                         void(CL_CALLBACK *pfn_notify)(const char *errinfo,
70                                                       const void *private_info,
71                                                       size_t cb,
72                                                       void *user_data),
73                         void *user_data,
74                         cl_int *errcode_ret)
75 {
76     return cl::GetDispatch().clCreateContextFromType(properties, device_type, pfn_notify, user_data,
77                                                      errcode_ret);
78 }
79 
clRetainContext(cl_context context)80 cl_int CL_API_CALL clRetainContext(cl_context context)
81 {
82     return cl::GetDispatch().clRetainContext(context);
83 }
84 
clReleaseContext(cl_context context)85 cl_int CL_API_CALL clReleaseContext(cl_context context)
86 {
87     return cl::GetDispatch().clReleaseContext(context);
88 }
89 
clGetContextInfo(cl_context context,cl_context_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)90 cl_int CL_API_CALL clGetContextInfo(cl_context context,
91                                     cl_context_info param_name,
92                                     size_t param_value_size,
93                                     void *param_value,
94                                     size_t *param_value_size_ret)
95 {
96     return cl::GetDispatch().clGetContextInfo(context, param_name, param_value_size, param_value,
97                                               param_value_size_ret);
98 }
99 
clRetainCommandQueue(cl_command_queue command_queue)100 cl_int CL_API_CALL clRetainCommandQueue(cl_command_queue command_queue)
101 {
102     return cl::GetDispatch().clRetainCommandQueue(command_queue);
103 }
104 
clReleaseCommandQueue(cl_command_queue command_queue)105 cl_int CL_API_CALL clReleaseCommandQueue(cl_command_queue command_queue)
106 {
107     return cl::GetDispatch().clReleaseCommandQueue(command_queue);
108 }
109 
clGetCommandQueueInfo(cl_command_queue command_queue,cl_command_queue_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)110 cl_int CL_API_CALL clGetCommandQueueInfo(cl_command_queue command_queue,
111                                          cl_command_queue_info param_name,
112                                          size_t param_value_size,
113                                          void *param_value,
114                                          size_t *param_value_size_ret)
115 {
116     return cl::GetDispatch().clGetCommandQueueInfo(command_queue, param_name, param_value_size,
117                                                    param_value, param_value_size_ret);
118 }
119 
clCreateBuffer(cl_context context,cl_mem_flags flags,size_t size,void * host_ptr,cl_int * errcode_ret)120 cl_mem CL_API_CALL clCreateBuffer(cl_context context,
121                                   cl_mem_flags flags,
122                                   size_t size,
123                                   void *host_ptr,
124                                   cl_int *errcode_ret)
125 {
126     return cl::GetDispatch().clCreateBuffer(context, flags, size, host_ptr, errcode_ret);
127 }
128 
clRetainMemObject(cl_mem memobj)129 cl_int CL_API_CALL clRetainMemObject(cl_mem memobj)
130 {
131     return cl::GetDispatch().clRetainMemObject(memobj);
132 }
133 
clReleaseMemObject(cl_mem memobj)134 cl_int CL_API_CALL clReleaseMemObject(cl_mem memobj)
135 {
136     return cl::GetDispatch().clReleaseMemObject(memobj);
137 }
138 
clGetSupportedImageFormats(cl_context context,cl_mem_flags flags,cl_mem_object_type image_type,cl_uint num_entries,cl_image_format * image_formats,cl_uint * num_image_formats)139 cl_int CL_API_CALL clGetSupportedImageFormats(cl_context context,
140                                               cl_mem_flags flags,
141                                               cl_mem_object_type image_type,
142                                               cl_uint num_entries,
143                                               cl_image_format *image_formats,
144                                               cl_uint *num_image_formats)
145 {
146     return cl::GetDispatch().clGetSupportedImageFormats(context, flags, image_type, num_entries,
147                                                         image_formats, num_image_formats);
148 }
149 
clGetMemObjectInfo(cl_mem memobj,cl_mem_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)150 cl_int CL_API_CALL clGetMemObjectInfo(cl_mem memobj,
151                                       cl_mem_info param_name,
152                                       size_t param_value_size,
153                                       void *param_value,
154                                       size_t *param_value_size_ret)
155 {
156     return cl::GetDispatch().clGetMemObjectInfo(memobj, param_name, param_value_size, param_value,
157                                                 param_value_size_ret);
158 }
159 
clGetImageInfo(cl_mem image,cl_image_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)160 cl_int CL_API_CALL clGetImageInfo(cl_mem image,
161                                   cl_image_info param_name,
162                                   size_t param_value_size,
163                                   void *param_value,
164                                   size_t *param_value_size_ret)
165 {
166     return cl::GetDispatch().clGetImageInfo(image, param_name, param_value_size, param_value,
167                                             param_value_size_ret);
168 }
169 
clRetainSampler(cl_sampler sampler)170 cl_int CL_API_CALL clRetainSampler(cl_sampler sampler)
171 {
172     return cl::GetDispatch().clRetainSampler(sampler);
173 }
174 
clReleaseSampler(cl_sampler sampler)175 cl_int CL_API_CALL clReleaseSampler(cl_sampler sampler)
176 {
177     return cl::GetDispatch().clReleaseSampler(sampler);
178 }
179 
clGetSamplerInfo(cl_sampler sampler,cl_sampler_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)180 cl_int CL_API_CALL clGetSamplerInfo(cl_sampler sampler,
181                                     cl_sampler_info param_name,
182                                     size_t param_value_size,
183                                     void *param_value,
184                                     size_t *param_value_size_ret)
185 {
186     return cl::GetDispatch().clGetSamplerInfo(sampler, param_name, param_value_size, param_value,
187                                               param_value_size_ret);
188 }
189 
clCreateProgramWithSource(cl_context context,cl_uint count,const char ** strings,const size_t * lengths,cl_int * errcode_ret)190 cl_program CL_API_CALL clCreateProgramWithSource(cl_context context,
191                                                  cl_uint count,
192                                                  const char **strings,
193                                                  const size_t *lengths,
194                                                  cl_int *errcode_ret)
195 {
196     return cl::GetDispatch().clCreateProgramWithSource(context, count, strings, lengths,
197                                                        errcode_ret);
198 }
199 
clCreateProgramWithBinary(cl_context context,cl_uint num_devices,const cl_device_id * device_list,const size_t * lengths,const unsigned char ** binaries,cl_int * binary_status,cl_int * errcode_ret)200 cl_program CL_API_CALL clCreateProgramWithBinary(cl_context context,
201                                                  cl_uint num_devices,
202                                                  const cl_device_id *device_list,
203                                                  const size_t *lengths,
204                                                  const unsigned char **binaries,
205                                                  cl_int *binary_status,
206                                                  cl_int *errcode_ret)
207 {
208     return cl::GetDispatch().clCreateProgramWithBinary(context, num_devices, device_list, lengths,
209                                                        binaries, binary_status, errcode_ret);
210 }
211 
clRetainProgram(cl_program program)212 cl_int CL_API_CALL clRetainProgram(cl_program program)
213 {
214     return cl::GetDispatch().clRetainProgram(program);
215 }
216 
clReleaseProgram(cl_program program)217 cl_int CL_API_CALL clReleaseProgram(cl_program program)
218 {
219     return cl::GetDispatch().clReleaseProgram(program);
220 }
221 
clBuildProgram(cl_program program,cl_uint num_devices,const cl_device_id * device_list,const char * options,void (CL_CALLBACK * pfn_notify)(cl_program program,void * user_data),void * user_data)222 cl_int CL_API_CALL clBuildProgram(cl_program program,
223                                   cl_uint num_devices,
224                                   const cl_device_id *device_list,
225                                   const char *options,
226                                   void(CL_CALLBACK *pfn_notify)(cl_program program,
227                                                                 void *user_data),
228                                   void *user_data)
229 {
230     return cl::GetDispatch().clBuildProgram(program, num_devices, device_list, options, pfn_notify,
231                                             user_data);
232 }
233 
clGetProgramInfo(cl_program program,cl_program_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)234 cl_int CL_API_CALL clGetProgramInfo(cl_program program,
235                                     cl_program_info param_name,
236                                     size_t param_value_size,
237                                     void *param_value,
238                                     size_t *param_value_size_ret)
239 {
240     return cl::GetDispatch().clGetProgramInfo(program, param_name, param_value_size, param_value,
241                                               param_value_size_ret);
242 }
243 
clGetProgramBuildInfo(cl_program program,cl_device_id device,cl_program_build_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)244 cl_int CL_API_CALL clGetProgramBuildInfo(cl_program program,
245                                          cl_device_id device,
246                                          cl_program_build_info param_name,
247                                          size_t param_value_size,
248                                          void *param_value,
249                                          size_t *param_value_size_ret)
250 {
251     return cl::GetDispatch().clGetProgramBuildInfo(program, device, param_name, param_value_size,
252                                                    param_value, param_value_size_ret);
253 }
254 
clCreateKernel(cl_program program,const char * kernel_name,cl_int * errcode_ret)255 cl_kernel CL_API_CALL clCreateKernel(cl_program program,
256                                      const char *kernel_name,
257                                      cl_int *errcode_ret)
258 {
259     return cl::GetDispatch().clCreateKernel(program, kernel_name, errcode_ret);
260 }
261 
clCreateKernelsInProgram(cl_program program,cl_uint num_kernels,cl_kernel * kernels,cl_uint * num_kernels_ret)262 cl_int CL_API_CALL clCreateKernelsInProgram(cl_program program,
263                                             cl_uint num_kernels,
264                                             cl_kernel *kernels,
265                                             cl_uint *num_kernels_ret)
266 {
267     return cl::GetDispatch().clCreateKernelsInProgram(program, num_kernels, kernels,
268                                                       num_kernels_ret);
269 }
270 
clRetainKernel(cl_kernel kernel)271 cl_int CL_API_CALL clRetainKernel(cl_kernel kernel)
272 {
273     return cl::GetDispatch().clRetainKernel(kernel);
274 }
275 
clReleaseKernel(cl_kernel kernel)276 cl_int CL_API_CALL clReleaseKernel(cl_kernel kernel)
277 {
278     return cl::GetDispatch().clReleaseKernel(kernel);
279 }
280 
clSetKernelArg(cl_kernel kernel,cl_uint arg_index,size_t arg_size,const void * arg_value)281 cl_int CL_API_CALL clSetKernelArg(cl_kernel kernel,
282                                   cl_uint arg_index,
283                                   size_t arg_size,
284                                   const void *arg_value)
285 {
286     return cl::GetDispatch().clSetKernelArg(kernel, arg_index, arg_size, arg_value);
287 }
288 
clGetKernelInfo(cl_kernel kernel,cl_kernel_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)289 cl_int CL_API_CALL clGetKernelInfo(cl_kernel kernel,
290                                    cl_kernel_info param_name,
291                                    size_t param_value_size,
292                                    void *param_value,
293                                    size_t *param_value_size_ret)
294 {
295     return cl::GetDispatch().clGetKernelInfo(kernel, param_name, param_value_size, param_value,
296                                              param_value_size_ret);
297 }
298 
clGetKernelWorkGroupInfo(cl_kernel kernel,cl_device_id device,cl_kernel_work_group_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)299 cl_int CL_API_CALL clGetKernelWorkGroupInfo(cl_kernel kernel,
300                                             cl_device_id device,
301                                             cl_kernel_work_group_info param_name,
302                                             size_t param_value_size,
303                                             void *param_value,
304                                             size_t *param_value_size_ret)
305 {
306     return cl::GetDispatch().clGetKernelWorkGroupInfo(kernel, device, param_name, param_value_size,
307                                                       param_value, param_value_size_ret);
308 }
309 
clWaitForEvents(cl_uint num_events,const cl_event * event_list)310 cl_int CL_API_CALL clWaitForEvents(cl_uint num_events, const cl_event *event_list)
311 {
312     return cl::GetDispatch().clWaitForEvents(num_events, event_list);
313 }
314 
clGetEventInfo(cl_event event,cl_event_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)315 cl_int CL_API_CALL clGetEventInfo(cl_event event,
316                                   cl_event_info param_name,
317                                   size_t param_value_size,
318                                   void *param_value,
319                                   size_t *param_value_size_ret)
320 {
321     return cl::GetDispatch().clGetEventInfo(event, param_name, param_value_size, param_value,
322                                             param_value_size_ret);
323 }
324 
clRetainEvent(cl_event event)325 cl_int CL_API_CALL clRetainEvent(cl_event event)
326 {
327     return cl::GetDispatch().clRetainEvent(event);
328 }
329 
clReleaseEvent(cl_event event)330 cl_int CL_API_CALL clReleaseEvent(cl_event event)
331 {
332     return cl::GetDispatch().clReleaseEvent(event);
333 }
334 
clGetEventProfilingInfo(cl_event event,cl_profiling_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)335 cl_int CL_API_CALL clGetEventProfilingInfo(cl_event event,
336                                            cl_profiling_info param_name,
337                                            size_t param_value_size,
338                                            void *param_value,
339                                            size_t *param_value_size_ret)
340 {
341     return cl::GetDispatch().clGetEventProfilingInfo(event, param_name, param_value_size,
342                                                      param_value, param_value_size_ret);
343 }
344 
clFlush(cl_command_queue command_queue)345 cl_int CL_API_CALL clFlush(cl_command_queue command_queue)
346 {
347     return cl::GetDispatch().clFlush(command_queue);
348 }
349 
clFinish(cl_command_queue command_queue)350 cl_int CL_API_CALL clFinish(cl_command_queue command_queue)
351 {
352     return cl::GetDispatch().clFinish(command_queue);
353 }
354 
clEnqueueReadBuffer(cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_read,size_t offset,size_t size,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)355 cl_int CL_API_CALL clEnqueueReadBuffer(cl_command_queue command_queue,
356                                        cl_mem buffer,
357                                        cl_bool blocking_read,
358                                        size_t offset,
359                                        size_t size,
360                                        void *ptr,
361                                        cl_uint num_events_in_wait_list,
362                                        const cl_event *event_wait_list,
363                                        cl_event *event)
364 {
365     return cl::GetDispatch().clEnqueueReadBuffer(command_queue, buffer, blocking_read, offset, size,
366                                                  ptr, num_events_in_wait_list, event_wait_list,
367                                                  event);
368 }
369 
clEnqueueWriteBuffer(cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_write,size_t offset,size_t size,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)370 cl_int CL_API_CALL clEnqueueWriteBuffer(cl_command_queue command_queue,
371                                         cl_mem buffer,
372                                         cl_bool blocking_write,
373                                         size_t offset,
374                                         size_t size,
375                                         const void *ptr,
376                                         cl_uint num_events_in_wait_list,
377                                         const cl_event *event_wait_list,
378                                         cl_event *event)
379 {
380     return cl::GetDispatch().clEnqueueWriteBuffer(command_queue, buffer, blocking_write, offset,
381                                                   size, ptr, num_events_in_wait_list,
382                                                   event_wait_list, event);
383 }
384 
clEnqueueCopyBuffer(cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_buffer,size_t src_offset,size_t dst_offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)385 cl_int CL_API_CALL clEnqueueCopyBuffer(cl_command_queue command_queue,
386                                        cl_mem src_buffer,
387                                        cl_mem dst_buffer,
388                                        size_t src_offset,
389                                        size_t dst_offset,
390                                        size_t size,
391                                        cl_uint num_events_in_wait_list,
392                                        const cl_event *event_wait_list,
393                                        cl_event *event)
394 {
395     return cl::GetDispatch().clEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset,
396                                                  dst_offset, size, num_events_in_wait_list,
397                                                  event_wait_list, event);
398 }
399 
clEnqueueReadImage(cl_command_queue command_queue,cl_mem image,cl_bool blocking_read,const size_t * origin,const size_t * region,size_t row_pitch,size_t slice_pitch,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)400 cl_int CL_API_CALL clEnqueueReadImage(cl_command_queue command_queue,
401                                       cl_mem image,
402                                       cl_bool blocking_read,
403                                       const size_t *origin,
404                                       const size_t *region,
405                                       size_t row_pitch,
406                                       size_t slice_pitch,
407                                       void *ptr,
408                                       cl_uint num_events_in_wait_list,
409                                       const cl_event *event_wait_list,
410                                       cl_event *event)
411 {
412     return cl::GetDispatch().clEnqueueReadImage(command_queue, image, blocking_read, origin, region,
413                                                 row_pitch, slice_pitch, ptr,
414                                                 num_events_in_wait_list, event_wait_list, event);
415 }
416 
clEnqueueWriteImage(cl_command_queue command_queue,cl_mem image,cl_bool blocking_write,const size_t * origin,const size_t * region,size_t input_row_pitch,size_t input_slice_pitch,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)417 cl_int CL_API_CALL clEnqueueWriteImage(cl_command_queue command_queue,
418                                        cl_mem image,
419                                        cl_bool blocking_write,
420                                        const size_t *origin,
421                                        const size_t *region,
422                                        size_t input_row_pitch,
423                                        size_t input_slice_pitch,
424                                        const void *ptr,
425                                        cl_uint num_events_in_wait_list,
426                                        const cl_event *event_wait_list,
427                                        cl_event *event)
428 {
429     return cl::GetDispatch().clEnqueueWriteImage(command_queue, image, blocking_write, origin,
430                                                  region, input_row_pitch, input_slice_pitch, ptr,
431                                                  num_events_in_wait_list, event_wait_list, event);
432 }
433 
clEnqueueCopyImage(cl_command_queue command_queue,cl_mem src_image,cl_mem dst_image,const size_t * src_origin,const size_t * dst_origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)434 cl_int CL_API_CALL clEnqueueCopyImage(cl_command_queue command_queue,
435                                       cl_mem src_image,
436                                       cl_mem dst_image,
437                                       const size_t *src_origin,
438                                       const size_t *dst_origin,
439                                       const size_t *region,
440                                       cl_uint num_events_in_wait_list,
441                                       const cl_event *event_wait_list,
442                                       cl_event *event)
443 {
444     return cl::GetDispatch().clEnqueueCopyImage(command_queue, src_image, dst_image, src_origin,
445                                                 dst_origin, region, num_events_in_wait_list,
446                                                 event_wait_list, event);
447 }
448 
clEnqueueCopyImageToBuffer(cl_command_queue command_queue,cl_mem src_image,cl_mem dst_buffer,const size_t * src_origin,const size_t * region,size_t dst_offset,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)449 cl_int CL_API_CALL clEnqueueCopyImageToBuffer(cl_command_queue command_queue,
450                                               cl_mem src_image,
451                                               cl_mem dst_buffer,
452                                               const size_t *src_origin,
453                                               const size_t *region,
454                                               size_t dst_offset,
455                                               cl_uint num_events_in_wait_list,
456                                               const cl_event *event_wait_list,
457                                               cl_event *event)
458 {
459     return cl::GetDispatch().clEnqueueCopyImageToBuffer(
460         command_queue, src_image, dst_buffer, src_origin, region, dst_offset,
461         num_events_in_wait_list, event_wait_list, event);
462 }
463 
clEnqueueCopyBufferToImage(cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_image,size_t src_offset,const size_t * dst_origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)464 cl_int CL_API_CALL clEnqueueCopyBufferToImage(cl_command_queue command_queue,
465                                               cl_mem src_buffer,
466                                               cl_mem dst_image,
467                                               size_t src_offset,
468                                               const size_t *dst_origin,
469                                               const size_t *region,
470                                               cl_uint num_events_in_wait_list,
471                                               const cl_event *event_wait_list,
472                                               cl_event *event)
473 {
474     return cl::GetDispatch().clEnqueueCopyBufferToImage(
475         command_queue, src_buffer, dst_image, src_offset, dst_origin, region,
476         num_events_in_wait_list, event_wait_list, event);
477 }
478 
clEnqueueMapBuffer(cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_map,cl_map_flags map_flags,size_t offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event,cl_int * errcode_ret)479 void *CL_API_CALL clEnqueueMapBuffer(cl_command_queue command_queue,
480                                      cl_mem buffer,
481                                      cl_bool blocking_map,
482                                      cl_map_flags map_flags,
483                                      size_t offset,
484                                      size_t size,
485                                      cl_uint num_events_in_wait_list,
486                                      const cl_event *event_wait_list,
487                                      cl_event *event,
488                                      cl_int *errcode_ret)
489 {
490     return cl::GetDispatch().clEnqueueMapBuffer(command_queue, buffer, blocking_map, map_flags,
491                                                 offset, size, num_events_in_wait_list,
492                                                 event_wait_list, event, errcode_ret);
493 }
494 
clEnqueueMapImage(cl_command_queue command_queue,cl_mem image,cl_bool blocking_map,cl_map_flags map_flags,const size_t * origin,const size_t * region,size_t * image_row_pitch,size_t * image_slice_pitch,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event,cl_int * errcode_ret)495 void *CL_API_CALL clEnqueueMapImage(cl_command_queue command_queue,
496                                     cl_mem image,
497                                     cl_bool blocking_map,
498                                     cl_map_flags map_flags,
499                                     const size_t *origin,
500                                     const size_t *region,
501                                     size_t *image_row_pitch,
502                                     size_t *image_slice_pitch,
503                                     cl_uint num_events_in_wait_list,
504                                     const cl_event *event_wait_list,
505                                     cl_event *event,
506                                     cl_int *errcode_ret)
507 {
508     return cl::GetDispatch().clEnqueueMapImage(
509         command_queue, image, blocking_map, map_flags, origin, region, image_row_pitch,
510         image_slice_pitch, num_events_in_wait_list, event_wait_list, event, errcode_ret);
511 }
512 
clEnqueueUnmapMemObject(cl_command_queue command_queue,cl_mem memobj,void * mapped_ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)513 cl_int CL_API_CALL clEnqueueUnmapMemObject(cl_command_queue command_queue,
514                                            cl_mem memobj,
515                                            void *mapped_ptr,
516                                            cl_uint num_events_in_wait_list,
517                                            const cl_event *event_wait_list,
518                                            cl_event *event)
519 {
520     return cl::GetDispatch().clEnqueueUnmapMemObject(
521         command_queue, memobj, mapped_ptr, num_events_in_wait_list, event_wait_list, event);
522 }
523 
clEnqueueNDRangeKernel(cl_command_queue command_queue,cl_kernel kernel,cl_uint work_dim,const size_t * global_work_offset,const size_t * global_work_size,const size_t * local_work_size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)524 cl_int CL_API_CALL clEnqueueNDRangeKernel(cl_command_queue command_queue,
525                                           cl_kernel kernel,
526                                           cl_uint work_dim,
527                                           const size_t *global_work_offset,
528                                           const size_t *global_work_size,
529                                           const size_t *local_work_size,
530                                           cl_uint num_events_in_wait_list,
531                                           const cl_event *event_wait_list,
532                                           cl_event *event)
533 {
534     return cl::GetDispatch().clEnqueueNDRangeKernel(
535         command_queue, kernel, work_dim, global_work_offset, global_work_size, local_work_size,
536         num_events_in_wait_list, event_wait_list, event);
537 }
538 
clEnqueueNativeKernel(cl_command_queue command_queue,void (CL_CALLBACK * user_func)(void *),void * args,size_t cb_args,cl_uint num_mem_objects,const cl_mem * mem_list,const void ** args_mem_loc,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)539 cl_int CL_API_CALL clEnqueueNativeKernel(cl_command_queue command_queue,
540                                          void(CL_CALLBACK *user_func)(void *),
541                                          void *args,
542                                          size_t cb_args,
543                                          cl_uint num_mem_objects,
544                                          const cl_mem *mem_list,
545                                          const void **args_mem_loc,
546                                          cl_uint num_events_in_wait_list,
547                                          const cl_event *event_wait_list,
548                                          cl_event *event)
549 {
550     return cl::GetDispatch().clEnqueueNativeKernel(command_queue, user_func, args, cb_args,
551                                                    num_mem_objects, mem_list, args_mem_loc,
552                                                    num_events_in_wait_list, event_wait_list, event);
553 }
554 
clSetCommandQueueProperty(cl_command_queue command_queue,cl_command_queue_properties properties,cl_bool enable,cl_command_queue_properties * old_properties)555 cl_int CL_API_CALL clSetCommandQueueProperty(cl_command_queue command_queue,
556                                              cl_command_queue_properties properties,
557                                              cl_bool enable,
558                                              cl_command_queue_properties *old_properties)
559 {
560     return cl::GetDispatch().clSetCommandQueueProperty(command_queue, properties, enable,
561                                                        old_properties);
562 }
563 
clCreateImage2D(cl_context context,cl_mem_flags flags,const cl_image_format * image_format,size_t image_width,size_t image_height,size_t image_row_pitch,void * host_ptr,cl_int * errcode_ret)564 cl_mem CL_API_CALL clCreateImage2D(cl_context context,
565                                    cl_mem_flags flags,
566                                    const cl_image_format *image_format,
567                                    size_t image_width,
568                                    size_t image_height,
569                                    size_t image_row_pitch,
570                                    void *host_ptr,
571                                    cl_int *errcode_ret)
572 {
573     return cl::GetDispatch().clCreateImage2D(context, flags, image_format, image_width,
574                                              image_height, image_row_pitch, host_ptr, errcode_ret);
575 }
576 
clCreateImage3D(cl_context context,cl_mem_flags flags,const cl_image_format * image_format,size_t image_width,size_t image_height,size_t image_depth,size_t image_row_pitch,size_t image_slice_pitch,void * host_ptr,cl_int * errcode_ret)577 cl_mem CL_API_CALL clCreateImage3D(cl_context context,
578                                    cl_mem_flags flags,
579                                    const cl_image_format *image_format,
580                                    size_t image_width,
581                                    size_t image_height,
582                                    size_t image_depth,
583                                    size_t image_row_pitch,
584                                    size_t image_slice_pitch,
585                                    void *host_ptr,
586                                    cl_int *errcode_ret)
587 {
588     return cl::GetDispatch().clCreateImage3D(context, flags, image_format, image_width,
589                                              image_height, image_depth, image_row_pitch,
590                                              image_slice_pitch, host_ptr, errcode_ret);
591 }
592 
clEnqueueMarker(cl_command_queue command_queue,cl_event * event)593 cl_int CL_API_CALL clEnqueueMarker(cl_command_queue command_queue, cl_event *event)
594 {
595     return cl::GetDispatch().clEnqueueMarker(command_queue, event);
596 }
597 
clEnqueueWaitForEvents(cl_command_queue command_queue,cl_uint num_events,const cl_event * event_list)598 cl_int CL_API_CALL clEnqueueWaitForEvents(cl_command_queue command_queue,
599                                           cl_uint num_events,
600                                           const cl_event *event_list)
601 {
602     return cl::GetDispatch().clEnqueueWaitForEvents(command_queue, num_events, event_list);
603 }
604 
clEnqueueBarrier(cl_command_queue command_queue)605 cl_int CL_API_CALL clEnqueueBarrier(cl_command_queue command_queue)
606 {
607     return cl::GetDispatch().clEnqueueBarrier(command_queue);
608 }
609 
clUnloadCompiler()610 cl_int CL_API_CALL clUnloadCompiler()
611 {
612     return cl::GetDispatch().clUnloadCompiler();
613 }
614 
clGetExtensionFunctionAddress(const char * func_name)615 void *CL_API_CALL clGetExtensionFunctionAddress(const char *func_name)
616 {
617     return cl::GetDispatch().clGetExtensionFunctionAddress(func_name);
618 }
619 
clCreateCommandQueue(cl_context context,cl_device_id device,cl_command_queue_properties properties,cl_int * errcode_ret)620 cl_command_queue CL_API_CALL clCreateCommandQueue(cl_context context,
621                                                   cl_device_id device,
622                                                   cl_command_queue_properties properties,
623                                                   cl_int *errcode_ret)
624 {
625     return cl::GetDispatch().clCreateCommandQueue(context, device, properties, errcode_ret);
626 }
627 
clCreateSampler(cl_context context,cl_bool normalized_coords,cl_addressing_mode addressing_mode,cl_filter_mode filter_mode,cl_int * errcode_ret)628 cl_sampler CL_API_CALL clCreateSampler(cl_context context,
629                                        cl_bool normalized_coords,
630                                        cl_addressing_mode addressing_mode,
631                                        cl_filter_mode filter_mode,
632                                        cl_int *errcode_ret)
633 {
634     return cl::GetDispatch().clCreateSampler(context, normalized_coords, addressing_mode,
635                                              filter_mode, errcode_ret);
636 }
637 
clEnqueueTask(cl_command_queue command_queue,cl_kernel kernel,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)638 cl_int CL_API_CALL clEnqueueTask(cl_command_queue command_queue,
639                                  cl_kernel kernel,
640                                  cl_uint num_events_in_wait_list,
641                                  const cl_event *event_wait_list,
642                                  cl_event *event)
643 {
644     return cl::GetDispatch().clEnqueueTask(command_queue, kernel, num_events_in_wait_list,
645                                            event_wait_list, event);
646 }
647 
648 // CL 1.1
clCreateSubBuffer(cl_mem buffer,cl_mem_flags flags,cl_buffer_create_type buffer_create_type,const void * buffer_create_info,cl_int * errcode_ret)649 cl_mem CL_API_CALL clCreateSubBuffer(cl_mem buffer,
650                                      cl_mem_flags flags,
651                                      cl_buffer_create_type buffer_create_type,
652                                      const void *buffer_create_info,
653                                      cl_int *errcode_ret)
654 {
655     return cl::GetDispatch().clCreateSubBuffer(buffer, flags, buffer_create_type,
656                                                buffer_create_info, errcode_ret);
657 }
658 
clSetMemObjectDestructorCallback(cl_mem memobj,void (CL_CALLBACK * pfn_notify)(cl_mem memobj,void * user_data),void * user_data)659 cl_int CL_API_CALL clSetMemObjectDestructorCallback(cl_mem memobj,
660                                                     void(CL_CALLBACK *pfn_notify)(cl_mem memobj,
661                                                                                   void *user_data),
662                                                     void *user_data)
663 {
664     return cl::GetDispatch().clSetMemObjectDestructorCallback(memobj, pfn_notify, user_data);
665 }
666 
clCreateUserEvent(cl_context context,cl_int * errcode_ret)667 cl_event CL_API_CALL clCreateUserEvent(cl_context context, cl_int *errcode_ret)
668 {
669     return cl::GetDispatch().clCreateUserEvent(context, errcode_ret);
670 }
671 
clSetUserEventStatus(cl_event event,cl_int execution_status)672 cl_int CL_API_CALL clSetUserEventStatus(cl_event event, cl_int execution_status)
673 {
674     return cl::GetDispatch().clSetUserEventStatus(event, execution_status);
675 }
676 
clSetEventCallback(cl_event event,cl_int command_exec_callback_type,void (CL_CALLBACK * pfn_notify)(cl_event event,cl_int event_command_status,void * user_data),void * user_data)677 cl_int CL_API_CALL clSetEventCallback(cl_event event,
678                                       cl_int command_exec_callback_type,
679                                       void(CL_CALLBACK *pfn_notify)(cl_event event,
680                                                                     cl_int event_command_status,
681                                                                     void *user_data),
682                                       void *user_data)
683 {
684     return cl::GetDispatch().clSetEventCallback(event, command_exec_callback_type, pfn_notify,
685                                                 user_data);
686 }
687 
clEnqueueReadBufferRect(cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_read,const size_t * buffer_origin,const size_t * host_origin,const size_t * region,size_t buffer_row_pitch,size_t buffer_slice_pitch,size_t host_row_pitch,size_t host_slice_pitch,void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)688 cl_int CL_API_CALL clEnqueueReadBufferRect(cl_command_queue command_queue,
689                                            cl_mem buffer,
690                                            cl_bool blocking_read,
691                                            const size_t *buffer_origin,
692                                            const size_t *host_origin,
693                                            const size_t *region,
694                                            size_t buffer_row_pitch,
695                                            size_t buffer_slice_pitch,
696                                            size_t host_row_pitch,
697                                            size_t host_slice_pitch,
698                                            void *ptr,
699                                            cl_uint num_events_in_wait_list,
700                                            const cl_event *event_wait_list,
701                                            cl_event *event)
702 {
703     return cl::GetDispatch().clEnqueueReadBufferRect(
704         command_queue, buffer, blocking_read, buffer_origin, host_origin, region, buffer_row_pitch,
705         buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list,
706         event_wait_list, event);
707 }
708 
clEnqueueWriteBufferRect(cl_command_queue command_queue,cl_mem buffer,cl_bool blocking_write,const size_t * buffer_origin,const size_t * host_origin,const size_t * region,size_t buffer_row_pitch,size_t buffer_slice_pitch,size_t host_row_pitch,size_t host_slice_pitch,const void * ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)709 cl_int CL_API_CALL clEnqueueWriteBufferRect(cl_command_queue command_queue,
710                                             cl_mem buffer,
711                                             cl_bool blocking_write,
712                                             const size_t *buffer_origin,
713                                             const size_t *host_origin,
714                                             const size_t *region,
715                                             size_t buffer_row_pitch,
716                                             size_t buffer_slice_pitch,
717                                             size_t host_row_pitch,
718                                             size_t host_slice_pitch,
719                                             const void *ptr,
720                                             cl_uint num_events_in_wait_list,
721                                             const cl_event *event_wait_list,
722                                             cl_event *event)
723 {
724     return cl::GetDispatch().clEnqueueWriteBufferRect(
725         command_queue, buffer, blocking_write, buffer_origin, host_origin, region, buffer_row_pitch,
726         buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list,
727         event_wait_list, event);
728 }
729 
clEnqueueCopyBufferRect(cl_command_queue command_queue,cl_mem src_buffer,cl_mem dst_buffer,const size_t * src_origin,const size_t * dst_origin,const size_t * region,size_t src_row_pitch,size_t src_slice_pitch,size_t dst_row_pitch,size_t dst_slice_pitch,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)730 cl_int CL_API_CALL clEnqueueCopyBufferRect(cl_command_queue command_queue,
731                                            cl_mem src_buffer,
732                                            cl_mem dst_buffer,
733                                            const size_t *src_origin,
734                                            const size_t *dst_origin,
735                                            const size_t *region,
736                                            size_t src_row_pitch,
737                                            size_t src_slice_pitch,
738                                            size_t dst_row_pitch,
739                                            size_t dst_slice_pitch,
740                                            cl_uint num_events_in_wait_list,
741                                            const cl_event *event_wait_list,
742                                            cl_event *event)
743 {
744     return cl::GetDispatch().clEnqueueCopyBufferRect(
745         command_queue, src_buffer, dst_buffer, src_origin, dst_origin, region, src_row_pitch,
746         src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list,
747         event);
748 }
749 
750 // CL 1.2
clCreateSubDevices(cl_device_id in_device,const cl_device_partition_property * properties,cl_uint num_devices,cl_device_id * out_devices,cl_uint * num_devices_ret)751 cl_int CL_API_CALL clCreateSubDevices(cl_device_id in_device,
752                                       const cl_device_partition_property *properties,
753                                       cl_uint num_devices,
754                                       cl_device_id *out_devices,
755                                       cl_uint *num_devices_ret)
756 {
757     return cl::GetDispatch().clCreateSubDevices(in_device, properties, num_devices, out_devices,
758                                                 num_devices_ret);
759 }
760 
clRetainDevice(cl_device_id device)761 cl_int CL_API_CALL clRetainDevice(cl_device_id device)
762 {
763     return cl::GetDispatch().clRetainDevice(device);
764 }
765 
clReleaseDevice(cl_device_id device)766 cl_int CL_API_CALL clReleaseDevice(cl_device_id device)
767 {
768     return cl::GetDispatch().clReleaseDevice(device);
769 }
770 
clCreateImage(cl_context context,cl_mem_flags flags,const cl_image_format * image_format,const cl_image_desc * image_desc,void * host_ptr,cl_int * errcode_ret)771 cl_mem CL_API_CALL clCreateImage(cl_context context,
772                                  cl_mem_flags flags,
773                                  const cl_image_format *image_format,
774                                  const cl_image_desc *image_desc,
775                                  void *host_ptr,
776                                  cl_int *errcode_ret)
777 {
778     return cl::GetDispatch().clCreateImage(context, flags, image_format, image_desc, host_ptr,
779                                            errcode_ret);
780 }
781 
clCreateProgramWithBuiltInKernels(cl_context context,cl_uint num_devices,const cl_device_id * device_list,const char * kernel_names,cl_int * errcode_ret)782 cl_program CL_API_CALL clCreateProgramWithBuiltInKernels(cl_context context,
783                                                          cl_uint num_devices,
784                                                          const cl_device_id *device_list,
785                                                          const char *kernel_names,
786                                                          cl_int *errcode_ret)
787 {
788     return cl::GetDispatch().clCreateProgramWithBuiltInKernels(context, num_devices, device_list,
789                                                                kernel_names, errcode_ret);
790 }
791 
clCompileProgram(cl_program program,cl_uint num_devices,const cl_device_id * device_list,const char * options,cl_uint num_input_headers,const cl_program * input_headers,const char ** header_include_names,void (CL_CALLBACK * pfn_notify)(cl_program program,void * user_data),void * user_data)792 cl_int CL_API_CALL clCompileProgram(cl_program program,
793                                     cl_uint num_devices,
794                                     const cl_device_id *device_list,
795                                     const char *options,
796                                     cl_uint num_input_headers,
797                                     const cl_program *input_headers,
798                                     const char **header_include_names,
799                                     void(CL_CALLBACK *pfn_notify)(cl_program program,
800                                                                   void *user_data),
801                                     void *user_data)
802 {
803     return cl::GetDispatch().clCompileProgram(program, num_devices, device_list, options,
804                                               num_input_headers, input_headers,
805                                               header_include_names, pfn_notify, user_data);
806 }
807 
clLinkProgram(cl_context context,cl_uint num_devices,const cl_device_id * device_list,const char * options,cl_uint num_input_programs,const cl_program * input_programs,void (CL_CALLBACK * pfn_notify)(cl_program program,void * user_data),void * user_data,cl_int * errcode_ret)808 cl_program CL_API_CALL clLinkProgram(cl_context context,
809                                      cl_uint num_devices,
810                                      const cl_device_id *device_list,
811                                      const char *options,
812                                      cl_uint num_input_programs,
813                                      const cl_program *input_programs,
814                                      void(CL_CALLBACK *pfn_notify)(cl_program program,
815                                                                    void *user_data),
816                                      void *user_data,
817                                      cl_int *errcode_ret)
818 {
819     return cl::GetDispatch().clLinkProgram(context, num_devices, device_list, options,
820                                            num_input_programs, input_programs, pfn_notify,
821                                            user_data, errcode_ret);
822 }
823 
clUnloadPlatformCompiler(cl_platform_id platform)824 cl_int CL_API_CALL clUnloadPlatformCompiler(cl_platform_id platform)
825 {
826     return cl::GetDispatch().clUnloadPlatformCompiler(platform);
827 }
828 
clGetKernelArgInfo(cl_kernel kernel,cl_uint arg_index,cl_kernel_arg_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)829 cl_int CL_API_CALL clGetKernelArgInfo(cl_kernel kernel,
830                                       cl_uint arg_index,
831                                       cl_kernel_arg_info param_name,
832                                       size_t param_value_size,
833                                       void *param_value,
834                                       size_t *param_value_size_ret)
835 {
836     return cl::GetDispatch().clGetKernelArgInfo(kernel, arg_index, param_name, param_value_size,
837                                                 param_value, param_value_size_ret);
838 }
839 
clEnqueueFillBuffer(cl_command_queue command_queue,cl_mem buffer,const void * pattern,size_t pattern_size,size_t offset,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)840 cl_int CL_API_CALL clEnqueueFillBuffer(cl_command_queue command_queue,
841                                        cl_mem buffer,
842                                        const void *pattern,
843                                        size_t pattern_size,
844                                        size_t offset,
845                                        size_t size,
846                                        cl_uint num_events_in_wait_list,
847                                        const cl_event *event_wait_list,
848                                        cl_event *event)
849 {
850     return cl::GetDispatch().clEnqueueFillBuffer(command_queue, buffer, pattern, pattern_size,
851                                                  offset, size, num_events_in_wait_list,
852                                                  event_wait_list, event);
853 }
854 
clEnqueueFillImage(cl_command_queue command_queue,cl_mem image,const void * fill_color,const size_t * origin,const size_t * region,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)855 cl_int CL_API_CALL clEnqueueFillImage(cl_command_queue command_queue,
856                                       cl_mem image,
857                                       const void *fill_color,
858                                       const size_t *origin,
859                                       const size_t *region,
860                                       cl_uint num_events_in_wait_list,
861                                       const cl_event *event_wait_list,
862                                       cl_event *event)
863 {
864     return cl::GetDispatch().clEnqueueFillImage(command_queue, image, fill_color, origin, region,
865                                                 num_events_in_wait_list, event_wait_list, event);
866 }
867 
clEnqueueMigrateMemObjects(cl_command_queue command_queue,cl_uint num_mem_objects,const cl_mem * mem_objects,cl_mem_migration_flags flags,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)868 cl_int CL_API_CALL clEnqueueMigrateMemObjects(cl_command_queue command_queue,
869                                               cl_uint num_mem_objects,
870                                               const cl_mem *mem_objects,
871                                               cl_mem_migration_flags flags,
872                                               cl_uint num_events_in_wait_list,
873                                               const cl_event *event_wait_list,
874                                               cl_event *event)
875 {
876     return cl::GetDispatch().clEnqueueMigrateMemObjects(command_queue, num_mem_objects, mem_objects,
877                                                         flags, num_events_in_wait_list,
878                                                         event_wait_list, event);
879 }
880 
clEnqueueMarkerWithWaitList(cl_command_queue command_queue,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)881 cl_int CL_API_CALL clEnqueueMarkerWithWaitList(cl_command_queue command_queue,
882                                                cl_uint num_events_in_wait_list,
883                                                const cl_event *event_wait_list,
884                                                cl_event *event)
885 {
886     return cl::GetDispatch().clEnqueueMarkerWithWaitList(command_queue, num_events_in_wait_list,
887                                                          event_wait_list, event);
888 }
889 
clEnqueueBarrierWithWaitList(cl_command_queue command_queue,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)890 cl_int CL_API_CALL clEnqueueBarrierWithWaitList(cl_command_queue command_queue,
891                                                 cl_uint num_events_in_wait_list,
892                                                 const cl_event *event_wait_list,
893                                                 cl_event *event)
894 {
895     return cl::GetDispatch().clEnqueueBarrierWithWaitList(command_queue, num_events_in_wait_list,
896                                                           event_wait_list, event);
897 }
898 
clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,const char * func_name)899 void *CL_API_CALL clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
900                                                            const char *func_name)
901 {
902     return cl::GetDispatch().clGetExtensionFunctionAddressForPlatform(platform, func_name);
903 }
904 
905 // CL 2.0
906 cl_command_queue CL_API_CALL
clCreateCommandQueueWithProperties(cl_context context,cl_device_id device,const cl_queue_properties * properties,cl_int * errcode_ret)907 clCreateCommandQueueWithProperties(cl_context context,
908                                    cl_device_id device,
909                                    const cl_queue_properties *properties,
910                                    cl_int *errcode_ret)
911 {
912     return cl::GetDispatch().clCreateCommandQueueWithProperties(context, device, properties,
913                                                                 errcode_ret);
914 }
915 
clCreatePipe(cl_context context,cl_mem_flags flags,cl_uint pipe_packet_size,cl_uint pipe_max_packets,const cl_pipe_properties * properties,cl_int * errcode_ret)916 cl_mem CL_API_CALL clCreatePipe(cl_context context,
917                                 cl_mem_flags flags,
918                                 cl_uint pipe_packet_size,
919                                 cl_uint pipe_max_packets,
920                                 const cl_pipe_properties *properties,
921                                 cl_int *errcode_ret)
922 {
923     return cl::GetDispatch().clCreatePipe(context, flags, pipe_packet_size, pipe_max_packets,
924                                           properties, errcode_ret);
925 }
926 
clGetPipeInfo(cl_mem pipe,cl_pipe_info param_name,size_t param_value_size,void * param_value,size_t * param_value_size_ret)927 cl_int CL_API_CALL clGetPipeInfo(cl_mem pipe,
928                                  cl_pipe_info param_name,
929                                  size_t param_value_size,
930                                  void *param_value,
931                                  size_t *param_value_size_ret)
932 {
933     return cl::GetDispatch().clGetPipeInfo(pipe, param_name, param_value_size, param_value,
934                                            param_value_size_ret);
935 }
936 
clSVMAlloc(cl_context context,cl_svm_mem_flags flags,size_t size,cl_uint alignment)937 void *CL_API_CALL clSVMAlloc(cl_context context,
938                              cl_svm_mem_flags flags,
939                              size_t size,
940                              cl_uint alignment)
941 {
942     return cl::GetDispatch().clSVMAlloc(context, flags, size, alignment);
943 }
944 
clSVMFree(cl_context context,void * svm_pointer)945 void CL_API_CALL clSVMFree(cl_context context, void *svm_pointer)
946 {
947     return cl::GetDispatch().clSVMFree(context, svm_pointer);
948 }
949 
950 cl_sampler CL_API_CALL
clCreateSamplerWithProperties(cl_context context,const cl_sampler_properties * sampler_properties,cl_int * errcode_ret)951 clCreateSamplerWithProperties(cl_context context,
952                               const cl_sampler_properties *sampler_properties,
953                               cl_int *errcode_ret)
954 {
955     return cl::GetDispatch().clCreateSamplerWithProperties(context, sampler_properties,
956                                                            errcode_ret);
957 }
958 
clSetKernelArgSVMPointer(cl_kernel kernel,cl_uint arg_index,const void * arg_value)959 cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
960                                             cl_uint arg_index,
961                                             const void *arg_value)
962 {
963     return cl::GetDispatch().clSetKernelArgSVMPointer(kernel, arg_index, arg_value);
964 }
965 
clSetKernelExecInfo(cl_kernel kernel,cl_kernel_exec_info param_name,size_t param_value_size,const void * param_value)966 cl_int CL_API_CALL clSetKernelExecInfo(cl_kernel kernel,
967                                        cl_kernel_exec_info param_name,
968                                        size_t param_value_size,
969                                        const void *param_value)
970 {
971     return cl::GetDispatch().clSetKernelExecInfo(kernel, param_name, param_value_size, param_value);
972 }
973 
clEnqueueSVMFree(cl_command_queue command_queue,cl_uint num_svm_pointers,void * svm_pointers[],void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,cl_uint num_svm_pointers,void * svm_pointers[],void * user_data),void * user_data,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)974 cl_int CL_API_CALL clEnqueueSVMFree(cl_command_queue command_queue,
975                                     cl_uint num_svm_pointers,
976                                     void *svm_pointers[],
977                                     void(CL_CALLBACK *pfn_free_func)(cl_command_queue queue,
978                                                                      cl_uint num_svm_pointers,
979                                                                      void *svm_pointers[],
980                                                                      void *user_data),
981                                     void *user_data,
982                                     cl_uint num_events_in_wait_list,
983                                     const cl_event *event_wait_list,
984                                     cl_event *event)
985 {
986     return cl::GetDispatch().clEnqueueSVMFree(command_queue, num_svm_pointers, svm_pointers,
987                                               pfn_free_func, user_data, num_events_in_wait_list,
988                                               event_wait_list, event);
989 }
990 
clEnqueueSVMMemcpy(cl_command_queue command_queue,cl_bool blocking_copy,void * dst_ptr,const void * src_ptr,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)991 cl_int CL_API_CALL clEnqueueSVMMemcpy(cl_command_queue command_queue,
992                                       cl_bool blocking_copy,
993                                       void *dst_ptr,
994                                       const void *src_ptr,
995                                       size_t size,
996                                       cl_uint num_events_in_wait_list,
997                                       const cl_event *event_wait_list,
998                                       cl_event *event)
999 {
1000     return cl::GetDispatch().clEnqueueSVMMemcpy(command_queue, blocking_copy, dst_ptr, src_ptr,
1001                                                 size, num_events_in_wait_list, event_wait_list,
1002                                                 event);
1003 }
1004 
clEnqueueSVMMemFill(cl_command_queue command_queue,void * svm_ptr,const void * pattern,size_t pattern_size,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)1005 cl_int CL_API_CALL clEnqueueSVMMemFill(cl_command_queue command_queue,
1006                                        void *svm_ptr,
1007                                        const void *pattern,
1008                                        size_t pattern_size,
1009                                        size_t size,
1010                                        cl_uint num_events_in_wait_list,
1011                                        const cl_event *event_wait_list,
1012                                        cl_event *event)
1013 {
1014     return cl::GetDispatch().clEnqueueSVMMemFill(command_queue, svm_ptr, pattern, pattern_size,
1015                                                  size, num_events_in_wait_list, event_wait_list,
1016                                                  event);
1017 }
1018 
clEnqueueSVMMap(cl_command_queue command_queue,cl_bool blocking_map,cl_map_flags flags,void * svm_ptr,size_t size,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)1019 cl_int CL_API_CALL clEnqueueSVMMap(cl_command_queue command_queue,
1020                                    cl_bool blocking_map,
1021                                    cl_map_flags flags,
1022                                    void *svm_ptr,
1023                                    size_t size,
1024                                    cl_uint num_events_in_wait_list,
1025                                    const cl_event *event_wait_list,
1026                                    cl_event *event)
1027 {
1028     return cl::GetDispatch().clEnqueueSVMMap(command_queue, blocking_map, flags, svm_ptr, size,
1029                                              num_events_in_wait_list, event_wait_list, event);
1030 }
1031 
clEnqueueSVMUnmap(cl_command_queue command_queue,void * svm_ptr,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)1032 cl_int CL_API_CALL clEnqueueSVMUnmap(cl_command_queue command_queue,
1033                                      void *svm_ptr,
1034                                      cl_uint num_events_in_wait_list,
1035                                      const cl_event *event_wait_list,
1036                                      cl_event *event)
1037 {
1038     return cl::GetDispatch().clEnqueueSVMUnmap(command_queue, svm_ptr, num_events_in_wait_list,
1039                                                event_wait_list, event);
1040 }
1041 
1042 // CL 2.1
clSetDefaultDeviceCommandQueue(cl_context context,cl_device_id device,cl_command_queue command_queue)1043 cl_int CL_API_CALL clSetDefaultDeviceCommandQueue(cl_context context,
1044                                                   cl_device_id device,
1045                                                   cl_command_queue command_queue)
1046 {
1047     return cl::GetDispatch().clSetDefaultDeviceCommandQueue(context, device, command_queue);
1048 }
1049 
clGetDeviceAndHostTimer(cl_device_id device,cl_ulong * device_timestamp,cl_ulong * host_timestamp)1050 cl_int CL_API_CALL clGetDeviceAndHostTimer(cl_device_id device,
1051                                            cl_ulong *device_timestamp,
1052                                            cl_ulong *host_timestamp)
1053 {
1054     return cl::GetDispatch().clGetDeviceAndHostTimer(device, device_timestamp, host_timestamp);
1055 }
1056 
clGetHostTimer(cl_device_id device,cl_ulong * host_timestamp)1057 cl_int CL_API_CALL clGetHostTimer(cl_device_id device, cl_ulong *host_timestamp)
1058 {
1059     return cl::GetDispatch().clGetHostTimer(device, host_timestamp);
1060 }
1061 
clCreateProgramWithIL(cl_context context,const void * il,size_t length,cl_int * errcode_ret)1062 cl_program CL_API_CALL clCreateProgramWithIL(cl_context context,
1063                                              const void *il,
1064                                              size_t length,
1065                                              cl_int *errcode_ret)
1066 {
1067     return cl::GetDispatch().clCreateProgramWithIL(context, il, length, errcode_ret);
1068 }
1069 
clCloneKernel(cl_kernel source_kernel,cl_int * errcode_ret)1070 cl_kernel CL_API_CALL clCloneKernel(cl_kernel source_kernel, cl_int *errcode_ret)
1071 {
1072     return cl::GetDispatch().clCloneKernel(source_kernel, errcode_ret);
1073 }
1074 
clGetKernelSubGroupInfo(cl_kernel kernel,cl_device_id device,cl_kernel_sub_group_info param_name,size_t input_value_size,const void * input_value,size_t param_value_size,void * param_value,size_t * param_value_size_ret)1075 cl_int CL_API_CALL clGetKernelSubGroupInfo(cl_kernel kernel,
1076                                            cl_device_id device,
1077                                            cl_kernel_sub_group_info param_name,
1078                                            size_t input_value_size,
1079                                            const void *input_value,
1080                                            size_t param_value_size,
1081                                            void *param_value,
1082                                            size_t *param_value_size_ret)
1083 {
1084     return cl::GetDispatch().clGetKernelSubGroupInfo(kernel, device, param_name, input_value_size,
1085                                                      input_value, param_value_size, param_value,
1086                                                      param_value_size_ret);
1087 }
1088 
clEnqueueSVMMigrateMem(cl_command_queue command_queue,cl_uint num_svm_pointers,const void ** svm_pointers,const size_t * sizes,cl_mem_migration_flags flags,cl_uint num_events_in_wait_list,const cl_event * event_wait_list,cl_event * event)1089 cl_int CL_API_CALL clEnqueueSVMMigrateMem(cl_command_queue command_queue,
1090                                           cl_uint num_svm_pointers,
1091                                           const void **svm_pointers,
1092                                           const size_t *sizes,
1093                                           cl_mem_migration_flags flags,
1094                                           cl_uint num_events_in_wait_list,
1095                                           const cl_event *event_wait_list,
1096                                           cl_event *event)
1097 {
1098     return cl::GetDispatch().clEnqueueSVMMigrateMem(command_queue, num_svm_pointers, svm_pointers,
1099                                                     sizes, flags, num_events_in_wait_list,
1100                                                     event_wait_list, event);
1101 }
1102 
1103 // CL 2.2
clSetProgramReleaseCallback(cl_program program,void (CL_CALLBACK * pfn_notify)(cl_program program,void * user_data),void * user_data)1104 cl_int CL_API_CALL clSetProgramReleaseCallback(cl_program program,
1105                                                void(CL_CALLBACK *pfn_notify)(cl_program program,
1106                                                                              void *user_data),
1107                                                void *user_data)
1108 {
1109     return cl::GetDispatch().clSetProgramReleaseCallback(program, pfn_notify, user_data);
1110 }
1111 
clSetProgramSpecializationConstant(cl_program program,cl_uint spec_id,size_t spec_size,const void * spec_value)1112 cl_int CL_API_CALL clSetProgramSpecializationConstant(cl_program program,
1113                                                       cl_uint spec_id,
1114                                                       size_t spec_size,
1115                                                       const void *spec_value)
1116 {
1117     return cl::GetDispatch().clSetProgramSpecializationConstant(program, spec_id, spec_size,
1118                                                                 spec_value);
1119 }
1120 
1121 // CL 3.0
clSetContextDestructorCallback(cl_context context,void (CL_CALLBACK * pfn_notify)(cl_context context,void * user_data),void * user_data)1122 cl_int CL_API_CALL clSetContextDestructorCallback(cl_context context,
1123                                                   void(CL_CALLBACK *pfn_notify)(cl_context context,
1124                                                                                 void *user_data),
1125                                                   void *user_data)
1126 {
1127     return cl::GetDispatch().clSetContextDestructorCallback(context, pfn_notify, user_data);
1128 }
1129 
clCreateBufferWithProperties(cl_context context,const cl_mem_properties * properties,cl_mem_flags flags,size_t size,void * host_ptr,cl_int * errcode_ret)1130 cl_mem CL_API_CALL clCreateBufferWithProperties(cl_context context,
1131                                                 const cl_mem_properties *properties,
1132                                                 cl_mem_flags flags,
1133                                                 size_t size,
1134                                                 void *host_ptr,
1135                                                 cl_int *errcode_ret)
1136 {
1137     return cl::GetDispatch().clCreateBufferWithProperties(context, properties, flags, size,
1138                                                           host_ptr, errcode_ret);
1139 }
1140 
clCreateImageWithProperties(cl_context context,const cl_mem_properties * properties,cl_mem_flags flags,const cl_image_format * image_format,const cl_image_desc * image_desc,void * host_ptr,cl_int * errcode_ret)1141 cl_mem CL_API_CALL clCreateImageWithProperties(cl_context context,
1142                                                const cl_mem_properties *properties,
1143                                                cl_mem_flags flags,
1144                                                const cl_image_format *image_format,
1145                                                const cl_image_desc *image_desc,
1146                                                void *host_ptr,
1147                                                cl_int *errcode_ret)
1148 {
1149     return cl::GetDispatch().clCreateImageWithProperties(context, properties, flags, image_format,
1150                                                          image_desc, host_ptr, errcode_ret);
1151 }
1152 
1153 // cl_khr_icd
clIcdGetPlatformIDsKHR(cl_uint num_entries,cl_platform_id * platforms,cl_uint * num_platforms)1154 cl_int CL_API_CALL clIcdGetPlatformIDsKHR(cl_uint num_entries,
1155                                           cl_platform_id *platforms,
1156                                           cl_uint *num_platforms)
1157 {
1158     return cl::GetDispatch().clIcdGetPlatformIDsKHR(num_entries, platforms, num_platforms);
1159 }
1160 
1161 }  // extern "C"
1162