Added OpenCL Universal Driver Support for Win10 RS3 (#21)
[platform/upstream/OpenCL-ICD-Loader.git] / icd_dispatch.h
1 /*
2  * Copyright (c) 2016 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software source and associated documentation files (the "Materials"),
6  * to deal in the Materials without restriction, including without limitation
7  * the rights to use, copy, modify, compile, merge, publish, distribute,
8  * sublicense, and/or sell copies of the Materials, and to permit persons to
9  * whom the Materials are furnished to do so, subject the following terms and
10  * conditions:
11  *
12  * All modifications to the Materials used to create a binary that is
13  * distributed to third parties shall be provided to Khronos with an
14  * unrestricted license to use for the purposes of implementing bug fixes and
15  * enhancements to the Materials;
16  *
17  * If the binary is used as part of an OpenCL(TM) implementation, whether binary
18  * is distributed together with or separately to that implementation, then
19  * recipient must become an OpenCL Adopter and follow the published OpenCL
20  * conformance process for that implementation, details at:
21  * http://www.khronos.org/conformance/;
22  *
23  * The above copyright notice, the OpenCL trademark license, and this permission
24  * notice shall be included in all copies or substantial portions of the
25  * Materials.
26  *
27  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32  * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN
33  * THE MATERIALS.
34  *
35  * OpenCL is a trademark of Apple Inc. used under license by Khronos.
36  */
37
38 #ifndef _ICD_DISPATCH_H_
39 #define _ICD_DISPATCH_H_
40
41 #ifndef CL_USE_DEPRECATED_OPENCL_1_0_APIS
42 #define CL_USE_DEPRECATED_OPENCL_1_0_APIS
43 #endif
44
45 #ifndef CL_USE_DEPRECATED_OPENCL_1_1_APIS
46 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
47 #endif
48
49 #ifndef CL_USE_DEPRECATED_OPENCL_1_2_APIS
50 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS
51 #endif
52
53 #ifndef CL_USE_DEPRECATED_OPENCL_2_0_APIS
54 #define CL_USE_DEPRECATED_OPENCL_2_0_APIS
55 #endif
56
57 // cl.h
58 #include <CL/cl.h>
59
60 // cl_gl.h and required files
61 #ifdef _WIN32
62 #include <windows.h>
63 #include <d3d9.h>
64 #include <d3d10_1.h>
65 #include <CL/cl_d3d10.h>
66 #include <CL/cl_d3d11.h>
67 #include <CL/cl_dx9_media_sharing.h>
68 #endif
69 #if !defined(__ANDROID__)
70 #include <GL/gl.h>
71 #else
72 #include <GLES/gl.h>
73 #endif
74 #include <CL/cl_gl.h>
75 #include <CL/cl_gl_ext.h>
76 #include <CL/cl_ext.h>
77 #include <CL/cl_egl.h>
78
79 /*
80  *
81  * function pointer typedefs
82  *
83  */
84
85 // Platform APIs
86 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetPlatformIDs)(
87                  cl_uint          num_entries,
88                  cl_platform_id * platforms,
89                  cl_uint *        num_platforms) CL_API_SUFFIX__VERSION_1_0;
90
91 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetPlatformInfo)(
92     cl_platform_id   platform, 
93     cl_platform_info param_name,
94     size_t           param_value_size, 
95     void *           param_value,
96     size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
97
98 // Device APIs
99 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceIDs)(
100     cl_platform_id   platform,
101     cl_device_type   device_type, 
102     cl_uint          num_entries, 
103     cl_device_id *   devices, 
104     cl_uint *        num_devices) CL_API_SUFFIX__VERSION_1_0;
105
106 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceInfo)(
107     cl_device_id    device,
108     cl_device_info  param_name, 
109     size_t          param_value_size, 
110     void *          param_value,
111     size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
112
113 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clCreateSubDevices)(
114     cl_device_id     in_device,
115     const cl_device_partition_property * partition_properties,
116     cl_uint          num_entries,
117     cl_device_id *   out_devices,
118     cl_uint *        num_devices);
119
120 typedef CL_API_ENTRY cl_int (CL_API_CALL * KHRpfn_clRetainDevice)(
121     cl_device_id     device) CL_API_SUFFIX__VERSION_1_2;
122
123 typedef CL_API_ENTRY cl_int (CL_API_CALL * KHRpfn_clReleaseDevice)(
124     cl_device_id     device) CL_API_SUFFIX__VERSION_1_2;
125
126 // Context APIs  
127 typedef CL_API_ENTRY cl_context (CL_API_CALL *KHRpfn_clCreateContext)(
128     const cl_context_properties * properties,
129     cl_uint                 num_devices,
130     const cl_device_id *    devices,
131     void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *),
132     void *                  user_data,
133     cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_0;
134
135 typedef CL_API_ENTRY cl_context (CL_API_CALL *KHRpfn_clCreateContextFromType)(
136     const cl_context_properties * properties,
137     cl_device_type          device_type,
138     void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *),
139     void *                  user_data,
140     cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_0;
141
142 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainContext)(
143     cl_context context) CL_API_SUFFIX__VERSION_1_0;
144
145 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseContext)(
146     cl_context context) CL_API_SUFFIX__VERSION_1_0;
147
148 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetContextInfo)(
149     cl_context         context, 
150     cl_context_info    param_name, 
151     size_t             param_value_size, 
152     void *             param_value, 
153     size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
154
155 // Command Queue APIs
156 typedef CL_API_ENTRY cl_command_queue (CL_API_CALL *KHRpfn_clCreateCommandQueue)(
157     cl_context                     context, 
158     cl_device_id                   device, 
159     cl_command_queue_properties    properties,
160     cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
161
162 typedef CL_API_ENTRY cl_command_queue (CL_API_CALL *KHRpfn_clCreateCommandQueueWithProperties)(
163     cl_context                  /* context */,
164     cl_device_id                /* device */,
165     const cl_queue_properties * /* properties */,
166     cl_int *                    /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0;
167
168 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainCommandQueue)(
169     cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
170
171 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseCommandQueue)(
172     cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
173
174 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetCommandQueueInfo)(
175     cl_command_queue      command_queue,
176     cl_command_queue_info param_name,
177     size_t                param_value_size,
178     void *                param_value,
179     size_t *              param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
180
181 // Memory Object APIs
182 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateBuffer)(
183     cl_context   context,
184     cl_mem_flags flags,
185     size_t       size,
186     void *       host_ptr,
187     cl_int *     errcode_ret) CL_API_SUFFIX__VERSION_1_0;
188
189 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateImage)(
190     cl_context              context,
191     cl_mem_flags            flags,
192     const cl_image_format * image_format,
193     const cl_image_desc *   image_desc,
194     void *                  host_ptr,
195     cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_2;
196
197 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainMemObject)(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
198
199 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseMemObject)(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
200
201 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetSupportedImageFormats)(
202     cl_context           context,
203     cl_mem_flags         flags,
204     cl_mem_object_type   image_type,
205     cl_uint              num_entries,
206     cl_image_format *    image_formats,
207     cl_uint *            num_image_formats) CL_API_SUFFIX__VERSION_1_0;
208                                     
209 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetMemObjectInfo)(
210     cl_mem           memobj,
211     cl_mem_info      param_name, 
212     size_t           param_value_size,
213     void *           param_value,
214     size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
215
216 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetImageInfo)(
217     cl_mem           image,
218     cl_image_info    param_name, 
219     size_t           param_value_size,
220     void *           param_value,
221     size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
222
223 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreatePipe)(
224     cl_context                 /* context */,
225     cl_mem_flags               /* flags */,
226     cl_uint                    /* pipe_packet_size */,
227     cl_uint                    /* pipe_max_packets */,
228     const cl_pipe_properties * /* properties */,
229     cl_int *                   /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0;
230
231 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetPipeInfo)(
232     cl_mem       /* pipe */,
233     cl_pipe_info /* param_name */,
234     size_t       /* param_value_size */,
235     void *       /* param_value */,
236     size_t *     /* param_value_size_ret */) CL_API_SUFFIX__VERSION_2_0;
237
238 typedef CL_API_ENTRY void * (CL_API_CALL *KHRpfn_clSVMAlloc)(
239     cl_context       /* context */,
240     cl_svm_mem_flags /* flags */,
241     size_t           /* size */,
242     unsigned int     /* alignment */) CL_API_SUFFIX__VERSION_2_0;
243
244 typedef CL_API_ENTRY void (CL_API_CALL *KHRpfn_clSVMFree)(
245     cl_context /* context */,
246     void *     /* svm_pointer */) CL_API_SUFFIX__VERSION_2_0;
247
248 // Sampler APIs
249 typedef CL_API_ENTRY cl_sampler (CL_API_CALL *KHRpfn_clCreateSampler)(
250     cl_context          context,
251     cl_bool             normalized_coords, 
252     cl_addressing_mode  addressing_mode, 
253     cl_filter_mode      filter_mode,
254     cl_int *            errcode_ret) CL_API_SUFFIX__VERSION_1_0;
255
256 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainSampler)(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
257
258 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseSampler)(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
259
260 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetSamplerInfo)(
261     cl_sampler         sampler,
262     cl_sampler_info    param_name,
263     size_t             param_value_size,
264     void *             param_value,
265     size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
266
267 typedef CL_API_ENTRY cl_sampler (CL_API_CALL *KHRpfn_clCreateSamplerWithProperties)(
268     cl_context                    /* context */,
269     const cl_sampler_properties * /* sampler_properties */,
270     cl_int *                      /* errcode_ret */) CL_API_SUFFIX__VERSION_2_0;
271
272 // Program Object APIs
273 typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithSource)(
274     cl_context        context,
275     cl_uint           count,
276     const char **     strings,
277     const size_t *    lengths,
278     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
279
280 typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithBinary)(
281     cl_context                     context,
282     cl_uint                        num_devices,
283     const cl_device_id *           device_list,
284     const size_t *                 lengths,
285     const unsigned char **         binaries,
286     cl_int *                       binary_status,
287     cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
288
289 typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithBuiltInKernels)(
290     cl_context            context,
291     cl_uint               num_devices,
292     const cl_device_id *  device_list,
293     const char *          kernel_names,
294     cl_int *              errcode_ret) CL_API_SUFFIX__VERSION_1_2;
295
296 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainProgram)(cl_program program) CL_API_SUFFIX__VERSION_1_0;
297
298 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseProgram)(cl_program program) CL_API_SUFFIX__VERSION_1_0;
299
300 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clBuildProgram)(
301     cl_program           program,
302     cl_uint              num_devices,
303     const cl_device_id * device_list,
304     const char *         options, 
305     void (CL_CALLBACK *pfn_notify)(cl_program program, void * user_data),
306     void *               user_data) CL_API_SUFFIX__VERSION_1_0;
307
308 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clCompileProgram)(
309     cl_program           program,
310     cl_uint              num_devices,
311     const cl_device_id * device_list,
312     const char *         options,
313     cl_uint              num_input_headers,
314     const cl_program *   input_headers,
315     const char **        header_include_names,
316     void (CL_CALLBACK *  pfn_notify)(cl_program program, void * user_data),
317     void *               user_data) CL_API_SUFFIX__VERSION_1_2;
318
319 typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clLinkProgram)(
320     cl_context           context,
321     cl_uint              num_devices,
322     const cl_device_id * device_list,
323     const char *         options,
324     cl_uint              num_input_programs,
325     const cl_program *   input_programs,
326     void (CL_CALLBACK *  pfn_notify)(cl_program program, void * user_data),
327     void *               user_data,
328     cl_int *             errcode_ret) CL_API_SUFFIX__VERSION_1_2;
329
330 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetProgramSpecializationConstant)(
331     cl_program           program,
332     cl_uint              spec_id,
333     size_t               spec_size,
334     const void*          spec_value) CL_API_SUFFIX__VERSION_2_2;
335
336 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetProgramReleaseCallback)(
337     cl_program           program,
338     void (CL_CALLBACK *  pfn_notify)(cl_program program, void * user_data),
339     void *               user_data) CL_API_SUFFIX__VERSION_2_2;
340
341 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clUnloadPlatformCompiler)(
342     cl_platform_id     platform) CL_API_SUFFIX__VERSION_1_2;
343
344 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetProgramInfo)(
345     cl_program         program,
346     cl_program_info    param_name,
347     size_t             param_value_size,
348     void *             param_value,
349     size_t *           param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
350
351 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetProgramBuildInfo)(
352     cl_program            program,
353     cl_device_id          device,
354     cl_program_build_info param_name,
355     size_t                param_value_size,
356     void *                param_value,
357     size_t *              param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
358                             
359 // Kernel Object APIs
360 typedef CL_API_ENTRY cl_kernel (CL_API_CALL *KHRpfn_clCreateKernel)(
361     cl_program      program,
362     const char *    kernel_name,
363     cl_int *        errcode_ret) CL_API_SUFFIX__VERSION_1_0;
364
365 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clCreateKernelsInProgram)(
366     cl_program     program,
367     cl_uint        num_kernels,
368     cl_kernel *    kernels,
369     cl_uint *      num_kernels_ret) CL_API_SUFFIX__VERSION_1_0;
370
371 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainKernel)(cl_kernel    kernel) CL_API_SUFFIX__VERSION_1_0;
372
373 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseKernel)(cl_kernel   kernel) CL_API_SUFFIX__VERSION_1_0;
374
375 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetKernelArg)(
376     cl_kernel    kernel,
377     cl_uint      arg_index,
378     size_t       arg_size,
379     const void * arg_value) CL_API_SUFFIX__VERSION_1_0;
380
381 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetKernelInfo)(
382     cl_kernel       kernel,
383     cl_kernel_info  param_name,
384     size_t          param_value_size,
385     void *          param_value,
386     size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
387
388 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetKernelArgInfo)(
389     cl_kernel       kernel,
390     cl_uint         arg_indx,
391     cl_kernel_arg_info  param_name,
392     size_t          param_value_size,
393     void *          param_value,
394     size_t *        param_value_size_ret) CL_API_SUFFIX__VERSION_1_2;
395
396 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetKernelWorkGroupInfo)(
397     cl_kernel                  kernel,
398     cl_device_id               device,
399     cl_kernel_work_group_info  param_name,
400     size_t                     param_value_size,
401     void *                     param_value,
402     size_t *                   param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
403
404 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetKernelArgSVMPointer)(
405     cl_kernel    /* kernel */,
406     cl_uint      /* arg_index */,
407     const void * /* arg_value */) CL_API_SUFFIX__VERSION_2_0;
408
409 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetKernelExecInfo)(
410     cl_kernel            /* kernel */,
411     cl_kernel_exec_info  /* param_name */,
412     size_t               /* param_value_size */,
413     const void *         /* param_value */) CL_API_SUFFIX__VERSION_2_0;
414
415 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetKernelSubGroupInfoKHR)(
416     cl_kernel                /* in_kernel */,
417     cl_device_id             /*in_device*/,
418     cl_kernel_sub_group_info /* param_name */,
419     size_t                   /*input_value_size*/,
420     const void *             /*input_value*/,
421     size_t                   /*param_value_size*/,
422     void*                    /*param_value*/,
423     size_t*                  /*param_value_size_ret*/) CL_EXT_SUFFIX__VERSION_2_0;
424
425 // Event Object APIs
426 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clWaitForEvents)(
427     cl_uint             num_events,
428     const cl_event *    event_list) CL_API_SUFFIX__VERSION_1_0;
429
430 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetEventInfo)(
431     cl_event         event,
432     cl_event_info    param_name,
433     size_t           param_value_size,
434     void *           param_value,
435     size_t *         param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
436                             
437 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clRetainEvent)(cl_event event) CL_API_SUFFIX__VERSION_1_0;
438
439 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clReleaseEvent)(cl_event event) CL_API_SUFFIX__VERSION_1_0;
440
441 // Profiling APIs
442 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetEventProfilingInfo)(
443     cl_event            event,
444     cl_profiling_info   param_name,
445     size_t              param_value_size,
446     void *              param_value,
447     size_t *            param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
448                                 
449 // Flush and Finish APIs
450 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clFlush)(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
451
452 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clFinish)(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
453
454 // Enqueued Commands APIs
455 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReadBuffer)(
456     cl_command_queue    command_queue,
457     cl_mem              buffer,
458     cl_bool             blocking_read,
459     size_t              offset,
460     size_t              cb, 
461     void *              ptr,
462     cl_uint             num_events_in_wait_list,
463     const cl_event *    event_wait_list,
464     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
465
466 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReadBufferRect)(
467     cl_command_queue    command_queue,
468     cl_mem              buffer,
469     cl_bool             blocking_read,
470     const size_t *      buffer_origin,
471     const size_t *      host_origin, 
472     const size_t *      region,
473     size_t              buffer_row_pitch,
474     size_t              buffer_slice_pitch,
475     size_t              host_row_pitch,
476     size_t              host_slice_pitch,
477     void *              ptr,
478     cl_uint             num_events_in_wait_list,
479     const cl_event *    event_wait_list,
480     cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
481                             
482 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueWriteBuffer)(
483     cl_command_queue   command_queue, 
484     cl_mem             buffer, 
485     cl_bool            blocking_write, 
486     size_t             offset, 
487     size_t             cb, 
488     const void *       ptr, 
489     cl_uint            num_events_in_wait_list, 
490     const cl_event *   event_wait_list, 
491     cl_event *         event) CL_API_SUFFIX__VERSION_1_0;
492                             
493 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueWriteBufferRect)(
494     cl_command_queue    command_queue,
495     cl_mem              buffer,
496     cl_bool             blocking_read,
497     const size_t *      buffer_origin,
498     const size_t *      host_origin, 
499     const size_t *      region,
500     size_t              buffer_row_pitch,
501     size_t              buffer_slice_pitch,
502     size_t              host_row_pitch,
503     size_t              host_slice_pitch,    
504     const void *        ptr,
505     cl_uint             num_events_in_wait_list,
506     const cl_event *    event_wait_list,
507     cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
508
509 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueFillBuffer)(
510     cl_command_queue   command_queue,
511     cl_mem             buffer,
512     const void *       pattern,
513     size_t             pattern_size,
514     size_t             offset,
515     size_t             cb,
516     cl_uint            num_events_in_wait_list,
517     const cl_event *   event_wait_list,
518     cl_event *         event) CL_API_SUFFIX__VERSION_1_2;
519
520 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueCopyBuffer)(
521     cl_command_queue    command_queue, 
522     cl_mem              src_buffer,
523     cl_mem              dst_buffer, 
524     size_t              src_offset,
525     size_t              dst_offset,
526     size_t              cb, 
527     cl_uint             num_events_in_wait_list,
528     const cl_event *    event_wait_list,
529     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
530                             
531 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueCopyBufferRect)(
532     cl_command_queue    command_queue, 
533     cl_mem              src_buffer,
534     cl_mem              dst_buffer, 
535     const size_t *      src_origin,
536     const size_t *      dst_origin,
537     const size_t *      region,
538     size_t              src_row_pitch,
539     size_t              src_slice_pitch,
540     size_t              dst_row_pitch,
541     size_t              dst_slice_pitch,
542     cl_uint             num_events_in_wait_list,
543     const cl_event *    event_wait_list,
544     cl_event *          event) CL_API_SUFFIX__VERSION_1_1;
545
546 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReadImage)(
547     cl_command_queue     command_queue,
548     cl_mem               image,
549     cl_bool              blocking_read, 
550     const size_t *       origin,
551     const size_t *       region,
552     size_t               row_pitch,
553     size_t               slice_pitch, 
554     void *               ptr,
555     cl_uint              num_events_in_wait_list,
556     const cl_event *     event_wait_list,
557     cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
558
559 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueWriteImage)(
560     cl_command_queue    command_queue,
561     cl_mem              image,
562     cl_bool             blocking_write, 
563     const size_t *      origin,
564     const size_t *      region,
565     size_t              input_row_pitch,
566     size_t              input_slice_pitch, 
567     const void *        ptr,
568     cl_uint             num_events_in_wait_list,
569     const cl_event *    event_wait_list,
570     cl_event *          event) CL_API_SUFFIX__VERSION_1_0;
571
572 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueFillImage)(
573     cl_command_queue   command_queue,
574     cl_mem             image,
575     const void *       fill_color,
576     const size_t       origin[3],
577     const size_t       region[3],
578     cl_uint            num_events_in_wait_list,
579     const cl_event *   event_wait_list,
580     cl_event *         event) CL_API_SUFFIX__VERSION_1_2;
581
582 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueCopyImage)(
583     cl_command_queue     command_queue,
584     cl_mem               src_image,
585     cl_mem               dst_image, 
586     const size_t *       src_origin,
587     const size_t *       dst_origin,
588     const size_t *       region, 
589     cl_uint              num_events_in_wait_list,
590     const cl_event *     event_wait_list,
591     cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
592
593 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueCopyImageToBuffer)(
594     cl_command_queue command_queue,
595     cl_mem           src_image,
596     cl_mem           dst_buffer, 
597     const size_t *   src_origin,
598     const size_t *   region, 
599     size_t           dst_offset,
600     cl_uint          num_events_in_wait_list,
601     const cl_event * event_wait_list,
602     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
603
604 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueCopyBufferToImage)(
605     cl_command_queue command_queue,
606     cl_mem           src_buffer,
607     cl_mem           dst_image, 
608     size_t           src_offset,
609     const size_t *   dst_origin,
610     const size_t *   region, 
611     cl_uint          num_events_in_wait_list,
612     const cl_event * event_wait_list,
613     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
614
615 typedef CL_API_ENTRY void * (CL_API_CALL *KHRpfn_clEnqueueMapBuffer)(
616     cl_command_queue command_queue,
617     cl_mem           buffer,
618     cl_bool          blocking_map, 
619     cl_map_flags     map_flags,
620     size_t           offset,
621     size_t           cb,
622     cl_uint          num_events_in_wait_list,
623     const cl_event * event_wait_list,
624     cl_event *       event,
625     cl_int *         errcode_ret) CL_API_SUFFIX__VERSION_1_0;
626
627 typedef CL_API_ENTRY void * (CL_API_CALL *KHRpfn_clEnqueueMapImage)(
628     cl_command_queue  command_queue,
629     cl_mem            image, 
630     cl_bool           blocking_map, 
631     cl_map_flags      map_flags, 
632     const size_t *    origin,
633     const size_t *    region,
634     size_t *          image_row_pitch,
635     size_t *          image_slice_pitch,
636     cl_uint           num_events_in_wait_list,
637     const cl_event *  event_wait_list,
638     cl_event *        event,
639     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
640
641 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueUnmapMemObject)(
642     cl_command_queue command_queue,
643     cl_mem           memobj,
644     void *           mapped_ptr,
645     cl_uint          num_events_in_wait_list,
646     const cl_event *  event_wait_list,
647     cl_event *        event) CL_API_SUFFIX__VERSION_1_0;
648
649 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueMigrateMemObjects)(
650     cl_command_queue       command_queue,
651     cl_uint                num_mem_objects,
652     const cl_mem *         mem_objects,
653     cl_mem_migration_flags flags,
654     cl_uint                num_events_in_wait_list,
655     const cl_event *       event_wait_list,
656     cl_event *             event) CL_API_SUFFIX__VERSION_1_2;
657
658 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueNDRangeKernel)(
659     cl_command_queue command_queue,
660     cl_kernel        kernel,
661     cl_uint          work_dim,
662     const size_t *   global_work_offset,
663     const size_t *   global_work_size,
664     const size_t *   local_work_size,
665     cl_uint          num_events_in_wait_list,
666     const cl_event * event_wait_list,
667     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
668
669 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueTask)(
670     cl_command_queue  command_queue,
671     cl_kernel         kernel,
672     cl_uint           num_events_in_wait_list,
673     const cl_event *  event_wait_list,
674     cl_event *        event) CL_API_SUFFIX__VERSION_1_0;
675
676 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueNativeKernel)(
677     cl_command_queue  command_queue,
678     void (CL_CALLBACK * user_func)(void *),
679     void *            args,
680     size_t            cb_args, 
681     cl_uint           num_mem_objects,
682     const cl_mem *    mem_list,
683     const void **     args_mem_loc,
684     cl_uint           num_events_in_wait_list,
685     const cl_event *  event_wait_list,
686     cl_event *        event) CL_API_SUFFIX__VERSION_1_0;
687
688 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueMarkerWithWaitList)(
689     cl_command_queue  command_queue,
690     cl_uint           num_events_in_wait_list,
691     const cl_event *  event_wait_list,
692     cl_event *        event) CL_API_SUFFIX__VERSION_1_2;
693
694 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueBarrierWithWaitList)(
695     cl_command_queue  command_queue,
696     cl_uint           num_events_in_wait_list,
697     const cl_event *  event_wait_list,
698     cl_event *        event) CL_API_SUFFIX__VERSION_1_2;
699
700 typedef CL_API_ENTRY void * (CL_API_CALL *KHRpfn_clGetExtensionFunctionAddressForPlatform)(
701     cl_platform_id platform,
702     const char *   function_name) CL_API_SUFFIX__VERSION_1_2;
703
704 // Shared Virtual Memory APIs
705 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMFree)(
706     cl_command_queue /* command_queue */,
707     cl_uint          /* num_svm_pointers */,
708     void **          /* svm_pointers */,
709     void (CL_CALLBACK *pfn_free_func)(
710         cl_command_queue /* queue */,
711         cl_uint          /* num_svm_pointers */,
712         void **          /* svm_pointers[] */,
713         void *           /* user_data */),
714     void *           /* user_data */,
715     cl_uint          /* num_events_in_wait_list */,
716     const cl_event * /* event_wait_list */,
717     cl_event * /* event */) CL_API_SUFFIX__VERSION_2_0;
718
719 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMMemcpy)(
720     cl_command_queue /* command_queue */,
721     cl_bool          /* blocking_copy */,
722     void *           /* dst_ptr */,
723     const void *     /* src_ptr */,
724     size_t           /* size */,
725     cl_uint          /* num_events_in_wait_list */,
726     const cl_event * /* event_wait_list */,
727     cl_event *       /* event */) CL_API_SUFFIX__VERSION_2_0;
728
729 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMMemFill)(
730     cl_command_queue /* command_queue */,
731     void *           /* svm_ptr */,
732     const void *     /* pattern */,
733     size_t           /* pattern_size */,
734     size_t           /* size */,
735     cl_uint          /* num_events_in_wait_list */,
736     const cl_event * /* event_wait_list */,
737     cl_event *       /* event */) CL_API_SUFFIX__VERSION_2_0;
738
739 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMMap)(
740     cl_command_queue /* command_queue */,
741     cl_bool          /* blocking_map */,
742     cl_map_flags     /* map_flags */,
743     void *           /* svm_ptr */,
744     size_t           /* size */,
745     cl_uint          /* num_events_in_wait_list */,
746     const cl_event * /* event_wait_list */,
747     cl_event *       /* event */) CL_API_SUFFIX__VERSION_2_0;
748
749 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMUnmap)(
750     cl_command_queue /* command_queue */,
751     void *           /* svm_ptr */,
752     cl_uint          /* num_events_in_wait_list */,
753     const cl_event * /* event_wait_list */,
754     cl_event *       /* event */) CL_API_SUFFIX__VERSION_2_0;
755
756 // Deprecated APIs
757 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetCommandQueueProperty)(
758     cl_command_queue              command_queue,
759     cl_command_queue_properties   properties, 
760     cl_bool                       enable,
761     cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
762
763 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateImage2D)(
764     cl_context              context,
765     cl_mem_flags            flags,
766     const cl_image_format * image_format,
767     size_t                  image_width,
768     size_t                  image_height,
769     size_t                  image_row_pitch, 
770     void *                  host_ptr,
771     cl_int *                errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
772                         
773 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateImage3D)(
774     cl_context              context,
775     cl_mem_flags            flags,
776     const cl_image_format * image_format,
777     size_t                  image_width, 
778     size_t                  image_height,
779     size_t                  image_depth, 
780     size_t                  image_row_pitch, 
781     size_t                  image_slice_pitch, 
782     void *                  host_ptr,
783     cl_int *                errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
784
785 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clUnloadCompiler)(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
786
787 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueMarker)(
788     cl_command_queue    command_queue,
789     cl_event *          event) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
790
791 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueWaitForEvents)(
792     cl_command_queue command_queue,
793     cl_uint          num_events,
794     const cl_event * event_list) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
795
796 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueBarrier)(cl_command_queue command_queue) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
797
798 typedef CL_API_ENTRY void * (CL_API_CALL *KHRpfn_clGetExtensionFunctionAddress)(const char *function_name) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
799
800 // GL and other APIs
801 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromGLBuffer)(
802     cl_context    context,
803     cl_mem_flags  flags,
804     GLuint        bufobj,
805     int *         errcode_ret) CL_API_SUFFIX__VERSION_1_0;
806
807 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromGLTexture)(
808     cl_context      context,
809     cl_mem_flags    flags,
810     cl_GLenum       target,
811     cl_GLint        miplevel,
812     cl_GLuint       texture,
813     cl_int *        errcode_ret) CL_API_SUFFIX__VERSION_1_2;
814
815 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromGLTexture2D)(
816     cl_context      context,
817     cl_mem_flags    flags,
818     GLenum          target,
819     GLint           miplevel,
820     GLuint          texture,
821     cl_int *        errcode_ret) CL_API_SUFFIX__VERSION_1_0;
822
823 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromGLTexture3D)(
824     cl_context      context,
825     cl_mem_flags    flags,
826     GLenum          target,
827     GLint           miplevel,
828     GLuint          texture,
829     cl_int *        errcode_ret) CL_API_SUFFIX__VERSION_1_0;
830
831 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromGLRenderbuffer)(
832     cl_context           context,
833     cl_mem_flags         flags,
834     GLuint               renderbuffer,
835     cl_int *             errcode_ret) CL_API_SUFFIX__VERSION_1_0;
836
837 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetGLObjectInfo)(
838     cl_mem               memobj,
839     cl_gl_object_type *  gl_object_type,
840     GLuint *             gl_object_name) CL_API_SUFFIX__VERSION_1_0;
841                   
842 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetGLTextureInfo)(
843     cl_mem               memobj,
844     cl_gl_texture_info   param_name,
845     size_t               param_value_size,
846     void *               param_value,
847     size_t *             param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
848
849 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueAcquireGLObjects)(
850     cl_command_queue     command_queue,
851     cl_uint              num_objects,
852     const cl_mem *       mem_objects,
853     cl_uint              num_events_in_wait_list,
854     const cl_event *     event_wait_list,
855     cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
856
857 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReleaseGLObjects)(
858     cl_command_queue     command_queue,
859     cl_uint              num_objects,
860     const cl_mem *       mem_objects,
861     cl_uint              num_events_in_wait_list,
862     const cl_event *     event_wait_list,
863     cl_event *           event) CL_API_SUFFIX__VERSION_1_0;
864
865 /* cl_khr_gl_sharing */
866 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetGLContextInfoKHR)(
867     const cl_context_properties *properties,
868     cl_gl_context_info param_name,
869     size_t param_value_size,
870     void *param_value,
871     size_t *param_value_size_ret);
872
873 /* cl_khr_gl_event */
874 typedef CL_API_ENTRY cl_event (CL_API_CALL *KHRpfn_clCreateEventFromGLsyncKHR)(
875     cl_context context,
876     cl_GLsync sync,
877     cl_int *errcode_ret);
878
879
880 #if defined(_WIN32)
881
882 /* cl_khr_d3d10_sharing */
883
884 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceIDsFromD3D10KHR)(
885     cl_platform_id             platform,
886     cl_d3d10_device_source_khr d3d_device_source,
887     void *                     d3d_object,
888     cl_d3d10_device_set_khr    d3d_device_set,
889     cl_uint                    num_entries, 
890     cl_device_id *             devices, 
891     cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_0;
892
893 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D10BufferKHR)(
894     cl_context     context,
895     cl_mem_flags   flags,
896     ID3D10Buffer * resource,
897     cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
898
899 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D10Texture2DKHR)(
900     cl_context        context,
901     cl_mem_flags      flags,
902     ID3D10Texture2D * resource,
903     UINT              subresource,
904     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
905
906 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D10Texture3DKHR)(
907     cl_context        context,
908     cl_mem_flags      flags,
909     ID3D10Texture3D * resource,
910     UINT              subresource,
911     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
912
913 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueAcquireD3D10ObjectsKHR)(
914     cl_command_queue command_queue,
915     cl_uint          num_objects,
916     const cl_mem *   mem_objects,
917     cl_uint          num_events_in_wait_list,
918     const cl_event * event_wait_list,
919     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
920
921 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReleaseD3D10ObjectsKHR)(
922     cl_command_queue command_queue,
923     cl_uint          num_objects,
924     const cl_mem *   mem_objects,
925     cl_uint          num_events_in_wait_list,
926     const cl_event * event_wait_list,
927     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
928
929 extern CL_API_ENTRY cl_int CL_API_CALL
930 clGetDeviceIDsFromD3D10KHR(
931     cl_platform_id platform,
932     cl_d3d10_device_source_khr d3d_device_source,
933     void *d3d_object,
934     cl_d3d10_device_set_khr d3d_device_set,
935     cl_uint num_entries, 
936     cl_device_id *devices, 
937     cl_uint *num_devices);
938  
939 extern CL_API_ENTRY cl_mem CL_API_CALL 
940 clCreateFromD3D10BufferKHR(
941     cl_context context,
942     cl_mem_flags flags,
943     ID3D10Buffer *resource,
944     cl_int *errcode_ret);
945
946 extern CL_API_ENTRY cl_mem CL_API_CALL
947 clCreateFromD3D10Texture2DKHR(
948     cl_context        context,
949     cl_mem_flags      flags,
950     ID3D10Texture2D * resource,
951     UINT              subresource,
952     cl_int *          errcode_ret);
953
954 extern CL_API_ENTRY cl_mem CL_API_CALL 
955 clCreateFromD3D10Texture3DKHR(
956     cl_context context,
957     cl_mem_flags flags,
958     ID3D10Texture3D *resource,
959     UINT subresource,
960     cl_int *errcode_ret);
961
962 extern CL_API_ENTRY cl_int CL_API_CALL 
963 clEnqueueAcquireD3D10ObjectsKHR(
964     cl_command_queue command_queue,
965     cl_uint num_objects,
966     const cl_mem *mem_objects,
967     cl_uint num_events_in_wait_list,
968     const cl_event *event_wait_list,
969     cl_event *event);
970
971 extern CL_API_ENTRY cl_int CL_API_CALL 
972 clEnqueueReleaseD3D10ObjectsKHR(
973     cl_command_queue command_queue,
974     cl_uint num_objects,
975     const cl_mem *mem_objects,
976     cl_uint num_events_in_wait_list,
977     const cl_event *event_wait_list,
978     cl_event *event);
979
980 /* cl_khr_d3d11_sharing */
981 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceIDsFromD3D11KHR)(
982     cl_platform_id             platform,
983     cl_d3d11_device_source_khr d3d_device_source,
984     void *                     d3d_object,
985     cl_d3d11_device_set_khr    d3d_device_set,
986     cl_uint                    num_entries,
987     cl_device_id *             devices,
988     cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_2;
989
990 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D11BufferKHR)(
991     cl_context     context,
992     cl_mem_flags   flags,
993     ID3D11Buffer * resource,
994     cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_2;
995
996 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D11Texture2DKHR)(
997     cl_context        context,
998     cl_mem_flags      flags,
999     ID3D11Texture2D * resource,
1000     UINT              subresource,
1001     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1002
1003 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromD3D11Texture3DKHR)(
1004     cl_context        context,
1005     cl_mem_flags      flags,
1006     ID3D11Texture3D * resource,
1007     UINT              subresource,
1008     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1009
1010 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueAcquireD3D11ObjectsKHR)(
1011     cl_command_queue command_queue,
1012     cl_uint          num_objects,
1013     const cl_mem *   mem_objects,
1014     cl_uint          num_events_in_wait_list,
1015     const cl_event * event_wait_list,
1016     cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
1017
1018 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReleaseD3D11ObjectsKHR)(
1019     cl_command_queue command_queue,
1020     cl_uint          num_objects,
1021     const cl_mem *   mem_objects,
1022     cl_uint          num_events_in_wait_list,
1023     const cl_event * event_wait_list,
1024     cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
1025
1026 /* cl_khr_dx9_media_sharing */
1027 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceIDsFromDX9MediaAdapterKHR)(
1028     cl_platform_id                  platform,
1029     cl_uint                         num_media_adapters,
1030     cl_dx9_media_adapter_type_khr * media_adapters_type,
1031     void *                          media_adapters,
1032     cl_dx9_media_adapter_set_khr    media_adapter_set,
1033     cl_uint                         num_entries,
1034     cl_device_id *                  devices,
1035     cl_uint *                       num_devices) CL_API_SUFFIX__VERSION_1_2;
1036
1037 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromDX9MediaSurfaceKHR)(
1038     cl_context                    context,
1039     cl_mem_flags                  flags,
1040     cl_dx9_media_adapter_type_khr adapter_type,
1041     void *                        surface_info,
1042     cl_uint                       plane,                                                                          
1043     cl_int *                      errcode_ret) CL_API_SUFFIX__VERSION_1_2;
1044
1045 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueAcquireDX9MediaSurfacesKHR)(
1046     cl_command_queue command_queue,
1047     cl_uint          num_objects,
1048     const cl_mem *   mem_objects,
1049     cl_uint          num_events_in_wait_list,
1050     const cl_event * event_wait_list,
1051     cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
1052
1053 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReleaseDX9MediaSurfacesKHR)(
1054     cl_command_queue command_queue,
1055     cl_uint          num_objects,
1056     const cl_mem *   mem_objects,
1057     cl_uint          num_events_in_wait_list,
1058     const cl_event * event_wait_list,
1059     cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
1060
1061 /* cl_khr_d3d11_sharing */
1062 extern CL_API_ENTRY cl_int CL_API_CALL
1063 clGetDeviceIDsFromD3D11KHR(
1064     cl_platform_id             platform,
1065     cl_d3d11_device_source_khr d3d_device_source,
1066     void *                     d3d_object,
1067     cl_d3d11_device_set_khr    d3d_device_set,
1068     cl_uint                    num_entries,
1069     cl_device_id *             devices,
1070     cl_uint *                  num_devices);
1071
1072 extern CL_API_ENTRY cl_mem CL_API_CALL
1073 clCreateFromD3D11BufferKHR(
1074     cl_context     context,
1075     cl_mem_flags   flags,
1076     ID3D11Buffer * resource,
1077     cl_int *       errcode_ret);
1078
1079 extern CL_API_ENTRY cl_mem CL_API_CALL
1080 clCreateFromD3D11Texture2DKHR(
1081     cl_context        context,
1082     cl_mem_flags      flags,
1083     ID3D11Texture2D * resource,
1084     UINT              subresource,
1085     cl_int *          errcode_ret);
1086
1087 extern CL_API_ENTRY cl_mem CL_API_CALL
1088 clCreateFromD3D11Texture3DKHR(
1089     cl_context        context,
1090     cl_mem_flags      flags,
1091     ID3D11Texture3D * resource,
1092     UINT              subresource,
1093     cl_int *          errcode_ret);
1094
1095 extern CL_API_ENTRY cl_int CL_API_CALL
1096 clEnqueueAcquireD3D11ObjectsKHR(
1097     cl_command_queue command_queue,
1098     cl_uint          num_objects,
1099     const cl_mem *   mem_objects,
1100     cl_uint          num_events_in_wait_list,
1101     const cl_event * event_wait_list,
1102     cl_event *       event);
1103
1104 extern CL_API_ENTRY cl_int CL_API_CALL
1105 clEnqueueReleaseD3D11ObjectsKHR(
1106     cl_command_queue command_queue,
1107     cl_uint          num_objects,
1108     const cl_mem *   mem_objects,
1109     cl_uint          num_events_in_wait_list,
1110     const cl_event * event_wait_list,
1111     cl_event *       event);
1112
1113 /* cl_khr_dx9_media_sharing */
1114 extern CL_API_ENTRY cl_int CL_API_CALL
1115 clGetDeviceIDsFromDX9MediaAdapterKHR(
1116     cl_platform_id                 platform,
1117     cl_uint                        num_media_adapters,
1118     cl_dx9_media_adapter_type_khr * media_adapter_type,
1119     void *                         media_adapters,
1120     cl_dx9_media_adapter_set_khr   media_adapter_set,
1121     cl_uint                        num_entries,
1122     cl_device_id *                 devices,
1123     cl_uint *                      num_devices);
1124
1125 extern CL_API_ENTRY cl_mem CL_API_CALL
1126 clCreateFromDX9MediaSurfaceKHR(
1127     cl_context                    context,
1128     cl_mem_flags                  flags,
1129     cl_dx9_media_adapter_type_khr adapter_type,
1130     void *                        surface_info,
1131     cl_uint                       plane,                                                                          
1132     cl_int *                      errcode_ret);
1133
1134 extern CL_API_ENTRY cl_int CL_API_CALL
1135 clEnqueueAcquireDX9MediaSurfacesKHR(
1136     cl_command_queue command_queue,
1137     cl_uint          num_objects,
1138     const cl_mem *   mem_objects,
1139     cl_uint          num_events_in_wait_list,
1140     const cl_event * event_wait_list,
1141     cl_event *       event);
1142
1143 extern CL_API_ENTRY cl_int CL_API_CALL
1144 clEnqueueReleaseDX9MediaSurfacesKHR(
1145     cl_command_queue command_queue,
1146     cl_uint          num_objects,
1147     const cl_mem *   mem_objects,
1148     cl_uint          num_events_in_wait_list,
1149     const cl_event * event_wait_list,
1150     cl_event *       event);
1151
1152 #else
1153
1154 /* cl_khr_d3d10_sharing */
1155 typedef void *KHRpfn_clGetDeviceIDsFromD3D10KHR;
1156 typedef void *KHRpfn_clCreateFromD3D10BufferKHR;
1157 typedef void *KHRpfn_clCreateFromD3D10Texture2DKHR;
1158 typedef void *KHRpfn_clCreateFromD3D10Texture3DKHR;
1159 typedef void *KHRpfn_clEnqueueAcquireD3D10ObjectsKHR;
1160 typedef void *KHRpfn_clEnqueueReleaseD3D10ObjectsKHR;
1161
1162 /* cl_khr_d3d11_sharing */
1163 typedef void *KHRpfn_clGetDeviceIDsFromD3D11KHR;
1164 typedef void *KHRpfn_clCreateFromD3D11BufferKHR;
1165 typedef void *KHRpfn_clCreateFromD3D11Texture2DKHR;
1166 typedef void *KHRpfn_clCreateFromD3D11Texture3DKHR;
1167 typedef void *KHRpfn_clEnqueueAcquireD3D11ObjectsKHR;
1168 typedef void *KHRpfn_clEnqueueReleaseD3D11ObjectsKHR;
1169
1170 /* cl_khr_dx9_media_sharing */
1171 typedef void *KHRpfn_clCreateFromDX9MediaSurfaceKHR;
1172 typedef void *KHRpfn_clEnqueueAcquireDX9MediaSurfacesKHR;
1173 typedef void *KHRpfn_clEnqueueReleaseDX9MediaSurfacesKHR;
1174 typedef void *KHRpfn_clGetDeviceIDsFromDX9MediaAdapterKHR;
1175
1176 #endif
1177
1178 /* OpenCL 1.1 */
1179
1180 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetEventCallback)(
1181     cl_event            /* event */,
1182     cl_int              /* command_exec_callback_type */,
1183     void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
1184     void *              /* user_data */) CL_API_SUFFIX__VERSION_1_1;
1185
1186 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateSubBuffer)(
1187     cl_mem                   /* buffer */,
1188     cl_mem_flags             /* flags */,
1189     cl_buffer_create_type    /* buffer_create_type */,
1190     const void *             /* buffer_create_info */,
1191     cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
1192
1193 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetMemObjectDestructorCallback)(
1194     cl_mem /* memobj */, 
1195     void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), 
1196     void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
1197
1198 typedef CL_API_ENTRY cl_event (CL_API_CALL *KHRpfn_clCreateUserEvent)(
1199     cl_context    /* context */,
1200     cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
1201
1202 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetUserEventStatus)(
1203     cl_event   /* event */,
1204     cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
1205
1206 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clCreateSubDevicesEXT)(
1207     cl_device_id     in_device,
1208     const cl_device_partition_property_ext * partition_properties,
1209     cl_uint          num_entries,
1210     cl_device_id *   out_devices,
1211     cl_uint *        num_devices);
1212
1213 typedef CL_API_ENTRY cl_int (CL_API_CALL * KHRpfn_clRetainDeviceEXT)(
1214     cl_device_id     device) CL_API_SUFFIX__VERSION_1_0;
1215
1216 typedef CL_API_ENTRY cl_int (CL_API_CALL * KHRpfn_clReleaseDeviceEXT)(
1217     cl_device_id     device) CL_API_SUFFIX__VERSION_1_0;
1218
1219 /* cl_khr_egl_image */
1220 typedef CL_API_ENTRY cl_mem (CL_API_CALL *KHRpfn_clCreateFromEGLImageKHR)(
1221     cl_context context,
1222     CLeglDisplayKHR display,
1223     CLeglImageKHR image,
1224     cl_mem_flags flags,
1225     const cl_egl_image_properties_khr *properties,
1226     cl_int *errcode_ret);
1227
1228 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueAcquireEGLObjectsKHR)(
1229     cl_command_queue command_queue,
1230     cl_uint num_objects,
1231     const cl_mem *mem_objects,
1232     cl_uint num_events_in_wait_list,
1233     const cl_event *event_wait_list,
1234     cl_event *event);
1235
1236 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueReleaseEGLObjectsKHR)(
1237     cl_command_queue command_queue,
1238     cl_uint num_objects,
1239     const cl_mem *mem_objects,
1240     cl_uint num_events_in_wait_list,
1241     const cl_event *event_wait_list,
1242     cl_event *event);
1243
1244 /* cl_khr_egl_event */
1245 typedef CL_API_ENTRY cl_event (CL_API_CALL *KHRpfn_clCreateEventFromEGLSyncKHR)(
1246     cl_context context,
1247     CLeglSyncKHR sync,
1248     CLeglDisplayKHR display,
1249     cl_int *errcode_ret);
1250
1251 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetDefaultDeviceCommandQueue)(
1252     cl_context context,
1253     cl_device_id device,
1254     cl_command_queue command_queue) CL_API_SUFFIX__VERSION_2_1;
1255
1256 typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithIL)(
1257     cl_context context,
1258     const void * il,
1259     size_t length,
1260     cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_1;
1261
1262 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetKernelSubGroupInfo )(
1263     cl_kernel kernel,
1264     cl_device_id device,
1265     cl_kernel_sub_group_info param_name,
1266     size_t input_value_size,
1267     const void * input_value,
1268     size_t param_value_size,
1269     void * param_value,
1270     size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_2_1;
1271
1272 typedef CL_API_ENTRY cl_kernel (CL_API_CALL *KHRpfn_clCloneKernel)(
1273     cl_kernel source_kernel, 
1274     cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_1;
1275
1276 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clEnqueueSVMMigrateMem)(
1277     cl_command_queue command_queue,
1278     cl_uint num_svm_pointers,
1279     const void ** svm_pointers,
1280     const size_t * sizes,
1281     cl_mem_migration_flags flags,
1282     cl_uint num_events_in_wait_list,
1283     const cl_event * event_wait_list,
1284     cl_event * event) CL_API_SUFFIX__VERSION_2_1;
1285
1286 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetDeviceAndHostTimer)(
1287     cl_device_id device,
1288     cl_ulong * device_timestamp,
1289     cl_ulong * host_timestamp) CL_API_SUFFIX__VERSION_2_1;
1290
1291 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clGetHostTimer)(
1292     cl_device_id device,
1293     cl_ulong * host_timestamp) CL_API_SUFFIX__VERSION_2_1;
1294
1295 /*
1296  *
1297  * vendor dispatch table structure
1298  *
1299  * note that the types in the structure KHRicdVendorDispatch mirror the function 
1300  * names listed in the string table khrIcdVendorDispatchFunctionNames
1301  *
1302  */
1303
1304 typedef struct KHRicdVendorDispatchRec KHRicdVendorDispatch;
1305
1306 struct KHRicdVendorDispatchRec
1307 {
1308     /* OpenCL 1.0 */
1309     KHRpfn_clGetPlatformIDs                         clGetPlatformIDs;
1310     KHRpfn_clGetPlatformInfo                        clGetPlatformInfo;
1311     KHRpfn_clGetDeviceIDs                           clGetDeviceIDs;
1312     KHRpfn_clGetDeviceInfo                          clGetDeviceInfo;
1313     KHRpfn_clCreateContext                          clCreateContext;
1314     KHRpfn_clCreateContextFromType                  clCreateContextFromType;
1315     KHRpfn_clRetainContext                          clRetainContext;
1316     KHRpfn_clReleaseContext                         clReleaseContext;
1317     KHRpfn_clGetContextInfo                         clGetContextInfo;
1318     KHRpfn_clCreateCommandQueue                     clCreateCommandQueue;
1319     KHRpfn_clRetainCommandQueue                     clRetainCommandQueue;
1320     KHRpfn_clReleaseCommandQueue                    clReleaseCommandQueue;
1321     KHRpfn_clGetCommandQueueInfo                    clGetCommandQueueInfo;
1322     KHRpfn_clSetCommandQueueProperty                clSetCommandQueueProperty;
1323     KHRpfn_clCreateBuffer                           clCreateBuffer;
1324     KHRpfn_clCreateImage2D                          clCreateImage2D;
1325     KHRpfn_clCreateImage3D                          clCreateImage3D;
1326     KHRpfn_clRetainMemObject                        clRetainMemObject;
1327     KHRpfn_clReleaseMemObject                       clReleaseMemObject;
1328     KHRpfn_clGetSupportedImageFormats               clGetSupportedImageFormats;
1329     KHRpfn_clGetMemObjectInfo                       clGetMemObjectInfo;
1330     KHRpfn_clGetImageInfo                           clGetImageInfo;
1331     KHRpfn_clCreateSampler                          clCreateSampler;
1332     KHRpfn_clRetainSampler                          clRetainSampler;
1333     KHRpfn_clReleaseSampler                         clReleaseSampler;
1334     KHRpfn_clGetSamplerInfo                         clGetSamplerInfo;
1335     KHRpfn_clCreateProgramWithSource                clCreateProgramWithSource;
1336     KHRpfn_clCreateProgramWithBinary                clCreateProgramWithBinary;
1337     KHRpfn_clRetainProgram                          clRetainProgram;
1338     KHRpfn_clReleaseProgram                         clReleaseProgram;
1339     KHRpfn_clBuildProgram                           clBuildProgram;
1340     KHRpfn_clUnloadCompiler                         clUnloadCompiler;
1341     KHRpfn_clGetProgramInfo                         clGetProgramInfo;
1342     KHRpfn_clGetProgramBuildInfo                    clGetProgramBuildInfo;
1343     KHRpfn_clCreateKernel                           clCreateKernel;
1344     KHRpfn_clCreateKernelsInProgram                 clCreateKernelsInProgram;
1345     KHRpfn_clRetainKernel                           clRetainKernel;
1346     KHRpfn_clReleaseKernel                          clReleaseKernel;
1347     KHRpfn_clSetKernelArg                           clSetKernelArg;
1348     KHRpfn_clGetKernelInfo                          clGetKernelInfo;
1349     KHRpfn_clGetKernelWorkGroupInfo                 clGetKernelWorkGroupInfo;
1350     KHRpfn_clWaitForEvents                          clWaitForEvents;
1351     KHRpfn_clGetEventInfo                           clGetEventInfo;
1352     KHRpfn_clRetainEvent                            clRetainEvent;
1353     KHRpfn_clReleaseEvent                           clReleaseEvent;
1354     KHRpfn_clGetEventProfilingInfo                  clGetEventProfilingInfo;
1355     KHRpfn_clFlush                                  clFlush;
1356     KHRpfn_clFinish                                 clFinish;
1357     KHRpfn_clEnqueueReadBuffer                      clEnqueueReadBuffer;
1358     KHRpfn_clEnqueueWriteBuffer                     clEnqueueWriteBuffer;
1359     KHRpfn_clEnqueueCopyBuffer                      clEnqueueCopyBuffer;
1360     KHRpfn_clEnqueueReadImage                       clEnqueueReadImage;
1361     KHRpfn_clEnqueueWriteImage                      clEnqueueWriteImage;
1362     KHRpfn_clEnqueueCopyImage                       clEnqueueCopyImage;
1363     KHRpfn_clEnqueueCopyImageToBuffer               clEnqueueCopyImageToBuffer;
1364     KHRpfn_clEnqueueCopyBufferToImage               clEnqueueCopyBufferToImage;
1365     KHRpfn_clEnqueueMapBuffer                       clEnqueueMapBuffer;
1366     KHRpfn_clEnqueueMapImage                        clEnqueueMapImage;
1367     KHRpfn_clEnqueueUnmapMemObject                  clEnqueueUnmapMemObject;
1368     KHRpfn_clEnqueueNDRangeKernel                   clEnqueueNDRangeKernel;
1369     KHRpfn_clEnqueueTask                            clEnqueueTask;
1370     KHRpfn_clEnqueueNativeKernel                    clEnqueueNativeKernel;
1371     KHRpfn_clEnqueueMarker                          clEnqueueMarker;
1372     KHRpfn_clEnqueueWaitForEvents                   clEnqueueWaitForEvents;
1373     KHRpfn_clEnqueueBarrier                         clEnqueueBarrier;
1374     KHRpfn_clGetExtensionFunctionAddress            clGetExtensionFunctionAddress;
1375     KHRpfn_clCreateFromGLBuffer                     clCreateFromGLBuffer;
1376     KHRpfn_clCreateFromGLTexture2D                  clCreateFromGLTexture2D;
1377     KHRpfn_clCreateFromGLTexture3D                  clCreateFromGLTexture3D;
1378     KHRpfn_clCreateFromGLRenderbuffer               clCreateFromGLRenderbuffer;
1379     KHRpfn_clGetGLObjectInfo                        clGetGLObjectInfo;
1380     KHRpfn_clGetGLTextureInfo                       clGetGLTextureInfo;
1381     KHRpfn_clEnqueueAcquireGLObjects                clEnqueueAcquireGLObjects;
1382     KHRpfn_clEnqueueReleaseGLObjects                clEnqueueReleaseGLObjects;
1383     KHRpfn_clGetGLContextInfoKHR                    clGetGLContextInfoKHR;
1384
1385     /* cl_khr_d3d10_sharing */
1386     KHRpfn_clGetDeviceIDsFromD3D10KHR               clGetDeviceIDsFromD3D10KHR;
1387     KHRpfn_clCreateFromD3D10BufferKHR               clCreateFromD3D10BufferKHR;
1388     KHRpfn_clCreateFromD3D10Texture2DKHR            clCreateFromD3D10Texture2DKHR;
1389     KHRpfn_clCreateFromD3D10Texture3DKHR            clCreateFromD3D10Texture3DKHR;
1390     KHRpfn_clEnqueueAcquireD3D10ObjectsKHR          clEnqueueAcquireD3D10ObjectsKHR;
1391     KHRpfn_clEnqueueReleaseD3D10ObjectsKHR          clEnqueueReleaseD3D10ObjectsKHR;
1392
1393     /* OpenCL 1.1 */
1394     KHRpfn_clSetEventCallback                       clSetEventCallback;
1395     KHRpfn_clCreateSubBuffer                        clCreateSubBuffer;
1396     KHRpfn_clSetMemObjectDestructorCallback         clSetMemObjectDestructorCallback;
1397     KHRpfn_clCreateUserEvent                        clCreateUserEvent;
1398     KHRpfn_clSetUserEventStatus                     clSetUserEventStatus;
1399     KHRpfn_clEnqueueReadBufferRect                  clEnqueueReadBufferRect;
1400     KHRpfn_clEnqueueWriteBufferRect                 clEnqueueWriteBufferRect;
1401     KHRpfn_clEnqueueCopyBufferRect                  clEnqueueCopyBufferRect;
1402
1403     /* cl_ext_device_fission */
1404     KHRpfn_clCreateSubDevicesEXT                    clCreateSubDevicesEXT;
1405     KHRpfn_clRetainDeviceEXT                        clRetainDeviceEXT;
1406     KHRpfn_clReleaseDeviceEXT                       clReleaseDeviceEXT;
1407
1408     /* cl_khr_gl_event */
1409     KHRpfn_clCreateEventFromGLsyncKHR               clCreateEventFromGLsyncKHR;
1410
1411     /* OpenCL 1.2 */
1412     KHRpfn_clCreateSubDevices                       clCreateSubDevices;
1413     KHRpfn_clRetainDevice                           clRetainDevice;
1414     KHRpfn_clReleaseDevice                          clReleaseDevice;
1415     KHRpfn_clCreateImage                            clCreateImage;
1416     KHRpfn_clCreateProgramWithBuiltInKernels        clCreateProgramWithBuiltInKernels;
1417     KHRpfn_clCompileProgram                         clCompileProgram;
1418     KHRpfn_clLinkProgram                            clLinkProgram;
1419     KHRpfn_clUnloadPlatformCompiler                 clUnloadPlatformCompiler;
1420     KHRpfn_clGetKernelArgInfo                       clGetKernelArgInfo;
1421     KHRpfn_clEnqueueFillBuffer                      clEnqueueFillBuffer;
1422     KHRpfn_clEnqueueFillImage                       clEnqueueFillImage;
1423     KHRpfn_clEnqueueMigrateMemObjects               clEnqueueMigrateMemObjects;
1424     KHRpfn_clEnqueueMarkerWithWaitList              clEnqueueMarkerWithWaitList;
1425     KHRpfn_clEnqueueBarrierWithWaitList             clEnqueueBarrierWithWaitList;
1426     KHRpfn_clGetExtensionFunctionAddressForPlatform clGetExtensionFunctionAddressForPlatform;
1427     KHRpfn_clCreateFromGLTexture                    clCreateFromGLTexture;
1428
1429     /* cl_khr_d3d11_sharing */
1430     KHRpfn_clGetDeviceIDsFromD3D11KHR               clGetDeviceIDsFromD3D11KHR;
1431     KHRpfn_clCreateFromD3D11BufferKHR               clCreateFromD3D11BufferKHR;
1432     KHRpfn_clCreateFromD3D11Texture2DKHR            clCreateFromD3D11Texture2DKHR;
1433     KHRpfn_clCreateFromD3D11Texture3DKHR            clCreateFromD3D11Texture3DKHR;
1434     KHRpfn_clCreateFromDX9MediaSurfaceKHR           clCreateFromDX9MediaSurfaceKHR;
1435     KHRpfn_clEnqueueAcquireD3D11ObjectsKHR          clEnqueueAcquireD3D11ObjectsKHR;
1436     KHRpfn_clEnqueueReleaseD3D11ObjectsKHR          clEnqueueReleaseD3D11ObjectsKHR;
1437
1438     /* cl_khr_dx9_media_sharing */
1439     KHRpfn_clGetDeviceIDsFromDX9MediaAdapterKHR     clGetDeviceIDsFromDX9MediaAdapterKHR;
1440     KHRpfn_clEnqueueAcquireDX9MediaSurfacesKHR      clEnqueueAcquireDX9MediaSurfacesKHR;
1441     KHRpfn_clEnqueueReleaseDX9MediaSurfacesKHR      clEnqueueReleaseDX9MediaSurfacesKHR;
1442
1443     /* cl_khr_egl_image */
1444     KHRpfn_clCreateFromEGLImageKHR                  clCreateFromEGLImageKHR;
1445     KHRpfn_clEnqueueAcquireEGLObjectsKHR            clEnqueueAcquireEGLObjectsKHR;
1446     KHRpfn_clEnqueueReleaseEGLObjectsKHR            clEnqueueReleaseEGLObjectsKHR;
1447
1448     /* cl_khr_egl_event */
1449     KHRpfn_clCreateEventFromEGLSyncKHR              clCreateEventFromEGLSyncKHR;
1450
1451     /* OpenCL 2.0 */
1452     KHRpfn_clCreateCommandQueueWithProperties       clCreateCommandQueueWithProperties;
1453     KHRpfn_clCreatePipe                             clCreatePipe;
1454     KHRpfn_clGetPipeInfo                            clGetPipeInfo;
1455     KHRpfn_clSVMAlloc                               clSVMAlloc;
1456     KHRpfn_clSVMFree                                clSVMFree;
1457     KHRpfn_clEnqueueSVMFree                         clEnqueueSVMFree;
1458     KHRpfn_clEnqueueSVMMemcpy                       clEnqueueSVMMemcpy;
1459     KHRpfn_clEnqueueSVMMemFill                      clEnqueueSVMMemFill;
1460     KHRpfn_clEnqueueSVMMap                          clEnqueueSVMMap;
1461     KHRpfn_clEnqueueSVMUnmap                        clEnqueueSVMUnmap;
1462     KHRpfn_clCreateSamplerWithProperties            clCreateSamplerWithProperties;
1463     KHRpfn_clSetKernelArgSVMPointer                 clSetKernelArgSVMPointer;
1464     KHRpfn_clSetKernelExecInfo                      clSetKernelExecInfo;
1465
1466     /* cl_khr_sub_groups */
1467     KHRpfn_clGetKernelSubGroupInfoKHR               clGetKernelSubGroupInfoKHR;
1468
1469     /* OpenCL 2.1 */
1470     KHRpfn_clCloneKernel                            clCloneKernel;
1471     KHRpfn_clCreateProgramWithIL                    clCreateProgramWithIL;
1472     KHRpfn_clEnqueueSVMMigrateMem                   clEnqueueSVMMigrateMem;
1473     KHRpfn_clGetDeviceAndHostTimer                  clGetDeviceAndHostTimer;
1474     KHRpfn_clGetHostTimer                           clGetHostTimer;
1475     KHRpfn_clGetKernelSubGroupInfo                  clGetKernelSubGroupInfo;
1476     KHRpfn_clSetDefaultDeviceCommandQueue           clSetDefaultDeviceCommandQueue;
1477
1478     /* OpenCL 2.2 */
1479     KHRpfn_clSetProgramReleaseCallback              clSetProgramReleaseCallback;
1480     KHRpfn_clSetProgramSpecializationConstant       clSetProgramSpecializationConstant;
1481 };
1482
1483 /*
1484  *
1485  * vendor dispatch table structure
1486  *
1487  */
1488
1489 struct _cl_platform_id
1490 {
1491     KHRicdVendorDispatch *dispatch;
1492 };
1493
1494 struct _cl_device_id
1495 {
1496     KHRicdVendorDispatch *dispatch;
1497 };
1498
1499 struct _cl_context
1500 {
1501     KHRicdVendorDispatch *dispatch;
1502 };
1503
1504 struct _cl_command_queue
1505 {
1506     KHRicdVendorDispatch *dispatch;
1507 };
1508
1509 struct _cl_mem
1510 {
1511     KHRicdVendorDispatch *dispatch;
1512 };
1513
1514 struct _cl_program
1515 {
1516     KHRicdVendorDispatch *dispatch;
1517 };
1518
1519 struct _cl_kernel
1520 {
1521     KHRicdVendorDispatch *dispatch;
1522 };
1523
1524 struct _cl_event
1525 {
1526     KHRicdVendorDispatch *dispatch;
1527 };
1528
1529 struct _cl_sampler
1530 {
1531     KHRicdVendorDispatch *dispatch;
1532 };
1533
1534 #endif // _ICD_DISPATCH_H_
1535