Home | History | Annotate | Download | only in api
      1 //
      2 // Copyright 2013 Francisco Jerez
      3 //
      4 // Permission is hereby granted, free of charge, to any person obtaining a
      5 // copy of this software and associated documentation files (the "Software"),
      6 // to deal in the Software without restriction, including without limitation
      7 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
      8 // and/or sell copies of the Software, and to permit persons to whom the
      9 // Software is furnished to do so, subject to the following conditions:
     10 //
     11 // The above copyright notice and this permission notice shall be included in
     12 // all copies or substantial portions of the Software.
     13 //
     14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     17 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     18 // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     19 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     20 // OTHER DEALINGS IN THE SOFTWARE.
     21 //
     22 
     23 #ifndef API_DISPATCH_HPP
     24 #define API_DISPATCH_HPP
     25 
     26 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
     27 
     28 #include "CL/cl.h"
     29 #include "CL/cl_ext.h"
     30 #include "CL/cl_gl.h"
     31 
     32 ///
     33 /// OpenCL ICD vendor dispatch table.
     34 ///
     35 /// The entry point ordering should always be in agreement with
     36 /// Khronos' ICD loader.
     37 ///
     38 struct _cl_icd_dispatch {
     39    CL_API_ENTRY cl_int (CL_API_CALL *clGetPlatformIDs)(
     40       cl_uint num_entries,
     41       cl_platform_id *platforms,
     42       cl_uint *num_platforms);
     43 
     44    CL_API_ENTRY cl_int (CL_API_CALL *clGetPlatformInfo)(
     45       cl_platform_id platform,
     46       cl_platform_info param_name,
     47       size_t param_value_size,
     48       void *param_value,
     49       size_t *param_value_size_ret);
     50 
     51    CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDs)(
     52       cl_platform_id platform,
     53       cl_device_type device_type,
     54       cl_uint num_entries,
     55       cl_device_id *devices,
     56       cl_uint *num_devices);
     57 
     58    CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceInfo)(
     59       cl_device_id device,
     60       cl_device_info param_name,
     61       size_t param_value_size,
     62       void *param_value,
     63       size_t *param_value_size_ret);
     64 
     65    CL_API_ENTRY cl_context (CL_API_CALL *clCreateContext)(
     66       const cl_context_properties *properties,
     67       cl_uint num_devices,
     68       const cl_device_id *devices,
     69       void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *),
     70       void *user_data,
     71       cl_int *errcode_ret);
     72 
     73    CL_API_ENTRY cl_context (CL_API_CALL *clCreateContextFromType)(
     74       const cl_context_properties *properties,
     75       cl_device_type device_type,
     76       void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *),
     77       void *user_data,
     78       cl_int *errcode_ret);
     79 
     80    CL_API_ENTRY cl_int (CL_API_CALL *clRetainContext)(
     81       cl_context context);
     82 
     83    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseContext)(
     84       cl_context context);
     85 
     86    CL_API_ENTRY cl_int (CL_API_CALL *clGetContextInfo)(
     87       cl_context context,
     88       cl_context_info param_name,
     89       size_t param_value_size,
     90       void *param_value,
     91       size_t *param_value_size_ret);
     92 
     93    CL_API_ENTRY cl_command_queue (CL_API_CALL *clCreateCommandQueue)(
     94       cl_context context,
     95       cl_device_id device,
     96       cl_command_queue_properties properties,
     97       cl_int *errcode_ret);
     98 
     99    CL_API_ENTRY cl_int (CL_API_CALL *clRetainCommandQueue)(
    100       cl_command_queue command_queue);
    101 
    102    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseCommandQueue)(
    103       cl_command_queue command_queue);
    104 
    105    CL_API_ENTRY cl_int (CL_API_CALL *clGetCommandQueueInfo)(
    106       cl_command_queue command_queue,
    107       cl_command_queue_info param_name,
    108       size_t param_value_size,
    109       void *param_value,
    110       size_t *param_value_size_ret);
    111 
    112    CL_API_ENTRY cl_int (CL_API_CALL *clSetCommandQueueProperty)(
    113       cl_command_queue command_queue,
    114       cl_command_queue_properties properties,
    115       cl_bool enable,
    116       cl_command_queue_properties *old_properties);
    117 
    118    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateBuffer)(
    119       cl_context context,
    120       cl_mem_flags flags,
    121       size_t size,
    122       void *host_ptr,
    123       cl_int *errcode_ret);
    124 
    125    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImage2D)(
    126       cl_context context,
    127       cl_mem_flags flags,
    128       const cl_image_format *image_format,
    129       size_t image_width,
    130       size_t image_height,
    131       size_t image_row_pitch,
    132       void *host_ptr,
    133       cl_int *errcode_ret);
    134 
    135    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImage3D)(
    136       cl_context context,
    137       cl_mem_flags flags,
    138       const cl_image_format *image_format,
    139       size_t image_width,
    140       size_t image_height,
    141       size_t image_depth,
    142       size_t image_row_pitch,
    143       size_t image_slice_pitch,
    144       void *host_ptr,
    145       cl_int *errcode_ret);
    146 
    147    CL_API_ENTRY cl_int (CL_API_CALL *clRetainMemObject)(
    148       cl_mem memobj);
    149 
    150    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseMemObject)(
    151       cl_mem memobj);
    152 
    153    CL_API_ENTRY cl_int (CL_API_CALL *clGetSupportedImageFormats)(
    154       cl_context context,
    155       cl_mem_flags flags,
    156       cl_mem_object_type image_type,
    157       cl_uint num_entries,
    158       cl_image_format *image_formats,
    159       cl_uint *num_image_formats);
    160 
    161    CL_API_ENTRY cl_int (CL_API_CALL *clGetMemObjectInfo)(
    162       cl_mem memobj,
    163       cl_mem_info param_name,
    164       size_t param_value_size,
    165       void *param_value,
    166       size_t *param_value_size_ret);
    167 
    168    CL_API_ENTRY cl_int (CL_API_CALL *clGetImageInfo)(
    169       cl_mem image,
    170       cl_image_info param_name,
    171       size_t param_value_size,
    172       void *param_value,
    173       size_t *param_value_size_ret);
    174 
    175    CL_API_ENTRY cl_sampler (CL_API_CALL *clCreateSampler)(
    176       cl_context context,
    177       cl_bool normalized_coords,
    178       cl_addressing_mode addressing_mode,
    179       cl_filter_mode filter_mode,
    180       cl_int *errcode_ret);
    181 
    182    CL_API_ENTRY cl_int (CL_API_CALL *clRetainSampler)(
    183       cl_sampler sampler);
    184 
    185    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseSampler)(
    186       cl_sampler sampler);
    187 
    188    CL_API_ENTRY cl_int (CL_API_CALL *clGetSamplerInfo)(
    189       cl_sampler sampler,
    190       cl_sampler_info param_name,
    191       size_t param_value_size,
    192       void *param_value,
    193       size_t *param_value_size_ret);
    194 
    195    CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithSource)(
    196       cl_context context,
    197       cl_uint count,
    198       const char **strings,
    199       const size_t *lengths,
    200       cl_int *errcode_ret);
    201 
    202    CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithBinary)(
    203       cl_context context,
    204       cl_uint num_devices,
    205       const cl_device_id *device_list,
    206       const size_t *lengths,
    207       const unsigned char **binaries,
    208       cl_int *binary_status,
    209       cl_int *errcode_ret);
    210 
    211    CL_API_ENTRY cl_int (CL_API_CALL *clRetainProgram)(
    212       cl_program program);
    213 
    214    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseProgram)(
    215       cl_program program);
    216 
    217    CL_API_ENTRY cl_int (CL_API_CALL *clBuildProgram)(
    218       cl_program program,
    219       cl_uint num_devices,
    220       const cl_device_id *device_list,
    221       const char *options,
    222       void (CL_CALLBACK *pfn_notify)(cl_program, void *),
    223       void *user_data);
    224 
    225    CL_API_ENTRY cl_int (CL_API_CALL *clUnloadCompiler)(
    226       void);
    227 
    228    CL_API_ENTRY cl_int (CL_API_CALL *clGetProgramInfo)(
    229       cl_program program,
    230       cl_program_info param_name,
    231       size_t param_value_size,
    232       void *param_value,
    233       size_t *param_value_size_ret);
    234 
    235    CL_API_ENTRY cl_int (CL_API_CALL *clGetProgramBuildInfo)(
    236       cl_program program,
    237       cl_device_id device,
    238       cl_program_build_info param_name,
    239       size_t param_value_size,
    240       void *param_value,
    241       size_t *param_value_size_ret);
    242 
    243    CL_API_ENTRY cl_kernel (CL_API_CALL *clCreateKernel)(
    244       cl_program program,
    245       const char *kernel_name,
    246       cl_int *errcode_ret);
    247 
    248    CL_API_ENTRY cl_int (CL_API_CALL *clCreateKernelsInProgram)(
    249       cl_program program,
    250       cl_uint num_kernels,
    251       cl_kernel *kernels,
    252       cl_uint *num_kernels_ret);
    253 
    254    CL_API_ENTRY cl_int (CL_API_CALL *clRetainKernel)(
    255       cl_kernel kernel);
    256 
    257    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseKernel)(
    258       cl_kernel kernel);
    259 
    260    CL_API_ENTRY cl_int (CL_API_CALL *clSetKernelArg)(
    261       cl_kernel kernel,
    262       cl_uint arg_index,
    263       size_t arg_size,
    264       const void *arg_value);
    265 
    266    CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelInfo)(
    267       cl_kernel kernel,
    268       cl_kernel_info param_name,
    269       size_t param_value_size,
    270       void *param_value,
    271       size_t *param_value_size_ret);
    272 
    273    CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelWorkGroupInfo)(
    274       cl_kernel kernel,
    275       cl_device_id device,
    276       cl_kernel_work_group_info param_name,
    277       size_t param_value_size,
    278       void *param_value,
    279       size_t *param_value_size_ret);
    280 
    281    CL_API_ENTRY cl_int (CL_API_CALL *clWaitForEvents)(
    282       cl_uint num_events,
    283       const cl_event *event_list);
    284 
    285    CL_API_ENTRY cl_int (CL_API_CALL *clGetEventInfo)(
    286       cl_event event,
    287       cl_event_info param_name,
    288       size_t param_value_size,
    289       void *param_value,
    290       size_t *param_value_size_ret);
    291 
    292    CL_API_ENTRY cl_int (CL_API_CALL *clRetainEvent)(
    293       cl_event event);
    294 
    295    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseEvent)(
    296       cl_event event);
    297 
    298    CL_API_ENTRY cl_int (CL_API_CALL *clGetEventProfilingInfo)(
    299       cl_event event,
    300       cl_profiling_info param_name,
    301       size_t param_value_size,
    302       void *param_value,
    303       size_t *param_value_size_ret);
    304 
    305    CL_API_ENTRY cl_int (CL_API_CALL *clFlush)(
    306       cl_command_queue command_queue);
    307 
    308    CL_API_ENTRY cl_int (CL_API_CALL *clFinish)(
    309       cl_command_queue command_queue);
    310 
    311    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadBuffer)(
    312       cl_command_queue command_queue,
    313       cl_mem buffer,
    314       cl_bool blocking_read,
    315       size_t offset,
    316       size_t cb,
    317       void *ptr,
    318       cl_uint num_events_in_wait_list,
    319       const cl_event *event_wait_list,
    320       cl_event *event);
    321 
    322    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteBuffer)(
    323       cl_command_queue command_queue,
    324       cl_mem buffer,
    325       cl_bool blocking_write,
    326       size_t offset,
    327       size_t cb,
    328       const void *ptr,
    329       cl_uint num_events_in_wait_list,
    330       const cl_event *event_wait_list,
    331       cl_event *event);
    332 
    333    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBuffer)(
    334       cl_command_queue command_queue,
    335       cl_mem src_buffer,
    336       cl_mem dst_buffer,
    337       size_t src_offset,
    338       size_t dst_offset,
    339       size_t cb,
    340       cl_uint num_events_in_wait_list,
    341       const cl_event *event_wait_list,
    342       cl_event *event);
    343 
    344    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadImage)(
    345       cl_command_queue command_queue,
    346       cl_mem image,
    347       cl_bool blocking_read,
    348       const size_t *origin,
    349       const size_t *region,
    350       size_t row_pitch,
    351       size_t slice_pitch,
    352       void *ptr,
    353       cl_uint num_events_in_wait_list,
    354       const cl_event *event_wait_list,
    355       cl_event *event);
    356 
    357    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteImage)(
    358       cl_command_queue command_queue,
    359       cl_mem image,
    360       cl_bool blocking_write,
    361       const size_t *origin,
    362       const size_t *region,
    363       size_t input_row_pitch,
    364       size_t input_slice_pitch,
    365       const void *ptr,
    366       cl_uint num_events_in_wait_list,
    367       const cl_event *event_wait_list,
    368       cl_event *event);
    369 
    370    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyImage)(
    371       cl_command_queue command_queue,
    372       cl_mem src_image,
    373       cl_mem dst_image,
    374       const size_t *src_origin,
    375       const size_t *dst_origin,
    376       const size_t *region,
    377       cl_uint num_events_in_wait_list,
    378       const cl_event *event_wait_list,
    379       cl_event *event);
    380 
    381    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyImageToBuffer)(
    382       cl_command_queue command_queue,
    383       cl_mem src_image,
    384       cl_mem dst_buffer,
    385       const size_t *src_origin,
    386       const size_t *region,
    387       size_t dst_offset,
    388       cl_uint num_events_in_wait_list,
    389       const cl_event *event_wait_list,
    390       cl_event *event);
    391 
    392    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBufferToImage)(
    393       cl_command_queue command_queue,
    394       cl_mem src_buffer,
    395       cl_mem dst_image,
    396       size_t src_offset,
    397       const size_t *dst_origin,
    398       const size_t *region,
    399       cl_uint num_events_in_wait_list,
    400       const cl_event *event_wait_list,
    401       cl_event *event);
    402 
    403    CL_API_ENTRY void *(CL_API_CALL *clEnqueueMapBuffer)(
    404       cl_command_queue command_queue,
    405       cl_mem buffer,
    406       cl_bool blocking_map,
    407       cl_map_flags map_flags,
    408       size_t offset,
    409       size_t cb,
    410       cl_uint num_events_in_wait_list,
    411       const cl_event *event_wait_list,
    412       cl_event *event,
    413       cl_int *errcode_ret);
    414 
    415    CL_API_ENTRY void *(CL_API_CALL *clEnqueueMapImage)(
    416       cl_command_queue command_queue,
    417       cl_mem image,
    418       cl_bool blocking_map,
    419       cl_map_flags map_flags,
    420       const size_t *origin,
    421       const size_t *region,
    422       size_t *image_row_pitch,
    423       size_t *image_slice_pitch,
    424       cl_uint num_events_in_wait_list,
    425       const cl_event *event_wait_list,
    426       cl_event *event,
    427       cl_int *errcode_ret);
    428 
    429    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueUnmapMemObject)(
    430       cl_command_queue command_queue,
    431       cl_mem memobj,
    432       void *mapped_ptr,
    433       cl_uint num_events_in_wait_list,
    434       const cl_event *event_wait_list,
    435       cl_event *event);
    436 
    437    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueNDRangeKernel)(
    438       cl_command_queue command_queue,
    439       cl_kernel kernel,
    440       cl_uint work_dim,
    441       const size_t *global_work_offset,
    442       const size_t *global_work_size,
    443       const size_t *local_work_size,
    444       cl_uint num_events_in_wait_list,
    445       const cl_event *event_wait_list,
    446       cl_event *event);
    447 
    448    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueTask)(
    449       cl_command_queue command_queue,
    450       cl_kernel kernel,
    451       cl_uint num_events_in_wait_list,
    452       const cl_event *event_wait_list,
    453       cl_event *event);
    454 
    455    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueNativeKernel)(
    456       cl_command_queue command_queue,
    457       void (CL_CALLBACK *user_func)(void *),
    458       void *args,
    459       size_t cb_args,
    460       cl_uint num_mem_objects,
    461       const cl_mem *mem_list,
    462       const void **args_mem_loc,
    463       cl_uint num_events_in_wait_list,
    464       const cl_event *event_wait_list,
    465       cl_event *event);
    466 
    467    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMarker)(
    468       cl_command_queue command_queue,
    469       cl_event *event);
    470 
    471    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWaitForEvents)(
    472       cl_command_queue command_queue,
    473       cl_uint num_events,
    474       const cl_event *event_list);
    475 
    476    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueBarrier)(
    477       cl_command_queue command_queue);
    478 
    479    CL_API_ENTRY void *(CL_API_CALL *clGetExtensionFunctionAddress)(
    480       const char *function_name);
    481 
    482    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLBuffer)(
    483       cl_context context,
    484       cl_mem_flags flags,
    485       cl_GLuint bufobj,
    486       int *errcode_ret);
    487 
    488    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexture2D)(
    489       cl_context context,
    490       cl_mem_flags flags,
    491       cl_GLenum target,
    492       cl_GLint miplevel,
    493       cl_GLuint texture,
    494       cl_int *errcode_ret);
    495 
    496    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexture3D)(
    497       cl_context context,
    498       cl_mem_flags flags,
    499       cl_GLenum target,
    500       cl_GLint miplevel,
    501       cl_GLuint texture,
    502       cl_int *errcode_ret);
    503 
    504    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLRenderbuffer)(
    505       cl_context context,
    506       cl_mem_flags flags,
    507       cl_GLuint renderbuffer,
    508       cl_int *errcode_ret);
    509 
    510    CL_API_ENTRY cl_int (CL_API_CALL *clGetGLObjectInfo)(
    511       cl_mem memobj,
    512       cl_gl_object_type *gl_object_type,
    513       cl_GLuint *gl_object_name);
    514 
    515    CL_API_ENTRY cl_int (CL_API_CALL *clGetGLTextureInfo)(
    516       cl_mem memobj,
    517       cl_gl_texture_info param_name,
    518       size_t param_value_size,
    519       void *param_value,
    520       size_t *param_value_size_ret);
    521 
    522    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireGLObjects)(
    523       cl_command_queue command_queue,
    524       cl_uint num_objects,
    525       const cl_mem *mem_objects,
    526       cl_uint num_events_in_wait_list,
    527       const cl_event *event_wait_list,
    528       cl_event *event);
    529 
    530    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseGLObjects)(
    531       cl_command_queue command_queue,
    532       cl_uint num_objects,
    533       const cl_mem *mem_objects,
    534       cl_uint num_events_in_wait_list,
    535       const cl_event *event_wait_list,
    536       cl_event *event);
    537 
    538    CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR)(
    539       const cl_context_properties *properties,
    540       cl_gl_context_info param_name,
    541       size_t param_value_size,
    542       void *param_value,
    543       size_t *param_value_size_ret);
    544 
    545    void *clGetDeviceIDsFromD3D10KHR;
    546    void *clCreateFromD3D10BufferKHR;
    547    void *clCreateFromD3D10Texture2DKHR;
    548    void *clCreateFromD3D10Texture3DKHR;
    549    void *clEnqueueAcquireD3D10ObjectsKHR;
    550    void *clEnqueueReleaseD3D10ObjectsKHR;
    551 
    552    CL_API_ENTRY cl_int (CL_API_CALL *clSetEventCallback)(
    553       cl_event event,
    554       cl_int type,
    555       void (CL_CALLBACK *pfn_notify)(cl_event, cl_int, void *),
    556       void *user_data);
    557 
    558    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateSubBuffer)(
    559       cl_mem                   buffer,
    560       cl_mem_flags             flags,
    561       cl_buffer_create_type    buffer_create_type,
    562       const void *buffer_create_info,
    563       cl_int *errcode_ret);
    564 
    565    CL_API_ENTRY cl_int (CL_API_CALL *clSetMemObjectDestructorCallback)(
    566       cl_mem memobj,
    567       void (CL_CALLBACK *pfn_notify)(cl_mem, void *),
    568       void *user_data);
    569 
    570    CL_API_ENTRY cl_event (CL_API_CALL *clCreateUserEvent)(
    571       cl_context context,
    572       cl_int *errcode_ret);
    573 
    574    CL_API_ENTRY cl_int (CL_API_CALL *clSetUserEventStatus)(
    575       cl_event event,
    576       cl_int status);
    577 
    578    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReadBufferRect)(
    579       cl_command_queue command_queue,
    580       cl_mem buffer,
    581       cl_bool blocking_read,
    582       const size_t *buffer_origin,
    583       const size_t *host_origin,
    584       const size_t *region,
    585       size_t buffer_row_pitch,
    586       size_t buffer_slice_pitch,
    587       size_t host_row_pitch,
    588       size_t host_slice_pitch,
    589       void *ptr,
    590       cl_uint num_events_in_wait_list,
    591       const cl_event *event_wait_list,
    592       cl_event *event);
    593 
    594    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueWriteBufferRect)(
    595       cl_command_queue command_queue,
    596       cl_mem buffer,
    597       cl_bool blocking_read,
    598       const size_t *buffer_origin,
    599       const size_t *host_origin,
    600       const size_t *region,
    601       size_t buffer_row_pitch,
    602       size_t buffer_slice_pitch,
    603       size_t host_row_pitch,
    604       size_t host_slice_pitch,
    605       const void *ptr,
    606       cl_uint num_events_in_wait_list,
    607       const cl_event *event_wait_list,
    608       cl_event *event);
    609 
    610    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueCopyBufferRect)(
    611       cl_command_queue command_queue,
    612       cl_mem src_buffer,
    613       cl_mem dst_buffer,
    614       const size_t *src_origin,
    615       const size_t *dst_origin,
    616       const size_t *region,
    617       size_t src_row_pitch,
    618       size_t src_slice_pitch,
    619       size_t dst_row_pitch,
    620       size_t dst_slice_pitch,
    621       cl_uint num_events_in_wait_list,
    622       const cl_event *event_wait_list,
    623       cl_event *event);
    624 
    625    CL_API_ENTRY cl_int (CL_API_CALL *clCreateSubDevicesEXT)(
    626       cl_device_id in_device,
    627       const cl_device_partition_property_ext *partition_properties,
    628       cl_uint num_entries,
    629       cl_device_id *out_devices,
    630       cl_uint *num_devices);
    631 
    632    CL_API_ENTRY cl_int (CL_API_CALL *clRetainDeviceEXT)(
    633       cl_device_id device);
    634 
    635    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseDeviceEXT)(
    636       cl_device_id device);
    637 
    638    CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromGLsyncKHR)(
    639       cl_context context,
    640       cl_GLsync sync,
    641       cl_int *errcode_ret);
    642 
    643     CL_API_ENTRY cl_int (CL_API_CALL *clCreateSubDevices)(
    644        cl_device_id in_device,
    645        const cl_device_partition_property *partition_properties,
    646        cl_uint num_entries,
    647        cl_device_id *out_devices,
    648        cl_uint *num_devices);
    649 
    650    CL_API_ENTRY cl_int (CL_API_CALL *clRetainDevice)(
    651       cl_device_id device);
    652 
    653    CL_API_ENTRY cl_int (CL_API_CALL *clReleaseDevice)(
    654       cl_device_id device);
    655 
    656    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImage)(
    657       cl_context context,
    658       cl_mem_flags flags,
    659       const cl_image_format *image_format,
    660       const cl_image_desc *image_desc,
    661       void *host_ptr,
    662       cl_int *errcode_ret);
    663 
    664    CL_API_ENTRY cl_program (CL_API_CALL *clCreateProgramWithBuiltInKernels)(
    665       cl_context context,
    666       cl_uint num_devices,
    667       const cl_device_id *device_list,
    668       const char *kernel_names,
    669       cl_int *errcode_ret);
    670 
    671    CL_API_ENTRY cl_int (CL_API_CALL *clCompileProgram)(
    672       cl_program program,
    673       cl_uint num_devices,
    674       const cl_device_id *device_list,
    675       const char *options,
    676       cl_uint num_input_headers,
    677       const cl_program *input_headers,
    678       const char **header_include_names,
    679       void (CL_CALLBACK *pfn_notify)(cl_program, void *),
    680       void *user_data);
    681 
    682    CL_API_ENTRY cl_program (CL_API_CALL *clLinkProgram)(
    683       cl_context context,
    684       cl_uint num_devices,
    685       const cl_device_id *device_list,
    686       const char *options,
    687       cl_uint num_input_programs,
    688       const cl_program *input_programs,
    689       void (CL_CALLBACK *pfn_notify)(cl_program, void *),
    690       void *user_data,
    691       cl_int *errcode_ret);
    692 
    693    CL_API_ENTRY cl_int (CL_API_CALL *clUnloadPlatformCompiler)(
    694       cl_platform_id platform);
    695 
    696    CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelArgInfo)(
    697       cl_kernel kernel,
    698       cl_uint arg_indx,
    699       cl_kernel_arg_info  param_name,
    700       size_t param_value_size,
    701       void *param_value,
    702       size_t *param_value_size_ret);
    703 
    704    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueFillBuffer)(
    705       cl_command_queue command_queue,
    706       cl_mem buffer,
    707       const void *pattern,
    708       size_t pattern_size,
    709       size_t offset,
    710       size_t size,
    711       cl_uint num_events_in_wait_list,
    712       const cl_event *event_wait_list,
    713       cl_event *event);
    714 
    715    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueFillImage)(
    716       cl_command_queue command_queue,
    717       cl_mem image,
    718       const void *fill_color,
    719       const size_t *origin,
    720       const size_t *region,
    721       cl_uint num_events_in_wait_list,
    722       const cl_event *event_wait_list,
    723       cl_event *event);
    724 
    725    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMigrateMemObjects)(
    726       cl_command_queue command_queue,
    727       cl_uint num_mem_objects,
    728       const cl_mem *mem_objects,
    729       cl_mem_migration_flags flags,
    730       cl_uint num_events_in_wait_list,
    731       const cl_event *event_wait_list,
    732       cl_event *event);
    733 
    734    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueMarkerWithWaitList)(
    735       cl_command_queue command_queue,
    736       cl_uint num_events_in_wait_list,
    737       const cl_event *event_wait_list,
    738       cl_event *event);
    739 
    740    CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueBarrierWithWaitList)(
    741       cl_command_queue command_queue,
    742       cl_uint num_events_in_wait_list,
    743       const cl_event *event_wait_list,
    744       cl_event *event);
    745 
    746    CL_API_ENTRY void *(CL_API_CALL *clGetExtensionFunctionAddressForPlatform)(
    747       cl_platform_id platform,
    748       const char *function_name);
    749 
    750    CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromGLTexture)(
    751       cl_context context,
    752       cl_mem_flags flags,
    753       cl_GLenum target,
    754       cl_GLint miplevel,
    755       cl_GLuint texture,
    756       cl_int *errcode_ret);
    757 
    758    void *clGetDeviceIDsFromD3D11KHR;
    759    void *clCreateFromD3D11BufferKHR;
    760    void *clCreateFromD3D11Texture2DKHR;
    761    void *clCreateFromD3D11Texture3DKHR;
    762    void *clCreateFromDX9MediaSurfaceKHR;
    763    void *clEnqueueAcquireD3D11ObjectsKHR;
    764    void *clEnqueueReleaseD3D11ObjectsKHR;
    765    void *clGetDeviceIDsFromDX9MediaAdapterKHR;
    766    void *clEnqueueAcquireDX9MediaSurfacesKHR;
    767    void *clEnqueueReleaseDX9MediaSurfacesKHR;
    768 };
    769 
    770 namespace clover {
    771    extern const _cl_icd_dispatch _dispatch;
    772 
    773    cl_int
    774    GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
    775                    size_t size, void *r_buf, size_t *r_size);
    776 
    777    void *
    778    GetExtensionFunctionAddress(const char *p_name);
    779 
    780    void *
    781    GetExtensionFunctionAddressForPlatform(cl_platform_id d_platform,
    782                                           const char *p_name);
    783 
    784    cl_int
    785    IcdGetPlatformIDsKHR(cl_uint num_entries, cl_platform_id *rd_platforms,
    786                         cl_uint *rnum_platforms);
    787 }
    788 
    789 #endif
    790