hessml-ffi-opencl 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/interfaces/cl.h ADDED
@@ -0,0 +1,866 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2008-2009 The Khronos Group Inc.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a
5
+ * copy of this software and/or associated documentation files (the
6
+ * "Materials"), to deal in the Materials without restriction, including
7
+ * without limitation the rights to use, copy, modify, merge, publish,
8
+ * distribute, sublicense, and/or sell copies of the Materials, and to
9
+ * permit persons to whom the Materials are furnished to do so, subject to
10
+ * the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included
13
+ * in all copies or substantial portions of the Materials.
14
+ *
15
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22
+ ******************************************************************************/
23
+
24
+ #ifndef __OPENCL_CL_H
25
+ #define __OPENCL_CL_H
26
+
27
+ #ifdef __APPLE__
28
+ #include <OpenCL/cl_platform.h>
29
+ #else
30
+ #include <cl_platform.h>
31
+ // #include <CL/cl_platform.h>
32
+ #endif
33
+
34
+ #ifdef __cplusplus
35
+ extern "C" {
36
+ #endif
37
+
38
+ /******************************************************************************/
39
+
40
+ typedef struct _cl_platform_id * cl_platform_id;
41
+ typedef struct _cl_device_id * cl_device_id;
42
+ typedef struct _cl_context * cl_context;
43
+ typedef struct _cl_command_queue * cl_command_queue;
44
+ typedef struct _cl_mem * cl_mem;
45
+ typedef struct _cl_program * cl_program;
46
+ typedef struct _cl_kernel * cl_kernel;
47
+ typedef struct _cl_event * cl_event;
48
+ typedef struct _cl_sampler * cl_sampler;
49
+
50
+ typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */
51
+ typedef cl_ulong cl_bitfield;
52
+ typedef cl_bitfield cl_device_type;
53
+ typedef cl_uint cl_platform_info;
54
+ typedef cl_uint cl_device_info;
55
+ typedef cl_bitfield cl_device_address_info;
56
+ typedef cl_bitfield cl_device_fp_config;
57
+ typedef cl_uint cl_device_mem_cache_type;
58
+ typedef cl_uint cl_device_local_mem_type;
59
+ typedef cl_bitfield cl_device_exec_capabilities;
60
+ typedef cl_bitfield cl_command_queue_properties;
61
+
62
+ typedef intptr_t cl_context_properties;
63
+ typedef cl_uint cl_context_info;
64
+ typedef cl_uint cl_command_queue_info;
65
+ typedef cl_uint cl_channel_order;
66
+ typedef cl_uint cl_channel_type;
67
+ typedef cl_bitfield cl_mem_flags;
68
+ typedef cl_uint cl_mem_object_type;
69
+ typedef cl_uint cl_mem_info;
70
+ typedef cl_uint cl_image_info;
71
+ typedef cl_uint cl_addressing_mode;
72
+ typedef cl_uint cl_filter_mode;
73
+ typedef cl_uint cl_sampler_info;
74
+ typedef cl_bitfield cl_map_flags;
75
+ typedef cl_uint cl_program_info;
76
+ typedef cl_uint cl_program_build_info;
77
+ typedef cl_int cl_build_status;
78
+ typedef cl_uint cl_kernel_info;
79
+ typedef cl_uint cl_kernel_work_group_info;
80
+ typedef cl_uint cl_event_info;
81
+ typedef cl_uint cl_command_type;
82
+ typedef cl_uint cl_profiling_info;
83
+
84
+ typedef struct _cl_image_format {
85
+ cl_channel_order image_channel_order;
86
+ cl_channel_type image_channel_data_type;
87
+ } cl_image_format;
88
+
89
+ /******************************************************************************/
90
+
91
+ // Error Codes
92
+ #define CL_SUCCESS 0
93
+ #define CL_DEVICE_NOT_FOUND -1
94
+ #define CL_DEVICE_NOT_AVAILABLE -2
95
+ #define CL_DEVICE_COMPILER_NOT_AVAILABLE -3
96
+ #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
97
+ #define CL_OUT_OF_RESOURCES -5
98
+ #define CL_OUT_OF_HOST_MEMORY -6
99
+ #define CL_PROFILING_INFO_NOT_AVAILABLE -7
100
+ #define CL_MEM_COPY_OVERLAP -8
101
+ #define CL_IMAGE_FORMAT_MISMATCH -9
102
+ #define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
103
+ #define CL_BUILD_PROGRAM_FAILURE -11
104
+ #define CL_MAP_FAILURE -12
105
+
106
+ #define CL_INVALID_VALUE -30
107
+ #define CL_INVALID_DEVICE_TYPE -31
108
+ #define CL_INVALID_PLATFORM -32
109
+ #define CL_INVALID_DEVICE -33
110
+ #define CL_INVALID_CONTEXT -34
111
+ #define CL_INVALID_QUEUE_PROPERTIES -35
112
+ #define CL_INVALID_COMMAND_QUEUE -36
113
+ #define CL_INVALID_HOST_PTR -37
114
+ #define CL_INVALID_MEM_OBJECT -38
115
+ #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
116
+ #define CL_INVALID_IMAGE_SIZE -40
117
+ #define CL_INVALID_SAMPLER -41
118
+ #define CL_INVALID_BINARY -42
119
+ #define CL_INVALID_BUILD_OPTIONS -43
120
+ #define CL_INVALID_PROGRAM -44
121
+ #define CL_INVALID_PROGRAM_EXECUTABLE -45
122
+ #define CL_INVALID_KERNEL_NAME -46
123
+ #define CL_INVALID_KERNEL_DEFINITION -47
124
+ #define CL_INVALID_KERNEL -48
125
+ #define CL_INVALID_ARG_INDEX -49
126
+ #define CL_INVALID_ARG_VALUE -50
127
+ #define CL_INVALID_ARG_SIZE -51
128
+ #define CL_INVALID_KERNEL_ARGS -52
129
+ #define CL_INVALID_WORK_DIMENSION -53
130
+ #define CL_INVALID_WORK_GROUP_SIZE -54
131
+ #define CL_INVALID_WORK_ITEM_SIZE -55
132
+ #define CL_INVALID_GLOBAL_OFFSET -56
133
+ #define CL_INVALID_EVENT_WAIT_LIST -57
134
+ #define CL_INVALID_EVENT -58
135
+ #define CL_INVALID_OPERATION -59
136
+ #define CL_INVALID_GL_OBJECT -60
137
+ #define CL_INVALID_BUFFER_SIZE -61
138
+ #define CL_INVALID_MIP_LEVEL -62
139
+
140
+ // OpenCL Version
141
+ #define CL_VERSION_1_0 1
142
+
143
+ // cl_bool
144
+ #define CL_FALSE 0
145
+ #define CL_TRUE 1
146
+
147
+ // cl_platform_info
148
+ #define CL_PLATFORM_PROFILE 0x0900
149
+ #define CL_PLATFORM_VERSION 0x0901
150
+ #define CL_PLATFORM_NAME 0x0902
151
+ #define CL_PLATFORM_VENDOR 0x0903
152
+ #define CL_PLATFORM_EXTENSIONS 0x0904
153
+
154
+ // cl_device_type - bitfield
155
+ #define CL_DEVICE_TYPE_DEFAULT (1 << 0)
156
+ #define CL_DEVICE_TYPE_CPU (1 << 1)
157
+ #define CL_DEVICE_TYPE_GPU (1 << 2)
158
+ #define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
159
+ #define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
160
+
161
+ // cl_device_info
162
+ #define CL_DEVICE_TYPE 0x1000
163
+ #define CL_DEVICE_VENDOR_ID 0x1001
164
+ #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
165
+ #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
166
+ #define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
167
+ #define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
168
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
169
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
170
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
171
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
172
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
173
+ #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
174
+ #define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
175
+ #define CL_DEVICE_ADDRESS_BITS 0x100D
176
+ #define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
177
+ #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
178
+ #define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
179
+ #define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
180
+ #define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
181
+ #define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
182
+ #define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
183
+ #define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
184
+ #define CL_DEVICE_IMAGE_SUPPORT 0x1016
185
+ #define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
186
+ #define CL_DEVICE_MAX_SAMPLERS 0x1018
187
+ #define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
188
+ #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
189
+ #define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
190
+ #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
191
+ #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
192
+ #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
193
+ #define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
194
+ #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
195
+ #define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
196
+ #define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
197
+ #define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
198
+ #define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
199
+ #define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
200
+ #define CL_DEVICE_ENDIAN_LITTLE 0x1026
201
+ #define CL_DEVICE_AVAILABLE 0x1027
202
+ #define CL_DEVICE_COMPILER_AVAILABLE 0x1028
203
+ #define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
204
+ #define CL_DEVICE_QUEUE_PROPERTIES 0x102A
205
+ #define CL_DEVICE_NAME 0x102B
206
+ #define CL_DEVICE_VENDOR 0x102C
207
+ #define CL_DRIVER_VERSION 0x102D
208
+ #define CL_DEVICE_PROFILE 0x102E
209
+ #define CL_DEVICE_VERSION 0x102F
210
+ #define CL_DEVICE_EXTENSIONS 0x1030
211
+ #define CL_DEVICE_PLATFORM 0x1031
212
+
213
+ // cl_device_address_info - bitfield
214
+ #define CL_DEVICE_ADDRESS_32_BITS (1 << 0)
215
+ #define CL_DEVICE_ADDRESS_64_BITS (1 << 1)
216
+
217
+ // cl_device_fp_config - bitfield
218
+ #define CL_FP_DENORM (1 << 0)
219
+ #define CL_FP_INF_NAN (1 << 1)
220
+ #define CL_FP_ROUND_TO_NEAREST (1 << 2)
221
+ #define CL_FP_ROUND_TO_ZERO (1 << 3)
222
+ #define CL_FP_ROUND_TO_INF (1 << 4)
223
+ #define CL_FP_FMA (1 << 5)
224
+
225
+ // cl_device_mem_cache_type
226
+ #define CL_NONE 0x0
227
+ #define CL_READ_ONLY_CACHE 0x1
228
+ #define CL_READ_WRITE_CACHE 0x2
229
+
230
+ // cl_device_local_mem_type
231
+ #define CL_LOCAL 0x1
232
+ #define CL_GLOBAL 0x2
233
+
234
+ // cl_device_exec_capabilities - bitfield
235
+ #define CL_EXEC_KERNEL (1 << 0)
236
+ #define CL_EXEC_NATIVE_KERNEL (1 << 1)
237
+
238
+ // cl_command_queue_properties - bitfield
239
+ #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
240
+ #define CL_QUEUE_PROFILING_ENABLE (1 << 1)
241
+
242
+ // cl_context_info
243
+ #define CL_CONTEXT_REFERENCE_COUNT 0x1080
244
+ #define CL_CONTEXT_NUM_DEVICES 0x1081
245
+ #define CL_CONTEXT_DEVICES 0x1082
246
+ #define CL_CONTEXT_PROPERTIES 0x1083
247
+ #define CL_CONTEXT_PLATFORM 0x1084
248
+
249
+ // cl_command_queue_info
250
+ #define CL_QUEUE_CONTEXT 0x1090
251
+ #define CL_QUEUE_DEVICE 0x1091
252
+ #define CL_QUEUE_REFERENCE_COUNT 0x1092
253
+ #define CL_QUEUE_PROPERTIES 0x1093
254
+
255
+ // cl_mem_flags - bitfield
256
+ #define CL_MEM_READ_WRITE (1 << 0)
257
+ #define CL_MEM_WRITE_ONLY (1 << 1)
258
+ #define CL_MEM_READ_ONLY (1 << 2)
259
+ #define CL_MEM_USE_HOST_PTR (1 << 3)
260
+ #define CL_MEM_ALLOC_HOST_PTR (1 << 4)
261
+ #define CL_MEM_COPY_HOST_PTR (1 << 5)
262
+
263
+ // cl_channel_order
264
+ #define CL_R 0x10B0
265
+ #define CL_A 0x10B1
266
+ #define CL_RG 0x10B2
267
+ #define CL_RA 0x10B3
268
+ #define CL_RGB 0x10B4
269
+ #define CL_RGBA 0x10B5
270
+ #define CL_BGRA 0x10B6
271
+ #define CL_ARGB 0x10B7
272
+ #define CL_INTENSITY 0x10B8
273
+ #define CL_LUMINANCE 0x10B9
274
+
275
+ // cl_channel_type
276
+ #define CL_SNORM_INT8 0x10D0
277
+ #define CL_SNORM_INT16 0x10D1
278
+ #define CL_UNORM_INT8 0x10D2
279
+ #define CL_UNORM_INT16 0x10D3
280
+ #define CL_UNORM_SHORT_565 0x10D4
281
+ #define CL_UNORM_SHORT_555 0x10D5
282
+ #define CL_UNORM_INT_101010 0x10D6
283
+ #define CL_SIGNED_INT8 0x10D7
284
+ #define CL_SIGNED_INT16 0x10D8
285
+ #define CL_SIGNED_INT32 0x10D9
286
+ #define CL_UNSIGNED_INT8 0x10DA
287
+ #define CL_UNSIGNED_INT16 0x10DB
288
+ #define CL_UNSIGNED_INT32 0x10DC
289
+ #define CL_HALF_FLOAT 0x10DD
290
+ #define CL_FLOAT 0x10DE
291
+
292
+ // cl_mem_object_type
293
+ #define CL_MEM_OBJECT_BUFFER 0x10F0
294
+ #define CL_MEM_OBJECT_IMAGE2D 0x10F1
295
+ #define CL_MEM_OBJECT_IMAGE3D 0x10F2
296
+
297
+ // cl_mem_info
298
+ #define CL_MEM_TYPE 0x1100
299
+ #define CL_MEM_FLAGS 0x1101
300
+ #define CL_MEM_SIZE 0x1102
301
+ #define CL_MEM_HOST_PTR 0x1103
302
+ #define CL_MEM_MAP_COUNT 0x1104
303
+ #define CL_MEM_REFERENCE_COUNT 0x1105
304
+ #define CL_MEM_CONTEXT 0x1106
305
+
306
+ // cl_image_info
307
+ #define CL_IMAGE_FORMAT 0x1110
308
+ #define CL_IMAGE_ELEMENT_SIZE 0x1111
309
+ #define CL_IMAGE_ROW_PITCH 0x1112
310
+ #define CL_IMAGE_SLICE_PITCH 0x1113
311
+ #define CL_IMAGE_WIDTH 0x1114
312
+ #define CL_IMAGE_HEIGHT 0x1115
313
+ #define CL_IMAGE_DEPTH 0x1116
314
+
315
+ // cl_addressing_mode
316
+ #define CL_ADDRESS_NONE 0x1130
317
+ #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
318
+ #define CL_ADDRESS_CLAMP 0x1132
319
+ #define CL_ADDRESS_REPEAT 0x1133
320
+
321
+ // cl_filter_mode
322
+ #define CL_FILTER_NEAREST 0x1140
323
+ #define CL_FILTER_LINEAR 0x1141
324
+
325
+ // cl_sampler_info
326
+ #define CL_SAMPLER_REFERENCE_COUNT 0x1150
327
+ #define CL_SAMPLER_CONTEXT 0x1151
328
+ #define CL_SAMPLER_NORMALIZED_COORDS 0x1152
329
+ #define CL_SAMPLER_ADDRESSING_MODE 0x1153
330
+ #define CL_SAMPLER_FILTER_MODE 0x1154
331
+
332
+ // cl_map_flags - bitfield
333
+ #define CL_MAP_READ (1 << 0)
334
+ #define CL_MAP_WRITE (1 << 1)
335
+
336
+ // cl_program_info
337
+ #define CL_PROGRAM_REFERENCE_COUNT 0x1160
338
+ #define CL_PROGRAM_CONTEXT 0x1161
339
+ #define CL_PROGRAM_NUM_DEVICES 0x1162
340
+ #define CL_PROGRAM_DEVICES 0x1163
341
+ #define CL_PROGRAM_SOURCE 0x1164
342
+ #define CL_PROGRAM_BINARY_SIZES 0x1165
343
+ #define CL_PROGRAM_BINARIES 0x1166
344
+
345
+ // cl_program_build_info
346
+ #define CL_PROGRAM_BUILD_STATUS 0x1181
347
+ #define CL_PROGRAM_BUILD_OPTIONS 0x1182
348
+ #define CL_PROGRAM_BUILD_LOG 0x1183
349
+
350
+ // cl_build_status
351
+ #define CL_BUILD_SUCCESS 0
352
+ #define CL_BUILD_NONE -1
353
+ #define CL_BUILD_ERROR -2
354
+ #define CL_BUILD_IN_PROGRESS -3
355
+
356
+ // cl_kernel_info
357
+ #define CL_KERNEL_FUNCTION_NAME 0x1190
358
+ #define CL_KERNEL_NUM_ARGS 0x1191
359
+ #define CL_KERNEL_REFERENCE_COUNT 0x1192
360
+ #define CL_KERNEL_CONTEXT 0x1193
361
+ #define CL_KERNEL_PROGRAM 0x1194
362
+
363
+ // cl_kernel_work_group_info
364
+ #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
365
+ #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
366
+ #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
367
+
368
+ // cl_event_info
369
+ #define CL_EVENT_COMMAND_QUEUE 0x11D0
370
+ #define CL_EVENT_COMMAND_TYPE 0x11D1
371
+ #define CL_EVENT_REFERENCE_COUNT 0x11D2
372
+ #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
373
+
374
+ // cl_command_type
375
+ #define CL_COMMAND_NDRANGE_KERNEL 0x11F0
376
+ #define CL_COMMAND_TASK 0x11F1
377
+ #define CL_COMMAND_NATIVE_KERNEL 0x11F2
378
+ #define CL_COMMAND_READ_BUFFER 0x11F3
379
+ #define CL_COMMAND_WRITE_BUFFER 0x11F4
380
+ #define CL_COMMAND_COPY_BUFFER 0x11F5
381
+ #define CL_COMMAND_READ_IMAGE 0x11F6
382
+ #define CL_COMMAND_WRITE_IMAGE 0x11F7
383
+ #define CL_COMMAND_COPY_IMAGE 0x11F8
384
+ #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
385
+ #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
386
+ #define CL_COMMAND_MAP_BUFFER 0x11FB
387
+ #define CL_COMMAND_MAP_IMAGE 0x11FC
388
+ #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
389
+ #define CL_COMMAND_MARKER 0x11FE
390
+ #define CL_COMMAND_WAIT_FOR_EVENTS 0x11FF
391
+ #define CL_COMMAND_BARRIER 0x1200
392
+ #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x1201
393
+ #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1202
394
+
395
+ // command execution status
396
+ #define CL_COMPLETE 0x0
397
+ #define CL_RUNNING 0x1
398
+ #define CL_SUBMITTED 0x2
399
+ #define CL_QUEUED 0x3
400
+
401
+ // cl_profiling_info
402
+ #define CL_PROFILING_COMMAND_QUEUED 0x1280
403
+ #define CL_PROFILING_COMMAND_SUBMIT 0x1281
404
+ #define CL_PROFILING_COMMAND_START 0x1282
405
+ #define CL_PROFILING_COMMAND_END 0x1283
406
+
407
+ /********************************************************************************************************/
408
+
409
+ // Platform API
410
+ extern CL_API_ENTRY cl_int CL_API_CALL
411
+ clGetPlatformIDs(cl_uint /* num_entries */,
412
+ cl_platform_id * /* platforms */,
413
+ cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
414
+
415
+ extern CL_API_ENTRY cl_int CL_API_CALL
416
+ clGetPlatformInfo(cl_platform_id /* platform */,
417
+ cl_platform_info /* param_name */,
418
+ size_t /* param_value_size */,
419
+ void * /* param_value */,
420
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
421
+
422
+ // Device APIs
423
+ extern CL_API_ENTRY cl_int CL_API_CALL
424
+ clGetDeviceIDs(cl_platform_id /* platform */,
425
+ cl_device_type /* device_type */,
426
+ cl_uint /* num_entries */,
427
+ cl_device_id * /* devices */,
428
+ cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
429
+
430
+ extern CL_API_ENTRY cl_int CL_API_CALL
431
+ clGetDeviceInfo(cl_device_id /* device */,
432
+ cl_device_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
+ // Context APIs
438
+ extern CL_API_ENTRY cl_context CL_API_CALL
439
+ clCreateContext(cl_context_properties * /* properties */,
440
+ cl_uint /* num_devices */,
441
+ const cl_device_id * /* devices */,
442
+ void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
443
+ void * /* user_data */,
444
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
445
+
446
+ extern CL_API_ENTRY cl_context CL_API_CALL
447
+ clCreateContextFromType(cl_context_properties * /* properties */,
448
+ cl_device_type /* device_type */,
449
+ void (*pfn_notify)(const char *, const void *, size_t, void *) /* pfn_notify */,
450
+ void * /* user_data */,
451
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
452
+
453
+ extern CL_API_ENTRY cl_int CL_API_CALL
454
+ clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
455
+
456
+ extern CL_API_ENTRY cl_int CL_API_CALL
457
+ clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
458
+
459
+ extern CL_API_ENTRY cl_int CL_API_CALL
460
+ clGetContextInfo(cl_context /* context */,
461
+ cl_context_info /* param_name */,
462
+ size_t /* param_value_size */,
463
+ void * /* param_value */,
464
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
465
+
466
+ // Command Queue APIs
467
+ extern CL_API_ENTRY cl_command_queue CL_API_CALL
468
+ clCreateCommandQueue(cl_context /* context */,
469
+ cl_device_id /* device */,
470
+ cl_command_queue_properties /* properties */,
471
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
472
+
473
+ extern CL_API_ENTRY cl_int CL_API_CALL
474
+ clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
475
+
476
+ extern CL_API_ENTRY cl_int CL_API_CALL
477
+ clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
478
+
479
+ extern CL_API_ENTRY cl_int CL_API_CALL
480
+ clGetCommandQueueInfo(cl_command_queue /* command_queue */,
481
+ cl_command_queue_info /* param_name */,
482
+ size_t /* param_value_size */,
483
+ void * /* param_value */,
484
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
485
+
486
+ extern CL_API_ENTRY cl_int CL_API_CALL
487
+ clSetCommandQueueProperty(cl_command_queue /* command_queue */,
488
+ cl_command_queue_properties /* properties */,
489
+ cl_bool /* enable */,
490
+ cl_command_queue_properties * /* old_properties */) CL_API_SUFFIX__VERSION_1_0;
491
+
492
+ // Memory Object APIs
493
+ extern CL_API_ENTRY cl_mem CL_API_CALL
494
+ clCreateBuffer(cl_context /* context */,
495
+ cl_mem_flags /* flags */,
496
+ size_t /* size */,
497
+ void * /* host_ptr */,
498
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
499
+
500
+ extern CL_API_ENTRY cl_mem CL_API_CALL
501
+ clCreateImage2D(cl_context /* context */,
502
+ cl_mem_flags /* flags */,
503
+ const cl_image_format * /* image_format */,
504
+ size_t /* image_width */,
505
+ size_t /* image_height */,
506
+ size_t /* image_row_pitch */,
507
+ void * /* host_ptr */,
508
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
509
+
510
+ extern CL_API_ENTRY cl_mem CL_API_CALL
511
+ clCreateImage3D(cl_context /* context */,
512
+ cl_mem_flags /* flags */,
513
+ const cl_image_format * /* image_format */,
514
+ size_t /* image_width */,
515
+ size_t /* image_height */,
516
+ size_t /* image_depth */,
517
+ size_t /* image_row_pitch */,
518
+ size_t /* image_slice_pitch */,
519
+ void * /* host_ptr */,
520
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
521
+
522
+ extern CL_API_ENTRY cl_int CL_API_CALL
523
+ clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
524
+
525
+ extern CL_API_ENTRY cl_int CL_API_CALL
526
+ clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
527
+
528
+ extern CL_API_ENTRY cl_int CL_API_CALL
529
+ clGetSupportedImageFormats(cl_context /* context */,
530
+ cl_mem_flags /* flags */,
531
+ cl_mem_object_type /* image_type */,
532
+ cl_uint /* num_entries */,
533
+ cl_image_format * /* image_formats */,
534
+ cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
535
+
536
+ extern CL_API_ENTRY cl_int CL_API_CALL
537
+ clGetMemObjectInfo(cl_mem /* memobj */,
538
+ cl_mem_info /* param_name */,
539
+ size_t /* param_value_size */,
540
+ void * /* param_value */,
541
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
542
+
543
+ extern CL_API_ENTRY cl_int CL_API_CALL
544
+ clGetImageInfo(cl_mem /* image */,
545
+ cl_image_info /* param_name */,
546
+ size_t /* param_value_size */,
547
+ void * /* param_value */,
548
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
549
+
550
+ // Sampler APIs
551
+ extern CL_API_ENTRY cl_sampler CL_API_CALL
552
+ clCreateSampler(cl_context /* context */,
553
+ cl_bool /* normalized_coords */,
554
+ cl_addressing_mode /* addressing_mode */,
555
+ cl_filter_mode /* filter_mode */,
556
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
557
+
558
+ extern CL_API_ENTRY cl_int CL_API_CALL
559
+ clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
560
+
561
+ extern CL_API_ENTRY cl_int CL_API_CALL
562
+ clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
563
+
564
+ extern CL_API_ENTRY cl_int CL_API_CALL
565
+ clGetSamplerInfo(cl_sampler /* sampler */,
566
+ cl_sampler_info /* param_name */,
567
+ size_t /* param_value_size */,
568
+ void * /* param_value */,
569
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
570
+
571
+ // Program Object APIs
572
+ extern CL_API_ENTRY cl_program CL_API_CALL
573
+ clCreateProgramWithSource(cl_context /* context */,
574
+ cl_uint /* count */,
575
+ const char ** /* strings */,
576
+ const size_t * /* lengths */,
577
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
578
+
579
+ extern CL_API_ENTRY cl_program CL_API_CALL
580
+ clCreateProgramWithBinary(cl_context /* context */,
581
+ cl_uint /* num_devices */,
582
+ const cl_device_id * /* device_list */,
583
+ const size_t * /* lengths */,
584
+ const unsigned char ** /* binaries */,
585
+ cl_int * /* binary_status */,
586
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
587
+
588
+ extern CL_API_ENTRY cl_int CL_API_CALL
589
+ clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
590
+
591
+ extern CL_API_ENTRY cl_int CL_API_CALL
592
+ clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
593
+
594
+ extern CL_API_ENTRY cl_int CL_API_CALL
595
+ clBuildProgram(cl_program /* program */,
596
+ cl_uint /* num_devices */,
597
+ const cl_device_id * /* device_list */,
598
+ const char * /* options */,
599
+ void (*pfn_notify)(cl_program /* program */, void * /* user_data */),
600
+ void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
601
+
602
+ extern CL_API_ENTRY cl_int CL_API_CALL
603
+ clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
604
+
605
+ extern CL_API_ENTRY cl_int CL_API_CALL
606
+ clGetProgramInfo(cl_program /* program */,
607
+ cl_program_info /* param_name */,
608
+ size_t /* param_value_size */,
609
+ void * /* param_value */,
610
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
611
+
612
+ extern CL_API_ENTRY cl_int CL_API_CALL
613
+ clGetProgramBuildInfo(cl_program /* program */,
614
+ cl_device_id /* device */,
615
+ cl_program_build_info /* param_name */,
616
+ size_t /* param_value_size */,
617
+ void * /* param_value */,
618
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
619
+
620
+ // Kernel Object APIs
621
+ extern CL_API_ENTRY cl_kernel CL_API_CALL
622
+ clCreateKernel(cl_program /* program */,
623
+ const char * /* kernel_name */,
624
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
625
+
626
+ extern CL_API_ENTRY cl_int CL_API_CALL
627
+ clCreateKernelsInProgram(cl_program /* program */,
628
+ cl_uint /* num_kernels */,
629
+ cl_kernel * /* kernels */,
630
+ cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
631
+
632
+ extern CL_API_ENTRY cl_int CL_API_CALL
633
+ clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
634
+
635
+ extern CL_API_ENTRY cl_int CL_API_CALL
636
+ clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
637
+
638
+ extern CL_API_ENTRY cl_int CL_API_CALL
639
+ clSetKernelArg(cl_kernel /* kernel */,
640
+ cl_uint /* arg_index */,
641
+ size_t /* arg_size */,
642
+ const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
643
+
644
+ extern CL_API_ENTRY cl_int CL_API_CALL
645
+ clGetKernelInfo(cl_kernel /* kernel */,
646
+ cl_kernel_info /* param_name */,
647
+ size_t /* param_value_size */,
648
+ void * /* param_value */,
649
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
650
+
651
+ extern CL_API_ENTRY cl_int CL_API_CALL
652
+ clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
653
+ cl_device_id /* device */,
654
+ cl_kernel_work_group_info /* param_name */,
655
+ size_t /* param_value_size */,
656
+ void * /* param_value */,
657
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
658
+
659
+ // Event Object APIs
660
+ extern CL_API_ENTRY cl_int CL_API_CALL
661
+ clWaitForEvents(cl_uint /* num_events */,
662
+ const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
663
+
664
+ extern CL_API_ENTRY cl_int CL_API_CALL
665
+ clGetEventInfo(cl_event /* event */,
666
+ cl_event_info /* param_name */,
667
+ size_t /* param_value_size */,
668
+ void * /* param_value */,
669
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
670
+
671
+ extern CL_API_ENTRY cl_int CL_API_CALL
672
+ clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
673
+
674
+ extern CL_API_ENTRY cl_int CL_API_CALL
675
+ clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
676
+
677
+ // Profiling APIs
678
+ extern CL_API_ENTRY cl_int CL_API_CALL
679
+ clGetEventProfilingInfo(cl_event /* event */,
680
+ cl_profiling_info /* param_name */,
681
+ size_t /* param_value_size */,
682
+ void * /* param_value */,
683
+ size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
684
+
685
+ // Flush and Finish APIs
686
+ extern CL_API_ENTRY cl_int CL_API_CALL
687
+ clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
688
+
689
+ extern CL_API_ENTRY cl_int CL_API_CALL
690
+ clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
691
+
692
+ // Enqueued Commands APIs
693
+ extern CL_API_ENTRY cl_int CL_API_CALL
694
+ clEnqueueReadBuffer(cl_command_queue /* command_queue */,
695
+ cl_mem /* buffer */,
696
+ cl_bool /* blocking_read */,
697
+ size_t /* offset */,
698
+ size_t /* cb */,
699
+ void * /* ptr */,
700
+ cl_uint /* num_events_in_wait_list */,
701
+ const cl_event * /* event_wait_list */,
702
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
703
+
704
+ extern CL_API_ENTRY cl_int CL_API_CALL
705
+ clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
706
+ cl_mem /* buffer */,
707
+ cl_bool /* blocking_write */,
708
+ size_t /* offset */,
709
+ size_t /* cb */,
710
+ const void * /* ptr */,
711
+ cl_uint /* num_events_in_wait_list */,
712
+ const cl_event * /* event_wait_list */,
713
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
714
+
715
+ extern CL_API_ENTRY cl_int CL_API_CALL
716
+ clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
717
+ cl_mem /* src_buffer */,
718
+ cl_mem /* dst_buffer */,
719
+ size_t /* src_offset */,
720
+ size_t /* dst_offset */,
721
+ size_t /* cb */,
722
+ cl_uint /* num_events_in_wait_list */,
723
+ const cl_event * /* event_wait_list */,
724
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
725
+
726
+ extern CL_API_ENTRY cl_int CL_API_CALL
727
+ clEnqueueReadImage(cl_command_queue /* command_queue */,
728
+ cl_mem /* image */,
729
+ cl_bool /* blocking_read */,
730
+ const size_t * /* origin[3] */,
731
+ const size_t * /* region[3] */,
732
+ size_t /* row_pitch */,
733
+ size_t /* slice_pitch */,
734
+ void * /* ptr */,
735
+ cl_uint /* num_events_in_wait_list */,
736
+ const cl_event * /* event_wait_list */,
737
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
738
+
739
+ extern CL_API_ENTRY cl_int CL_API_CALL
740
+ clEnqueueWriteImage(cl_command_queue /* command_queue */,
741
+ cl_mem /* image */,
742
+ cl_bool /* blocking_write */,
743
+ const size_t * /* origin[3] */,
744
+ const size_t * /* region[3] */,
745
+ size_t /* input_row_pitch */,
746
+ size_t /* input_slice_pitch */,
747
+ const void * /* ptr */,
748
+ cl_uint /* num_events_in_wait_list */,
749
+ const cl_event * /* event_wait_list */,
750
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
751
+
752
+ extern CL_API_ENTRY cl_int CL_API_CALL
753
+ clEnqueueCopyImage(cl_command_queue /* command_queue */,
754
+ cl_mem /* src_image */,
755
+ cl_mem /* dst_image */,
756
+ const size_t * /* src_origin[3] */,
757
+ const size_t * /* dst_origin[3] */,
758
+ const size_t * /* region[3] */,
759
+ cl_uint /* num_events_in_wait_list */,
760
+ const cl_event * /* event_wait_list */,
761
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
762
+
763
+ extern CL_API_ENTRY cl_int CL_API_CALL
764
+ clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
765
+ cl_mem /* src_image */,
766
+ cl_mem /* dst_buffer */,
767
+ const size_t * /* src_origin[3] */,
768
+ const size_t * /* region[3] */,
769
+ size_t /* dst_offset */,
770
+ cl_uint /* num_events_in_wait_list */,
771
+ const cl_event * /* event_wait_list */,
772
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
773
+
774
+ extern CL_API_ENTRY cl_int CL_API_CALL
775
+ clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
776
+ cl_mem /* src_buffer */,
777
+ cl_mem /* dst_image */,
778
+ size_t /* src_offset */,
779
+ const size_t * /* dst_origin[3] */,
780
+ const size_t * /* region[3] */,
781
+ cl_uint /* num_events_in_wait_list */,
782
+ const cl_event * /* event_wait_list */,
783
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
784
+
785
+ extern CL_API_ENTRY void * CL_API_CALL
786
+ clEnqueueMapBuffer(cl_command_queue /* command_queue */,
787
+ cl_mem /* buffer */,
788
+ cl_bool /* blocking_map */,
789
+ cl_map_flags /* map_flags */,
790
+ size_t /* offset */,
791
+ size_t /* cb */,
792
+ cl_uint /* num_events_in_wait_list */,
793
+ const cl_event * /* event_wait_list */,
794
+ cl_event * /* event */,
795
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
796
+
797
+ extern CL_API_ENTRY void * CL_API_CALL
798
+ clEnqueueMapImage(cl_command_queue /* command_queue */,
799
+ cl_mem /* image */,
800
+ cl_bool /* blocking_map */,
801
+ cl_map_flags /* map_flags */,
802
+ const size_t * /* origin[3] */,
803
+ const size_t * /* region[3] */,
804
+ size_t * /* image_row_pitch */,
805
+ size_t * /* image_slice_pitch */,
806
+ cl_uint /* num_events_in_wait_list */,
807
+ const cl_event * /* event_wait_list */,
808
+ cl_event * /* event */,
809
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
810
+
811
+ extern CL_API_ENTRY cl_int CL_API_CALL
812
+ clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
813
+ cl_mem /* memobj */,
814
+ void * /* mapped_ptr */,
815
+ cl_uint /* num_events_in_wait_list */,
816
+ const cl_event * /* event_wait_list */,
817
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
818
+
819
+ extern CL_API_ENTRY cl_int CL_API_CALL
820
+ clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
821
+ cl_kernel /* kernel */,
822
+ cl_uint /* work_dim */,
823
+ const size_t * /* global_work_offset */,
824
+ const size_t * /* global_work_size */,
825
+ const size_t * /* local_work_size */,
826
+ cl_uint /* num_events_in_wait_list */,
827
+ const cl_event * /* event_wait_list */,
828
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
829
+
830
+ extern CL_API_ENTRY cl_int CL_API_CALL
831
+ clEnqueueTask(cl_command_queue /* command_queue */,
832
+ cl_kernel /* kernel */,
833
+ cl_uint /* num_events_in_wait_list */,
834
+ const cl_event * /* event_wait_list */,
835
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
836
+
837
+ extern CL_API_ENTRY cl_int CL_API_CALL
838
+ clEnqueueNativeKernel(cl_command_queue /* command_queue */,
839
+ void (*user_func)(void *),
840
+ void * /* args */,
841
+ size_t /* cb_args */,
842
+ cl_uint /* num_mem_objects */,
843
+ const cl_mem * /* mem_list */,
844
+ const void ** /* args_mem_loc */,
845
+ cl_uint /* num_events_in_wait_list */,
846
+ const cl_event * /* event_wait_list */,
847
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
848
+
849
+ extern CL_API_ENTRY cl_int CL_API_CALL
850
+ clEnqueueMarker(cl_command_queue /* command_queue */,
851
+ cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
852
+
853
+ extern CL_API_ENTRY cl_int CL_API_CALL
854
+ clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
855
+ cl_uint /* num_events */,
856
+ const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
857
+
858
+ extern CL_API_ENTRY cl_int CL_API_CALL
859
+ clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
860
+
861
+ #ifdef __cplusplus
862
+ }
863
+ #endif
864
+
865
+ #endif // __OPENCL_CL_H
866
+