2 // Copyright 2013 Francisco Jerez
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:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
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.
23 #ifndef API_DISPATCH_HPP
24 #define API_DISPATCH_HPP
27 #include "CL/cl_ext.h"
28 #include "CL/cl_egl.h"
30 #include "CL/cl_icd.h"
33 extern const cl_icd_dispatch _dispatch;
36 GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
37 size_t size, void *r_buf, size_t *r_size);
40 GetExtensionFunctionAddress(const char *p_name);
43 GetExtensionFunctionAddressForPlatform(cl_platform_id d_platform,
47 IcdGetPlatformIDsKHR(cl_uint num_entries, cl_platform_id *rd_platforms,
48 cl_uint *rnum_platforms);
51 EnqueueSVMFree(cl_command_queue command_queue,
52 cl_uint num_svm_pointers,
54 void (CL_CALLBACK *pfn_free_func) (
55 cl_command_queue queue, cl_uint num_svm_pointers,
56 void *svm_pointers[], void *user_data),
58 cl_uint num_events_in_wait_list,
59 const cl_event *event_wait_list,
64 EnqueueSVMMemcpy(cl_command_queue command_queue,
65 cl_bool blocking_copy,
69 cl_uint num_events_in_wait_list,
70 const cl_event *event_wait_list,
75 EnqueueSVMMap(cl_command_queue command_queue,
77 cl_map_flags map_flags,
80 cl_uint num_events_in_wait_list,
81 const cl_event *event_wait_list,
86 EnqueueSVMMemFill(cl_command_queue command_queue,
91 cl_uint num_events_in_wait_list,
92 const cl_event *event_wait_list,
97 EnqueueSVMUnmap(cl_command_queue command_queue,
99 cl_uint num_events_in_wait_list,
100 const cl_event *event_wait_list,