glsl-1.10: test mesa bug conflict between globals
[piglit.git] / tests / util / piglit-util-cl-enum.c
blob5d43bc10295f2a99b6d38ccef849fac3aeb1a807
1 /*
2 * Copyright © 2012 Blaž Tomažič <blaz.tomazic@gmail.com>
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 (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 #include "piglit-util-cl.h"
26 const char *
27 piglit_cl_get_enum_name(cl_uint param)
29 #define CASE(x) case x: return #x;
31 /* Enums are copied from cl.h header and then the bitfield
32 * and non-unique enums are commented out (only one group
33 * of intersecting groups of enums is left uncommented).
36 switch (param) {
38 /* Error Codes */
40 CASE(CL_SUCCESS) // 0
41 CASE(CL_DEVICE_NOT_FOUND) // -1
42 CASE(CL_DEVICE_NOT_AVAILABLE) // -2
43 CASE(CL_COMPILER_NOT_AVAILABLE) // -3
44 CASE(CL_MEM_OBJECT_ALLOCATION_FAILURE) // -4
45 CASE(CL_OUT_OF_RESOURCES) // -5
46 CASE(CL_OUT_OF_HOST_MEMORY) // -6
47 CASE(CL_PROFILING_INFO_NOT_AVAILABLE) // -7
48 CASE(CL_MEM_COPY_OVERLAP) // -8
49 CASE(CL_IMAGE_FORMAT_MISMATCH) // -9
50 CASE(CL_IMAGE_FORMAT_NOT_SUPPORTED) // -10
51 CASE(CL_BUILD_PROGRAM_FAILURE) // -11
52 CASE(CL_MAP_FAILURE) // -12
53 #ifdef CL_VERSION_1_1
54 CASE(CL_MISALIGNED_SUB_BUFFER_OFFSET) // -13
55 CASE(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST) // -14
56 #endif //CL_VERSION_1_1
57 #ifdef CL_VERSION_1_2
58 CASE(CL_COMPILE_PROGRAM_FAILURE) // -15
59 CASE(CL_LINKER_NOT_AVAILABLE) // -16
60 CASE(CL_LINK_PROGRAM_FAILURE) // -17
61 CASE(CL_DEVICE_PARTITION_FAILED) // -18
62 CASE(CL_KERNEL_ARG_INFO_NOT_AVAILABLE) // -19
63 #endif //CL_VERSION_1_2
65 CASE(CL_INVALID_VALUE) // -30
66 CASE(CL_INVALID_DEVICE_TYPE) // -31
67 CASE(CL_INVALID_PLATFORM) // -32
68 CASE(CL_INVALID_DEVICE) // -33
69 CASE(CL_INVALID_CONTEXT) // -34
70 CASE(CL_INVALID_QUEUE_PROPERTIES) // -35
71 CASE(CL_INVALID_COMMAND_QUEUE) // -36
72 CASE(CL_INVALID_HOST_PTR) // -37
73 CASE(CL_INVALID_MEM_OBJECT) // -38
74 CASE(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR) // -39
75 CASE(CL_INVALID_IMAGE_SIZE) // -40
76 CASE(CL_INVALID_SAMPLER) // -41
77 CASE(CL_INVALID_BINARY) // -42
78 CASE(CL_INVALID_BUILD_OPTIONS) // -43
79 CASE(CL_INVALID_PROGRAM) // -44
80 CASE(CL_INVALID_PROGRAM_EXECUTABLE) // -45
81 CASE(CL_INVALID_KERNEL_NAME) // -46
82 CASE(CL_INVALID_KERNEL_DEFINITION) // -47
83 CASE(CL_INVALID_KERNEL) // -48
84 CASE(CL_INVALID_ARG_INDEX) // -49
85 CASE(CL_INVALID_ARG_VALUE) // -50
86 CASE(CL_INVALID_ARG_SIZE) // -51
87 CASE(CL_INVALID_KERNEL_ARGS) // -52
88 CASE(CL_INVALID_WORK_DIMENSION) // -53
89 CASE(CL_INVALID_WORK_GROUP_SIZE) // -54
90 CASE(CL_INVALID_WORK_ITEM_SIZE) // -55
91 CASE(CL_INVALID_GLOBAL_OFFSET) // -56
92 CASE(CL_INVALID_EVENT_WAIT_LIST) // -57
93 CASE(CL_INVALID_EVENT) // -58
94 CASE(CL_INVALID_OPERATION) // -59
95 CASE(CL_INVALID_GL_OBJECT) // -60
96 CASE(CL_INVALID_BUFFER_SIZE) // -61
97 CASE(CL_INVALID_MIP_LEVEL) // -62
98 CASE(CL_INVALID_GLOBAL_WORK_SIZE) // -63
99 #ifdef CL_VERSION_1_1
100 CASE(CL_INVALID_PROPERTY) // -64
101 #endif //CL_VERSION_1_1
102 #ifdef CL_VERSION_1_2
103 CASE(CL_INVALID_IMAGE_DESCRIPTOR) // -65
104 CASE(CL_INVALID_COMPILER_OPTIONS) // -66
105 CASE(CL_INVALID_LINKER_OPTIONS) // -67
106 CASE(CL_INVALID_DEVICE_PARTITION_COUNT) // -68
107 #endif //CL_VERSION_1_2
110 /* OpenCL Version */
112 CASE(CL_VERSION_1_0) // 1
113 CASE(CL_VERSION_1_1) // 1
114 CASE(CL_VERSION_1_2) // 1
117 /* cl_bool */
119 CASE(CL_FALSE) // 0
120 CASE(CL_TRUE) // 1
121 CASE(CL_BLOCKING) // CL_TRUE
122 CASE(CL_NON_BLOCKING) // CL_FALSE
125 /* cl_platform_info */
126 CASE(CL_PLATFORM_PROFILE) // 0x0900
127 CASE(CL_PLATFORM_VERSION) // 0x0901
128 CASE(CL_PLATFORM_NAME) // 0x0902
129 CASE(CL_PLATFORM_VENDOR) // 0x0903
130 CASE(CL_PLATFORM_EXTENSIONS) // 0x0904
132 /* cl_device_type - bitfield */
134 CASE(CL_DEVICE_TYPE_DEFAULT) // (1 << 0)
135 CASE(CL_DEVICE_TYPE_CPU) // (1 << 1)
136 CASE(CL_DEVICE_TYPE_GPU) // (1 << 2)
137 CASE(CL_DEVICE_TYPE_ACCELERATOR) // (1 << 3)
138 CASE(CL_DEVICE_TYPE_CUSTOM) // (1 << 4)
139 CASE(CL_DEVICE_TYPE_ALL) // 0xFFFFFFFF
142 /* cl_device_info */
143 CASE(CL_DEVICE_TYPE) // 0x1000
144 CASE(CL_DEVICE_VENDOR_ID) // 0x1001
145 CASE(CL_DEVICE_MAX_COMPUTE_UNITS) // 0x1002
146 CASE(CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS) // 0x1003
147 CASE(CL_DEVICE_MAX_WORK_GROUP_SIZE) // 0x1004
148 CASE(CL_DEVICE_MAX_WORK_ITEM_SIZES) // 0x1005
149 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR) // 0x1006
150 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT) // 0x1007
151 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT) // 0x1008
152 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG) // 0x1009
153 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT) // 0x100A
154 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE) // 0x100B
155 CASE(CL_DEVICE_MAX_CLOCK_FREQUENCY) // 0x100C
156 CASE(CL_DEVICE_ADDRESS_BITS) // 0x100D
157 CASE(CL_DEVICE_MAX_READ_IMAGE_ARGS) // 0x100E
158 CASE(CL_DEVICE_MAX_WRITE_IMAGE_ARGS) // 0x100F
159 CASE(CL_DEVICE_MAX_MEM_ALLOC_SIZE) // 0x1010
160 CASE(CL_DEVICE_IMAGE2D_MAX_WIDTH) // 0x1011
161 CASE(CL_DEVICE_IMAGE2D_MAX_HEIGHT) // 0x1012
162 CASE(CL_DEVICE_IMAGE3D_MAX_WIDTH) // 0x1013
163 CASE(CL_DEVICE_IMAGE3D_MAX_HEIGHT) // 0x1014
164 CASE(CL_DEVICE_IMAGE3D_MAX_DEPTH) // 0x1015
165 CASE(CL_DEVICE_IMAGE_SUPPORT) // 0x1016
166 CASE(CL_DEVICE_MAX_PARAMETER_SIZE) // 0x1017
167 CASE(CL_DEVICE_MAX_SAMPLERS) // 0x1018
168 CASE(CL_DEVICE_MEM_BASE_ADDR_ALIGN) // 0x1019
169 CASE(CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE) // 0x101A
170 CASE(CL_DEVICE_SINGLE_FP_CONFIG) // 0x101B
171 CASE(CL_DEVICE_GLOBAL_MEM_CACHE_TYPE) // 0x101C
172 CASE(CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE) // 0x101D
173 CASE(CL_DEVICE_GLOBAL_MEM_CACHE_SIZE) // 0x101E
174 CASE(CL_DEVICE_GLOBAL_MEM_SIZE) // 0x101F
175 CASE(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE) // 0x1020
176 CASE(CL_DEVICE_MAX_CONSTANT_ARGS) // 0x1021
177 CASE(CL_DEVICE_LOCAL_MEM_TYPE) // 0x1022
178 CASE(CL_DEVICE_LOCAL_MEM_SIZE) // 0x1023
179 CASE(CL_DEVICE_ERROR_CORRECTION_SUPPORT) // 0x1024
180 CASE(CL_DEVICE_PROFILING_TIMER_RESOLUTION) // 0x1025
181 CASE(CL_DEVICE_ENDIAN_LITTLE) // 0x1026
182 CASE(CL_DEVICE_AVAILABLE) // 0x1027
183 CASE(CL_DEVICE_COMPILER_AVAILABLE) // 0x1028
184 CASE(CL_DEVICE_EXECUTION_CAPABILITIES) // 0x1029
185 #ifdef CL_VERSION_2_0
186 CASE(CL_DEVICE_QUEUE_ON_HOST_PROPERTIES) // 0x102A
187 #else //CL_VERSION_2_0
188 CASE(CL_DEVICE_QUEUE_PROPERTIES) // 0x102A
189 #endif //CL_VERSION_2_0
190 CASE(CL_DEVICE_NAME) // 0x102B
191 CASE(CL_DEVICE_VENDOR) // 0x102C
192 CASE(CL_DRIVER_VERSION) // 0x102D
193 CASE(CL_DEVICE_PROFILE) // 0x102E
194 CASE(CL_DEVICE_VERSION) // 0x102F
195 CASE(CL_DEVICE_EXTENSIONS) // 0x1030
196 CASE(CL_DEVICE_PLATFORM) // 0x1031
197 #ifdef CL_VERSION_1_2
198 CASE(CL_DEVICE_DOUBLE_FP_CONFIG) // 0x1032
199 #endif //CL_VERSION_1_2
200 /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
201 #ifdef CL_VERSION_1_1
202 CASE(CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF) // 0x1034
203 CASE(CL_DEVICE_HOST_UNIFIED_MEMORY) // 0x1035
204 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR) // 0x1036
205 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT) // 0x1037
206 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_INT) // 0x1038
207 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG) // 0x1039
208 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT) // 0x103A
209 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE) // 0x103B
210 CASE(CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF) // 0x103C
211 CASE(CL_DEVICE_OPENCL_C_VERSION) // 0x103D
212 #endif //CL_VERSION_1_1
213 #ifdef CL_VERSION_1_2
214 CASE(CL_DEVICE_LINKER_AVAILABLE) // 0x103E
215 CASE(CL_DEVICE_BUILT_IN_KERNELS) // 0x103F
216 CASE(CL_DEVICE_IMAGE_MAX_BUFFER_SIZE) // 0x1040
217 CASE(CL_DEVICE_IMAGE_MAX_ARRAY_SIZE) // 0x1041
218 CASE(CL_DEVICE_PARENT_DEVICE) // 0x1042
219 CASE(CL_DEVICE_PARTITION_MAX_SUB_DEVICES) // 0x1043
220 CASE(CL_DEVICE_PARTITION_PROPERTIES) // 0x1044
221 CASE(CL_DEVICE_PARTITION_AFFINITY_DOMAIN) // 0x1045
222 CASE(CL_DEVICE_PARTITION_TYPE) // 0x1046
223 CASE(CL_DEVICE_REFERENCE_COUNT) // 0x1047
224 CASE(CL_DEVICE_PREFERRED_INTEROP_USER_SYNC) // 0x1048
225 CASE(CL_DEVICE_PRINTF_BUFFER_SIZE) // 0x1049
226 #endif //CL_VERSION_1_2
228 /* cl_device_fp_config - bitfield */
230 CASE(CL_FP_DENORM) // (1 << 0)
231 CASE(CL_FP_INF_NAN) // (1 << 1)
232 CASE(CL_FP_ROUND_TO_NEAREST) // (1 << 2)
233 CASE(CL_FP_ROUND_TO_ZERO) // (1 << 3)
234 CASE(CL_FP_ROUND_TO_INF) // (1 << 4)
235 CASE(CL_FP_FMA) // (1 << 5)
236 CASE(CL_FP_SOFT_FLOAT) // (1 << 6)
237 CASE(CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT) // (1 << 7)
240 /* cl_device_mem_cache_type */
242 CASE(CL_NONE) // 0x0
243 CASE(CL_READ_ONLY_CACHE) // 0x1
244 CASE(CL_READ_WRITE_CACHE) // 0x2
247 /* cl_device_local_mem_type */
249 CASE(CL_LOCAL) // 0x1
250 CASE(CL_GLOBAL) // 0x2
253 /* cl_device_exec_capabilities - bitfield */
255 CASE(CL_EXEC_KERNEL) // (1 << 0)
256 CASE(CL_EXEC_NATIVE_KERNEL) // (1 << 1)
259 /* cl_command_queue_properties - bitfield */
261 CASE(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) // (1 << 0)
262 CASE(CL_QUEUE_PROFILING_ENABLE) // (1 << 1)
263 CASE(CL_QUEUE_ON_DEVICE) // (1 << 2)
264 CASE(CL_QUEUE_ON_DEVICE_DEFAULT) // (1 << 3)
267 /* cl_context_info */
268 CASE(CL_CONTEXT_REFERENCE_COUNT) // 0x1080
269 CASE(CL_CONTEXT_DEVICES) // 0x1081
270 CASE(CL_CONTEXT_PROPERTIES) // 0x1082
271 #ifdef CL_VERSION_1_1
272 CASE(CL_CONTEXT_NUM_DEVICES) // 0x1083
273 #endif //CL_VERSION_1_1
275 /* cl_context_properties */
276 CASE(CL_CONTEXT_PLATFORM) // 0x1084
277 #ifdef CL_VERSION_1_2
278 CASE(CL_CONTEXT_INTEROP_USER_SYNC) // 0x1085
279 #endif //CL_VERSION_1_2
281 /* cl_device_partition_property */
282 #ifdef CL_VERSION_1_2
283 CASE(CL_DEVICE_PARTITION_EQUALLY) // 0x1086
284 CASE(CL_DEVICE_PARTITION_BY_COUNTS) // 0x1087
285 CASE(CL_DEVICE_PARTITION_BY_COUNTS_LIST_END) // 0x0
286 CASE(CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) // 0x1088
287 #endif //CL_VERSION_1_2
289 /* cl_device_affinity_domain */
291 CASE(CL_DEVICE_AFFINITY_DOMAIN_NUMA) // (1 << 0)
292 CASE(CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE) // (1 << 1)
293 CASE(CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE) // (1 << 2)
294 CASE(CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE) // (1 << 3)
295 CASE(CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE) // (1 << 4)
296 CASE(CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE) // (1 << 5)
299 /* cl_command_queue_info */
300 CASE(CL_QUEUE_CONTEXT) // 0x1090
301 CASE(CL_QUEUE_DEVICE) // 0x1091
302 CASE(CL_QUEUE_REFERENCE_COUNT) // 0x1092
303 CASE(CL_QUEUE_PROPERTIES) // 0x1093
304 #ifdef CL_VERSION_2_0
305 CASE(CL_QUEUE_SIZE) // 0x1094
306 #endif //CL_VERSION_2_0
308 /* cl_mem_flags - bitfield */
310 CASE(CL_MEM_READ_WRITE) // (1 << 0)
311 CASE(CL_MEM_WRITE_ONLY) // (1 << 1)
312 CASE(CL_MEM_READ_ONLY) // (1 << 2)
313 CASE(CL_MEM_USE_HOST_PTR) // (1 << 3)
314 CASE(CL_MEM_ALLOC_HOST_PTR) // (1 << 4)
315 CASE(CL_MEM_COPY_HOST_PTR) // (1 << 5)
316 // reserved (1 << 6)
317 CASE(CL_MEM_HOST_WRITE_ONLY) // (1 << 7)
318 CASE(CL_MEM_HOST_READ_ONLY) // (1 << 8)
319 CASE(CL_MEM_HOST_NO_ACCESS) // (1 << 9)
322 /* cl_mem_migration_flags - bitfield */
324 CASE(CL_MIGRATE_MEM_OBJECT_HOST) // (1 << 0)
325 CASE(CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED) // (1 << 1)
328 /* cl_channel_order */
329 CASE(CL_R) // 0x10B0
330 CASE(CL_A) // 0x10B1
331 CASE(CL_RG) // 0x10B2
332 CASE(CL_RA) // 0x10B3
333 CASE(CL_RGB) // 0x10B4
334 CASE(CL_RGBA) // 0x10B5
335 CASE(CL_BGRA) // 0x10B6
336 CASE(CL_ARGB) // 0x10B7
337 CASE(CL_INTENSITY) // 0x10B8
338 CASE(CL_LUMINANCE) // 0x10B9
339 #ifdef CL_VERSION_1_1
340 CASE(CL_Rx) // 0x10BA
341 CASE(CL_RGx) // 0x10BB
342 CASE(CL_RGBx) // 0x10BC
343 #endif //CL_VERSION_1_1
345 /* cl_channel_type */
346 CASE(CL_SNORM_INT8) // 0x10D0
347 CASE(CL_SNORM_INT16) // 0x10D1
348 CASE(CL_UNORM_INT8) // 0x10D2
349 CASE(CL_UNORM_INT16) // 0x10D3
350 CASE(CL_UNORM_SHORT_565) // 0x10D4
351 CASE(CL_UNORM_SHORT_555) // 0x10D5
352 CASE(CL_UNORM_INT_101010) // 0x10D6
353 CASE(CL_SIGNED_INT8) // 0x10D7
354 CASE(CL_SIGNED_INT16) // 0x10D8
355 CASE(CL_SIGNED_INT32) // 0x10D9
356 CASE(CL_UNSIGNED_INT8) // 0x10DA
357 CASE(CL_UNSIGNED_INT16) // 0x10DB
358 CASE(CL_UNSIGNED_INT32) // 0x10DC
359 CASE(CL_HALF_FLOAT) // 0x10DD
360 CASE(CL_FLOAT) // 0x10DE
362 /* cl_mem_object_type */
363 CASE(CL_MEM_OBJECT_BUFFER) // 0x10F0
364 CASE(CL_MEM_OBJECT_IMAGE2D) // 0x10F1
365 CASE(CL_MEM_OBJECT_IMAGE3D) // 0x10F2
366 #ifdef CL_VERSION_1_2
367 CASE(CL_MEM_OBJECT_IMAGE2D_ARRAY) // 0x10F3
368 CASE(CL_MEM_OBJECT_IMAGE1D) // 0x10F4
369 CASE(CL_MEM_OBJECT_IMAGE1D_ARRAY) // 0x10F5
370 CASE(CL_MEM_OBJECT_IMAGE1D_BUFFER) // 0x10F6
371 #endif //CL_VERSION_1_2
373 /* cl_mem_info */
374 CASE(CL_MEM_TYPE) // 0x1100
375 CASE(CL_MEM_FLAGS) // 0x1101
376 CASE(CL_MEM_SIZE) // 0x1102
377 CASE(CL_MEM_HOST_PTR) // 0x1103
378 CASE(CL_MEM_MAP_COUNT) // 0x1104
379 CASE(CL_MEM_REFERENCE_COUNT) // 0x1105
380 CASE(CL_MEM_CONTEXT) // 0x1106
381 #ifdef CL_VERSION_1_1
382 CASE(CL_MEM_ASSOCIATED_MEMOBJECT) // 0x1107
383 CASE(CL_MEM_OFFSET) // 0x1108
384 #endif //CL_VERSION_1_1
385 #ifdef CL_VERSION_2_0
386 CASE(CL_MEM_USES_SVM_POINTER) // 0x1109
387 #endif //CL_VERSION_2_0
389 /* cl_image_info */
390 CASE(CL_IMAGE_FORMAT) // 0x1110
391 CASE(CL_IMAGE_ELEMENT_SIZE) // 0x1111
392 CASE(CL_IMAGE_ROW_PITCH) // 0x1112
393 CASE(CL_IMAGE_SLICE_PITCH) // 0x1113
394 CASE(CL_IMAGE_WIDTH) // 0x1114
395 CASE(CL_IMAGE_HEIGHT) // 0x1115
396 CASE(CL_IMAGE_DEPTH) // 0x1116
397 #ifdef CL_VERSION_1_2
398 CASE(CL_IMAGE_ARRAY_SIZE) // 0x1117
399 CASE(CL_IMAGE_BUFFER) // 0x1118
400 CASE(CL_IMAGE_NUM_MIP_LEVELS) // 0x1119
401 CASE(CL_IMAGE_NUM_SAMPLES) // 0x111A
402 #endif //CL_VERSION_1_2
404 /* cl_addressing_mode */
405 CASE(CL_ADDRESS_NONE) // 0x1130
406 CASE(CL_ADDRESS_CLAMP_TO_EDGE) // 0x1131
407 CASE(CL_ADDRESS_CLAMP) // 0x1132
408 CASE(CL_ADDRESS_REPEAT) // 0x1133
409 #ifdef CL_VERSION_1_1
410 CASE(CL_ADDRESS_MIRRORED_REPEAT) // 0x1134
411 #endif //CL_VERSION_1_1
413 /* cl_filter_mode */
414 CASE(CL_FILTER_NEAREST) // 0x1140
415 CASE(CL_FILTER_LINEAR) // 0x1141
417 /* cl_sampler_info */
418 CASE(CL_SAMPLER_REFERENCE_COUNT) // 0x1150
419 CASE(CL_SAMPLER_CONTEXT) // 0x1151
420 CASE(CL_SAMPLER_NORMALIZED_COORDS) // 0x1152
421 CASE(CL_SAMPLER_ADDRESSING_MODE) // 0x1153
422 CASE(CL_SAMPLER_FILTER_MODE) // 0x1154
424 /* cl_map_flags - bitfield */
426 CASE(CL_MAP_READ) // (1 << 0)
427 CASE(CL_MAP_WRITE) // (1 << 1)
428 CASE(CL_MAP_WRITE_INVALIDATE_REGION) // (1 << 2)
431 /* cl_program_info */
432 CASE(CL_PROGRAM_REFERENCE_COUNT) // 0x1160
433 CASE(CL_PROGRAM_CONTEXT) // 0x1161
434 CASE(CL_PROGRAM_NUM_DEVICES) // 0x1162
435 CASE(CL_PROGRAM_DEVICES) // 0x1163
436 CASE(CL_PROGRAM_SOURCE) // 0x1164
437 CASE(CL_PROGRAM_BINARY_SIZES) // 0x1165
438 CASE(CL_PROGRAM_BINARIES) // 0x1166
439 #ifdef CL_VERSION_1_2
440 CASE(CL_PROGRAM_NUM_KERNELS) // 0x1167
441 CASE(CL_PROGRAM_KERNEL_NAMES) // 0x1168
442 #endif //CL_VERSION_1_2
444 /* cl_program_build_info */
445 CASE(CL_PROGRAM_BUILD_STATUS) // 0x1181
446 CASE(CL_PROGRAM_BUILD_OPTIONS) // 0x1182
447 CASE(CL_PROGRAM_BUILD_LOG) // 0x1183
448 #ifdef CL_VERSION_1_2
449 CASE(CL_PROGRAM_BINARY_TYPE) // 0x1184
450 #endif //CL_VERSION_1_2
451 #ifdef CL_VERSION_2_0
452 CASE(CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE) // 0x1185
453 #endif //CL_VERSION_2_0
455 /* cl_program_binary_type */
457 CASE(CL_PROGRAM_BINARY_TYPE_NONE) // 0x0
458 CASE(CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT) // 0x1
459 CASE(CL_PROGRAM_BINARY_TYPE_LIBRARY) // 0x2
460 CASE(CL_PROGRAM_BINARY_TYPE_EXECUTABLE) // 0x4
463 /* cl_build_status */
465 CASE(CL_BUILD_SUCCESS) // 0
466 CASE(CL_BUILD_NONE) // -1
467 CASE(CL_BUILD_ERROR) // -2
468 CASE(CL_BUILD_IN_PROGRESS) // -3
471 /* cl_kernel_info */
472 CASE(CL_KERNEL_FUNCTION_NAME) // 0x1190
473 CASE(CL_KERNEL_NUM_ARGS) // 0x1191
474 CASE(CL_KERNEL_REFERENCE_COUNT) // 0x1192
475 CASE(CL_KERNEL_CONTEXT) // 0x1193
476 CASE(CL_KERNEL_PROGRAM) // 0x1194
477 #ifdef CL_VERSION_1_2
478 CASE(CL_KERNEL_ATTRIBUTES) // 0x1195
479 #endif //CL_VERSION_1_2
481 /* cl_kernel_arg_info */
482 #ifdef CL_VERSION_1_2
483 CASE(CL_KERNEL_ARG_ADDRESS_QUALIFIER) // 0x1196
484 CASE(CL_KERNEL_ARG_ACCESS_QUALIFIER) // 0x1197
485 CASE(CL_KERNEL_ARG_TYPE_NAME) // 0x1198
486 CASE(CL_KERNEL_ARG_TYPE_QUALIFIER) // 0x1199
487 CASE(CL_KERNEL_ARG_NAME) // 0x119A
488 #endif //CL_VERSION_1_2
490 /* cl_kernel_arg_address_qualifier */
491 #ifdef CL_VERSION_1_2
492 CASE(CL_KERNEL_ARG_ADDRESS_GLOBAL) // 0x119B
493 CASE(CL_KERNEL_ARG_ADDRESS_LOCAL) // 0x119C
494 CASE(CL_KERNEL_ARG_ADDRESS_CONSTANT) // 0x119D
495 CASE(CL_KERNEL_ARG_ADDRESS_PRIVATE) // 0x119E
496 #endif //CL_VERSION_1_2
498 /* cl_kernel_arg_access_qualifier */
499 #ifdef CL_VERSION_1_2
500 CASE(CL_KERNEL_ARG_ACCESS_READ_ONLY) // 0x11A0
501 CASE(CL_KERNEL_ARG_ACCESS_WRITE_ONLY) // 0x11A1
502 CASE(CL_KERNEL_ARG_ACCESS_READ_WRITE) // 0x11A2
503 CASE(CL_KERNEL_ARG_ACCESS_NONE) // 0x11A3
504 #endif //CL_VERSION_1_2
506 /* cl_kernel_arg_type_qualifer */
508 CASE(CL_KERNEL_ARG_TYPE_NONE) // 0
509 CASE(CL_KERNEL_ARG_TYPE_CONST) // (1 << 0)
510 CASE(CL_KERNEL_ARG_TYPE_RESTRICT) // (1 << 1)
511 CASE(CL_KERNEL_ARG_TYPE_VOLATILE) // (1 << 2)
514 /* cl_kernel_work_group_info */
515 CASE(CL_KERNEL_WORK_GROUP_SIZE) // 0x11B0
516 CASE(CL_KERNEL_COMPILE_WORK_GROUP_SIZE) // 0x11B1
517 CASE(CL_KERNEL_LOCAL_MEM_SIZE) // 0x11B2
518 #ifdef CL_VERSION_1_1
519 CASE(CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE) // 0x11B3
520 CASE(CL_KERNEL_PRIVATE_MEM_SIZE) // 0x11B4
521 #endif //CL_VERSION_1_1
522 #ifdef CL_VERSION_1_2
523 CASE(CL_KERNEL_GLOBAL_WORK_SIZE) // 0x11B5
524 #endif //CL_VERSION_1_2
526 /* cl_event_info */
527 CASE(CL_EVENT_COMMAND_QUEUE) // 0x11D0
528 CASE(CL_EVENT_COMMAND_TYPE) // 0x11D1
529 CASE(CL_EVENT_REFERENCE_COUNT) // 0x11D2
530 CASE(CL_EVENT_COMMAND_EXECUTION_STATUS) // 0x11D3
531 #ifdef CL_VERSION_1_1
532 CASE(CL_EVENT_CONTEXT) // 0x11D4
533 #endif //CL_VERSION_1_1
535 /* cl_command_type */
536 CASE(CL_COMMAND_NDRANGE_KERNEL) // 0x11F0
537 CASE(CL_COMMAND_TASK) // 0x11F1
538 CASE(CL_COMMAND_NATIVE_KERNEL) // 0x11F2
539 CASE(CL_COMMAND_READ_BUFFER) // 0x11F3
540 CASE(CL_COMMAND_WRITE_BUFFER) // 0x11F4
541 CASE(CL_COMMAND_COPY_BUFFER) // 0x11F5
542 CASE(CL_COMMAND_READ_IMAGE) // 0x11F6
543 CASE(CL_COMMAND_WRITE_IMAGE) // 0x11F7
544 CASE(CL_COMMAND_COPY_IMAGE) // 0x11F8
545 CASE(CL_COMMAND_COPY_IMAGE_TO_BUFFER) // 0x11F9
546 CASE(CL_COMMAND_COPY_BUFFER_TO_IMAGE) // 0x11FA
547 CASE(CL_COMMAND_MAP_BUFFER) // 0x11FB
548 CASE(CL_COMMAND_MAP_IMAGE) // 0x11FC
549 CASE(CL_COMMAND_UNMAP_MEM_OBJECT) // 0x11FD
550 CASE(CL_COMMAND_MARKER) // 0x11FE
551 CASE(CL_COMMAND_ACQUIRE_GL_OBJECTS) // 0x11FF
552 CASE(CL_COMMAND_RELEASE_GL_OBJECTS) // 0x1200
553 #ifdef CL_VERSION_1_1
554 CASE(CL_COMMAND_READ_BUFFER_RECT) // 0x1201
555 CASE(CL_COMMAND_WRITE_BUFFER_RECT) // 0x1202
556 CASE(CL_COMMAND_COPY_BUFFER_RECT) // 0x1203
557 CASE(CL_COMMAND_USER) // 0x1204
558 #endif //CL_VERSION_1_1
559 #ifdef CL_VERSION_1_2
560 CASE(CL_COMMAND_BARRIER) // 0x1205
561 CASE(CL_COMMAND_MIGRATE_MEM_OBJECTS) // 0x1206
562 CASE(CL_COMMAND_FILL_BUFFER) // 0x1207
563 CASE(CL_COMMAND_FILL_IMAGE) // 0x1208
564 #endif //CL_VERSION_1_2
566 /* command execution status */
568 CASE(CL_COMPLETE) // 0x0
569 CASE(CL_RUNNING) // 0x1
570 CASE(CL_SUBMITTED) // 0x2
571 CASE(CL_QUEUED) // 0x3
574 /* cl_buffer_create_type */
575 #ifdef CL_VERSION_1_1
576 CASE(CL_BUFFER_CREATE_TYPE_REGION) // 0x1220
577 #endif //CL_VERSION_1_1
579 /* cl_profiling_info */
580 CASE(CL_PROFILING_COMMAND_QUEUED) // 0x1280
581 CASE(CL_PROFILING_COMMAND_SUBMIT) // 0x1281
582 CASE(CL_PROFILING_COMMAND_START) // 0x1282
583 CASE(CL_PROFILING_COMMAND_END) // 0x1283
585 default:
586 return "(unrecognized enum)";
589 #undef CASE
592 const char* piglit_cl_get_error_name(cl_int error) {
593 #define CASE(x) case x: return #x;
595 switch (error) {
596 CASE(CL_SUCCESS) // 0
597 CASE(CL_DEVICE_NOT_FOUND) // -1
598 CASE(CL_DEVICE_NOT_AVAILABLE) // -2
599 CASE(CL_COMPILER_NOT_AVAILABLE) // -3
600 CASE(CL_MEM_OBJECT_ALLOCATION_FAILURE) // -4
601 CASE(CL_OUT_OF_RESOURCES) // -5
602 CASE(CL_OUT_OF_HOST_MEMORY) // -6
603 CASE(CL_PROFILING_INFO_NOT_AVAILABLE) // -7
604 CASE(CL_MEM_COPY_OVERLAP) // -8
605 CASE(CL_IMAGE_FORMAT_MISMATCH) // -9
606 CASE(CL_IMAGE_FORMAT_NOT_SUPPORTED) // -10
607 CASE(CL_BUILD_PROGRAM_FAILURE) // -11
608 CASE(CL_MAP_FAILURE) // -12
609 #ifdef CL_VERSION_1_1
610 CASE(CL_MISALIGNED_SUB_BUFFER_OFFSET) // -13
611 CASE(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST) // -14
612 #endif //CL_VERSION_1_1
613 #ifdef CL_VERSION_1_2
614 CASE(CL_COMPILE_PROGRAM_FAILURE) // -15
615 CASE(CL_LINKER_NOT_AVAILABLE) // -16
616 CASE(CL_LINK_PROGRAM_FAILURE) // -17
617 CASE(CL_DEVICE_PARTITION_FAILED) // -18
618 CASE(CL_KERNEL_ARG_INFO_NOT_AVAILABLE) // -19
619 #endif //CL_VERSION_1_2
621 CASE(CL_INVALID_VALUE) // -30
622 CASE(CL_INVALID_DEVICE_TYPE) // -31
623 CASE(CL_INVALID_PLATFORM) // -32
624 CASE(CL_INVALID_DEVICE) // -33
625 CASE(CL_INVALID_CONTEXT) // -34
626 CASE(CL_INVALID_QUEUE_PROPERTIES) // -35
627 CASE(CL_INVALID_COMMAND_QUEUE) // -36
628 CASE(CL_INVALID_HOST_PTR) // -37
629 CASE(CL_INVALID_MEM_OBJECT) // -38
630 CASE(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR) // -39
631 CASE(CL_INVALID_IMAGE_SIZE) // -40
632 CASE(CL_INVALID_SAMPLER) // -41
633 CASE(CL_INVALID_BINARY) // -42
634 CASE(CL_INVALID_BUILD_OPTIONS) // -43
635 CASE(CL_INVALID_PROGRAM) // -44
636 CASE(CL_INVALID_PROGRAM_EXECUTABLE) // -45
637 CASE(CL_INVALID_KERNEL_NAME) // -46
638 CASE(CL_INVALID_KERNEL_DEFINITION) // -47
639 CASE(CL_INVALID_KERNEL) // -48
640 CASE(CL_INVALID_ARG_INDEX) // -49
641 CASE(CL_INVALID_ARG_VALUE) // -50
642 CASE(CL_INVALID_ARG_SIZE) // -51
643 CASE(CL_INVALID_KERNEL_ARGS) // -52
644 CASE(CL_INVALID_WORK_DIMENSION) // -53
645 CASE(CL_INVALID_WORK_GROUP_SIZE) // -54
646 CASE(CL_INVALID_WORK_ITEM_SIZE) // -55
647 CASE(CL_INVALID_GLOBAL_OFFSET) // -56
648 CASE(CL_INVALID_EVENT_WAIT_LIST) // -57
649 CASE(CL_INVALID_EVENT) // -58
650 CASE(CL_INVALID_OPERATION) // -59
651 CASE(CL_INVALID_GL_OBJECT) // -60
652 CASE(CL_INVALID_BUFFER_SIZE) // -61
653 CASE(CL_INVALID_MIP_LEVEL) // -62
654 CASE(CL_INVALID_GLOBAL_WORK_SIZE) // -63
655 #ifdef CL_VERSION_1_1
656 CASE(CL_INVALID_PROPERTY) // -64
657 #endif //CL_VERSION_1_1
658 #ifdef CL_VERSION_1_2
659 CASE(CL_INVALID_IMAGE_DESCRIPTOR) // -65
660 CASE(CL_INVALID_COMPILER_OPTIONS) // -66
661 CASE(CL_INVALID_LINKER_OPTIONS) // -67
662 CASE(CL_INVALID_DEVICE_PARTITION_COUNT) // -68
663 #endif //CL_VERSION_1_2
664 #ifdef CL_VERSION_2_0
665 CASE(CL_INVALID_PIPE_SIZE) // -69
666 CASE(CL_INVALID_DEVICE_QUEUE) // -70
667 #endif // CL_VERSION_2_0
668 #ifdef CL_VERSION_2_2
669 CASE(CL_INVALID_SPEC_ID) // -71
670 CASE(CL_MAX_SIZE_RESTRICTION_EXCEEDED) // -72
671 #endif // CL_VERSION_2_2
673 default:
674 return "(unrecognized error)";
677 #undef CASE
681 #define PIGLIT_CL_DEFINE_ENUM(type, name, count10, count11, count12, count20, count30) \
682 const unsigned int piglit_##name##_num_1_0 = count10; \
683 const unsigned int piglit_##name##_num_1_1 = count11; \
684 const unsigned int piglit_##name##_num_1_2 = count12; \
685 const unsigned int piglit_##name##_num_2_0 = count20; \
686 const unsigned int piglit_##name##_num_3_0 = count30; \
687 const type _piglit_##name[]
689 #define PIGLIT_CL_DEFINE_ENUM_2(name, count10, count11, count12, count20, count30) \
690 PIGLIT_CL_DEFINE_ENUM(name, name, count10, count11, count12, count20, count30)
692 #define PIGLIT_CL_DEFINE_ENUM_PTR(type, name) \
693 const type* piglit_##name = _piglit_##name;
695 #define PIGLIT_CL_DEFINE_ENUM_PTR_2(name) \
696 PIGLIT_CL_DEFINE_ENUM_PTR(name, name)
699 PIGLIT_CL_DEFINE_ENUM_2(cl_mem_flags, 6, 6, 9, 10, 10) = {
700 CL_MEM_READ_WRITE,
701 CL_MEM_READ_ONLY,
702 CL_MEM_WRITE_ONLY,
703 CL_MEM_USE_HOST_PTR,
704 CL_MEM_ALLOC_HOST_PTR, // 5
705 CL_MEM_COPY_HOST_PTR,
706 #if defined(CL_VERSION_1_2)
707 CL_MEM_HOST_WRITE_ONLY,
708 CL_MEM_HOST_READ_ONLY,
709 CL_MEM_HOST_NO_ACCESS,
710 #endif //CL_VERSION_1_2
711 #if defined(CL_VERSION_2_0)
712 CL_MEM_KERNEL_READ_AND_WRITE,
713 #endif //CL_VERSION_2_0
715 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_mem_flags);
717 PIGLIT_CL_DEFINE_ENUM_2(cl_device_type, 5, 5, 6, 6, 6) = {
718 CL_DEVICE_TYPE_CPU,
719 CL_DEVICE_TYPE_GPU,
720 CL_DEVICE_TYPE_ACCELERATOR,
721 CL_DEVICE_TYPE_DEFAULT,
722 CL_DEVICE_TYPE_ALL, // 5
723 #if defined(CL_VERSION_1_2)
724 CL_DEVICE_TYPE_CUSTOM,
725 #endif
727 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_device_type);
729 PIGLIT_CL_DEFINE_ENUM_2(cl_program_info, 7, 7, 9, 9, 9) = {
730 CL_PROGRAM_REFERENCE_COUNT,
731 CL_PROGRAM_CONTEXT,
732 CL_PROGRAM_NUM_DEVICES,
733 CL_PROGRAM_DEVICES,
734 CL_PROGRAM_SOURCE, // 5
735 CL_PROGRAM_BINARY_SIZES,
736 CL_PROGRAM_BINARIES,
737 #ifdef CL_VERSION_1_2
738 CL_PROGRAM_NUM_KERNELS,
739 CL_PROGRAM_KERNEL_NAMES,
740 #endif //CL_VERSION_1_2
742 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_program_info);
744 PIGLIT_CL_DEFINE_ENUM_2(cl_program_build_info, 3, 3, 4, 5, 5) = {
745 CL_PROGRAM_BUILD_STATUS,
746 CL_PROGRAM_BUILD_OPTIONS,
747 CL_PROGRAM_BUILD_LOG,
748 #ifdef CL_VERSION_1_2
749 CL_PROGRAM_BINARY_TYPE,
750 #endif //CL_VERSION_1_2
751 #ifdef CL_VERSION_2_0
752 CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE,
753 #endif //CL_VERSION_2_0
755 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_program_build_info);
757 PIGLIT_CL_DEFINE_ENUM_2(cl_mem_info, 7, 9, 9, 10, 10) = {
758 CL_MEM_TYPE,
759 CL_MEM_FLAGS,
760 CL_MEM_SIZE,
761 CL_MEM_HOST_PTR,
762 CL_MEM_MAP_COUNT, // 5
763 CL_MEM_REFERENCE_COUNT,
764 CL_MEM_CONTEXT,
765 #ifdef CL_VERSION_1_1
766 CL_MEM_ASSOCIATED_MEMOBJECT,
767 CL_MEM_OFFSET,
768 #endif //CL_VERSION_1_1
769 #ifdef CL_VERSION_2_0
770 CL_MEM_USES_SVM_POINTER,
771 #endif //CL_VERSION_2_0
773 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_mem_info);
775 PIGLIT_CL_DEFINE_ENUM_2(cl_kernel_info, 5, 5, 6, 6, 6) = {
776 CL_KERNEL_FUNCTION_NAME,
777 CL_KERNEL_NUM_ARGS,
778 CL_KERNEL_REFERENCE_COUNT,
779 CL_KERNEL_CONTEXT,
780 CL_KERNEL_PROGRAM, // 5
781 #ifdef CL_VERSION_1_2
782 CL_KERNEL_ATTRIBUTES,
783 #endif //CL_VERSION_1_2
785 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_kernel_info);
787 #ifdef CL_VERSION_1_2
788 PIGLIT_CL_DEFINE_ENUM_2(cl_kernel_arg_info, 0, 0, 5, 5, 5) = {
789 CL_KERNEL_ARG_ADDRESS_QUALIFIER,
790 CL_KERNEL_ARG_ACCESS_QUALIFIER,
791 CL_KERNEL_ARG_TYPE_NAME,
792 CL_KERNEL_ARG_TYPE_QUALIFIER,
793 CL_KERNEL_ARG_NAME, //5
795 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_kernel_arg_info);
796 #endif //CL_VERSION_1_2
798 PIGLIT_CL_DEFINE_ENUM_2(cl_kernel_work_group_info, 3, 5, 6, 6, 6) = {
799 CL_KERNEL_WORK_GROUP_SIZE,
800 CL_KERNEL_COMPILE_WORK_GROUP_SIZE,
801 CL_KERNEL_LOCAL_MEM_SIZE,
802 #ifdef CL_VERSION_1_1
803 CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
804 CL_KERNEL_PRIVATE_MEM_SIZE, // 5
805 #endif //CL_VERSION_1_1
806 #ifdef CL_VERSION_1_2
807 CL_KERNEL_GLOBAL_WORK_SIZE,
808 #endif //CL_VERSION_1_2
810 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_kernel_work_group_info);
812 PIGLIT_CL_DEFINE_ENUM_2(cl_event_info, 4, 5, 5, 5, 5) = {
813 CL_EVENT_COMMAND_QUEUE,
814 CL_EVENT_COMMAND_TYPE,
815 CL_EVENT_REFERENCE_COUNT,
816 CL_EVENT_COMMAND_EXECUTION_STATUS,
817 #ifdef CL_VERSION_1_1
818 CL_EVENT_CONTEXT, // 5
819 #endif //CL_VERSION_1_1
821 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_event_info);
823 PIGLIT_CL_DEFINE_ENUM_2(cl_image_info, 7, 7, 11, 11, 11) = {
824 CL_IMAGE_FORMAT,
825 CL_IMAGE_ELEMENT_SIZE,
826 CL_IMAGE_ROW_PITCH,
827 CL_IMAGE_SLICE_PITCH,
828 CL_IMAGE_WIDTH, // 5
829 CL_IMAGE_HEIGHT,
830 CL_IMAGE_DEPTH,
831 #ifdef CL_VERSION_1_2
832 CL_IMAGE_ARRAY_SIZE,
833 CL_IMAGE_NUM_SAMPLES,
834 CL_IMAGE_NUM_MIP_LEVELS, // 10
835 CL_IMAGE_BUFFER, // Deprecated in 2.0
836 #endif //CL_VERSION_1_2
838 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_image_info);
840 PIGLIT_CL_DEFINE_ENUM_2(cl_command_queue_info, 4, 4, 4, 5, 5) = {
841 CL_QUEUE_CONTEXT,
842 CL_QUEUE_DEVICE,
843 CL_QUEUE_REFERENCE_COUNT,
844 CL_QUEUE_PROPERTIES,
845 #ifdef CL_VERSION_2_0
846 CL_QUEUE_SIZE,
847 #endif //CL_VERSION_2_0
849 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_command_queue_info);
851 PIGLIT_CL_DEFINE_ENUM_2(cl_context_info, 3, 4, 4, 4, 4) = {
852 CL_CONTEXT_REFERENCE_COUNT,
853 CL_CONTEXT_DEVICES,
854 CL_CONTEXT_PROPERTIES,
855 #if defined(CL_VERSION_1_1)
856 CL_CONTEXT_NUM_DEVICES,
857 #endif //CL_VERSION_1_1
859 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_context_info);
861 PIGLIT_CL_DEFINE_ENUM_2(cl_platform_info, 5, 5, 5, 5, 5) = {
862 CL_PLATFORM_PROFILE,
863 CL_PLATFORM_VERSION,
864 CL_PLATFORM_NAME,
865 CL_PLATFORM_VENDOR,
866 CL_PLATFORM_EXTENSIONS // 5
868 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_platform_info);
870 PIGLIT_CL_DEFINE_ENUM_2(cl_device_info, 50, 60, 73, 74, 88) = {
871 CL_DEVICE_NAME,
872 CL_DEVICE_VENDOR,
873 CL_DEVICE_VENDOR_ID,
874 CL_DEVICE_VERSION,
875 CL_DRIVER_VERSION, // 5
876 CL_DEVICE_TYPE,
877 CL_DEVICE_PROFILE,
878 CL_DEVICE_MAX_CLOCK_FREQUENCY,
879 CL_DEVICE_MAX_COMPUTE_UNITS,
880 CL_DEVICE_IMAGE_SUPPORT, // 10
881 CL_DEVICE_EXTENSIONS,
882 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,
883 CL_DEVICE_MAX_WORK_GROUP_SIZE,
884 CL_DEVICE_MAX_WORK_ITEM_SIZES,
885 CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, // 15
886 CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT,
887 CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT,
888 CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG,
889 CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT,
890 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, // 20
891 CL_DEVICE_ADDRESS_BITS,
892 CL_DEVICE_MAX_READ_IMAGE_ARGS,
893 CL_DEVICE_MAX_WRITE_IMAGE_ARGS,
894 CL_DEVICE_GLOBAL_MEM_SIZE,
895 CL_DEVICE_MAX_MEM_ALLOC_SIZE, // 25
896 CL_DEVICE_IMAGE2D_MAX_WIDTH,
897 CL_DEVICE_IMAGE2D_MAX_HEIGHT,
898 CL_DEVICE_IMAGE3D_MAX_WIDTH,
899 CL_DEVICE_IMAGE3D_MAX_HEIGHT,
900 CL_DEVICE_IMAGE3D_MAX_DEPTH, // 30
901 CL_DEVICE_MAX_PARAMETER_SIZE,
902 CL_DEVICE_MAX_SAMPLERS,
903 CL_DEVICE_MEM_BASE_ADDR_ALIGN,
904 CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE,
905 CL_DEVICE_SINGLE_FP_CONFIG, //35
906 CL_DEVICE_GLOBAL_MEM_CACHE_TYPE,
907 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE,
908 CL_DEVICE_GLOBAL_MEM_CACHE_SIZE,
909 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE,
910 CL_DEVICE_MAX_CONSTANT_ARGS, // 40
911 CL_DEVICE_LOCAL_MEM_TYPE,
912 CL_DEVICE_LOCAL_MEM_SIZE,
913 CL_DEVICE_ERROR_CORRECTION_SUPPORT,
914 CL_DEVICE_PROFILING_TIMER_RESOLUTION,
915 CL_DEVICE_ENDIAN_LITTLE, // 45
916 CL_DEVICE_AVAILABLE,
917 CL_DEVICE_COMPILER_AVAILABLE,
918 CL_DEVICE_EXECUTION_CAPABILITIES,
919 CL_DEVICE_QUEUE_PROPERTIES, // Deprecated in 2.0
920 CL_DEVICE_PLATFORM, // 50
921 #if defined(CL_VERSION_1_1)
922 CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF,
923 CL_DEVICE_HOST_UNIFIED_MEMORY, // Deprecated in 2.0
924 CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR,
925 CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT,
926 CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, // 55
927 CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG,
928 CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT,
929 CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE,
930 CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF,
931 CL_DEVICE_OPENCL_C_VERSION, // 60
932 #endif //CL_VERSION_1_1
933 #if defined(CL_VERSION_1_2)
934 CL_DEVICE_DOUBLE_FP_CONFIG,
935 CL_DEVICE_LINKER_AVAILABLE,
936 CL_DEVICE_BUILT_IN_KERNELS,
937 CL_DEVICE_IMAGE_MAX_BUFFER_SIZE,
938 CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, // 65
939 CL_DEVICE_PARENT_DEVICE,
940 CL_DEVICE_PARTITION_MAX_SUB_DEVICES,
941 CL_DEVICE_PARTITION_PROPERTIES,
942 CL_DEVICE_PARTITION_AFFINITY_DOMAIN,
943 CL_DEVICE_PARTITION_TYPE, // 70
944 CL_DEVICE_REFERENCE_COUNT,
945 CL_DEVICE_PREFERRED_INTEROP_USER_SYNC,
946 CL_DEVICE_PRINTF_BUFFER_SIZE, // 73
947 #endif //CL_VERSION_1_2
948 #if defined(CL_VERSION_2_0)
949 CL_DEVICE_QUEUE_ON_HOST_PROPERTIES,
950 #endif //CL_VERSION_2_0
951 #if defined(CL_VERSION_3_0)
952 CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION,
953 CL_DEVICE_NUMERIC_VERSION,
954 CL_DEVICE_OPENCL_C_ALL_VERSIONS,
955 CL_DEVICE_OPENCL_C_FEATURES,
956 CL_DEVICE_EXTENSIONS_WITH_VERSION,
957 CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES,
958 CL_DEVICE_ATOMIC_FENCE_CAPABILITIES,
959 CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT,
960 CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT,
961 CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
962 CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES,
963 CL_DEVICE_PIPE_SUPPORT,
964 CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
965 CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED,
966 #endif //CL_VERSION_3_0
969 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_device_info);
971 PIGLIT_CL_DEFINE_ENUM_2(cl_command_queue_properties, 2, 2, 2, 4, 4 /* really? */) = {
972 CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
973 CL_QUEUE_PROFILING_ENABLE,
974 #if defined(CL_VERSION_2_0)
975 CL_QUEUE_ON_DEVICE,
976 CL_QUEUE_ON_DEVICE_DEFAULT,
977 #endif //CL_VERSION_2_0
979 PIGLIT_CL_DEFINE_ENUM_PTR_2(cl_command_queue_properties);
982 PIGLIT_CL_DEFINE_ENUM(cl_mem_flags, cl_mem_flags_mutexes, 5, 5, 8, 8, 8) = {
983 CL_MEM_READ_WRITE | CL_MEM_READ_ONLY,
984 CL_MEM_READ_WRITE | CL_MEM_WRITE_ONLY,
985 CL_MEM_READ_ONLY | CL_MEM_WRITE_ONLY,
986 CL_MEM_ALLOC_HOST_PTR | CL_MEM_USE_HOST_PTR,
987 CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR, // 5
988 #if defined(CL_VERSION_1_2)
989 CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_READ_ONLY,
990 CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS,
991 CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS,
992 #endif //CL_VERSION_1_2
994 PIGLIT_CL_DEFINE_ENUM_PTR(cl_mem_flags, cl_mem_flags_mutexes);
996 PIGLIT_CL_DEFINE_ENUM(cl_command_queue_properties, cl_command_queue_properties_mutexes, 0, 0, 0, 8, 8 /* maybe */) = {
997 #if defined(CL_VERSION_2_0)
998 // CL_QUEUE_ON_DEVICE requires CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
999 CL_QUEUE_ON_DEVICE,
1000 CL_QUEUE_ON_DEVICE | CL_QUEUE_PROFILING_ENABLE,
1001 // CL_QUEUE_ON_DEVICE_DEFAULT requires CL_QUEUE_ON_DEVICE
1002 CL_QUEUE_ON_DEVICE_DEFAULT,
1003 CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_ON_DEVICE,
1004 CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_PROFILING_ENABLE,
1005 CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
1006 CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
1007 CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_ON_DEVICE | CL_QUEUE_PROFILING_ENABLE,
1008 #endif //CL_VERSION_2_0
1010 PIGLIT_CL_DEFINE_ENUM_PTR(cl_command_queue_properties, cl_command_queue_properties_mutexes);
1013 #undef PIGLIT_CL_DEFINE_ENUM
1014 #undef PIGLIT_CL_DEFINE_ENUM_2
1015 #undef PIGLIT_CL_DEFINE_ENUM_PTR
1016 #undef PIGLIT_CL_DEFINE_ENUM_PTR_2