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 #include "api/dispatch.hpp"
24 
25 namespace clover {
26    const cl_icd_dispatch _dispatch = {
27       // OpenCL 1.0
28       clGetPlatformIDs,
29       GetPlatformInfo,
30       clGetDeviceIDs,
31       clGetDeviceInfo,
32       clCreateContext,
33       clCreateContextFromType,
34       clRetainContext,
35       clReleaseContext,
36       clGetContextInfo,
37       clCreateCommandQueue,
38       clRetainCommandQueue,
39       clReleaseCommandQueue,
40       clGetCommandQueueInfo,
41       NULL, // clSetCommandQueueProperty
42       clCreateBuffer,
43       clCreateImage2D,
44       clCreateImage3D,
45       clRetainMemObject,
46       clReleaseMemObject,
47       clGetSupportedImageFormats,
48       clGetMemObjectInfo,
49       clGetImageInfo,
50       clCreateSampler,
51       clRetainSampler,
52       clReleaseSampler,
53       clGetSamplerInfo,
54       clCreateProgramWithSource,
55       clCreateProgramWithBinary,
56       clRetainProgram,
57       clReleaseProgram,
58       clBuildProgram,
59       clUnloadCompiler,
60       clGetProgramInfo,
61       clGetProgramBuildInfo,
62       clCreateKernel,
63       clCreateKernelsInProgram,
64       clRetainKernel,
65       clReleaseKernel,
66       clSetKernelArg,
67       clGetKernelInfo,
68       clGetKernelWorkGroupInfo,
69       clWaitForEvents,
70       clGetEventInfo,
71       clRetainEvent,
72       clReleaseEvent,
73       clGetEventProfilingInfo,
74       clFlush,
75       clFinish,
76       clEnqueueReadBuffer,
77       clEnqueueWriteBuffer,
78       clEnqueueCopyBuffer,
79       clEnqueueReadImage,
80       clEnqueueWriteImage,
81       clEnqueueCopyImage,
82       clEnqueueCopyImageToBuffer,
83       clEnqueueCopyBufferToImage,
84       clEnqueueMapBuffer,
85       clEnqueueMapImage,
86       clEnqueueUnmapMemObject,
87       clEnqueueNDRangeKernel,
88       clEnqueueTask,
89       clEnqueueNativeKernel,
90       clEnqueueMarker,
91       clEnqueueWaitForEvents,
92       clEnqueueBarrier,
93       GetExtensionFunctionAddress,
94       NULL, // clCreateFromGLBuffer
95       NULL, // clCreateFromGLTexture2D
96       NULL, // clCreateFromGLTexture3D
97       NULL, // clCreateFromGLRenderbuffer
98       NULL, // clGetGLObjectInfo
99       NULL, // clGetGLTextureInfo
100       NULL, // clEnqueueAcquireGLObjects
101       NULL, // clEnqueueReleaseGLObjects
102 
103       // cl_khr_d3d10_sharing
104       NULL, // clGetGLContextInfoKHR
105       NULL, // clGetDeviceIDsFromD3D10KHR
106       NULL, // clCreateFromD3D10BufferKHR
107       NULL, // clCreateFromD3D10Texture2DKHR
108       NULL, // clCreateFromD3D10Texture3DKHR
109       NULL, // clEnqueueAcquireD3D10ObjectsKHR
110       NULL, // clEnqueueReleaseD3D10ObjectsKHR
111 
112       // OpenCL 1.1
113       clSetEventCallback,
114       clCreateSubBuffer,
115       clSetMemObjectDestructorCallback,
116       clCreateUserEvent,
117       clSetUserEventStatus,
118       clEnqueueReadBufferRect,
119       clEnqueueWriteBufferRect,
120       clEnqueueCopyBufferRect,
121 
122       // cl_ext_device_fission
123       NULL, // clCreateSubDevicesEXT
124       NULL, // clRetainDeviceEXT
125       NULL, // clReleaseDeviceEXT
126 
127       // cl_khr_gl_event
128       NULL, // clCreateEventFromGLsyncKHR
129 
130       // OpenCL 1.2
131       clCreateSubDevices,
132       clRetainDevice,
133       clReleaseDevice,
134       clCreateImage,
135       clCreateProgramWithBuiltInKernels,
136       clCompileProgram,
137       clLinkProgram,
138       clUnloadPlatformCompiler,
139       clGetKernelArgInfo,
140       clEnqueueFillBuffer,
141       clEnqueueFillImage,
142       clEnqueueMigrateMemObjects,
143       clEnqueueMarkerWithWaitList,
144       clEnqueueBarrierWithWaitList,
145       GetExtensionFunctionAddressForPlatform,
146       NULL, // clCreateFromGLTexture
147 
148       // cl_khr_d3d11_sharing
149       NULL, // clGetDeviceIDsFromD3D11KHR
150       NULL, // clCreateFromD3D11BufferKHR
151       NULL, // clCreateFromD3D11Texture2DKHR
152       NULL, // clCreateFromD3D11Texture3DKHR
153       NULL, // clCreateFromDX9MediaSurfaceKHR
154       NULL, // clEnqueueAcquireD3D11ObjectsKHR
155       NULL, // clEnqueueReleaseD3D11ObjectsKHR
156 
157       // cl_khr_dx9_media_sharing
158       NULL, // clGetDeviceIDsFromDX9MediaAdapterKHR
159       NULL, // clEnqueueAcquireDX9MediaSurfacesKHR
160       NULL, // clEnqueueReleaseDX9MediaSurfacesKHR
161 
162       // cl_khr_egl_image
163       NULL, // clCreateFromEGLImageKHR
164       NULL, // clEnqueueAcquireEGLObjectsKHR
165       NULL, // clEnqueueReleaseEGLObjectsKHR
166 
167       // cl_khr_egl_event
168       NULL, // clCreateEventFromEGLSyncKHR
169 
170       // OpenCL 2.0
171       clCreateCommandQueueWithProperties,
172       clCreatePipe,
173       clGetPipeInfo,
174       clSVMAlloc,
175       clSVMFree,
176       clEnqueueSVMFree,
177       clEnqueueSVMMemcpy,
178       clEnqueueSVMMemFill,
179       clEnqueueSVMMap,
180       clEnqueueSVMUnmap,
181       NULL, // clCreateSamplerWithProperties
182       clSetKernelArgSVMPointer,
183       clSetKernelExecInfo,
184 
185       // cl_khr_sub_groups
186       NULL, // clGetKernelSubGroupInfoKHR
187 
188       // OpenCL 2.1
189       NULL, // clCloneKernel
190       clCreateProgramWithIL,
191       clEnqueueSVMMigrateMem,
192       clGetDeviceAndHostTimer,
193       clGetHostTimer,
194       clGetKernelSubGroupInfo,
195       clSetDefaultDeviceCommandQueue,
196 
197       // OpenCL 2.2
198       clSetProgramReleaseCallback,
199       clSetProgramSpecializationConstant,
200       clCreateBufferWithProperties,
201       clCreateImageWithProperties,
202       clSetContextDestructorCallback
203    };
204 }
205