cl.h 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240
  1. /*******************************************************************************
  2. * Copyright (c) 2011 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. #ifndef __OPENCL_CL_H
  24. #define __OPENCL_CL_H
  25. #ifdef __APPLE__
  26. #include <OpenCL/cl_platform.h>
  27. #else
  28. #include "cl_platform.h"
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /******************************************************************************/
  34. typedef struct _cl_platform_id * cl_platform_id;
  35. typedef struct _cl_device_id * cl_device_id;
  36. typedef struct _cl_context * cl_context;
  37. typedef struct _cl_command_queue * cl_command_queue;
  38. typedef struct _cl_mem * cl_mem;
  39. typedef struct _cl_program * cl_program;
  40. typedef struct _cl_kernel * cl_kernel;
  41. typedef struct _cl_event * cl_event;
  42. typedef struct _cl_sampler * cl_sampler;
  43. 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. */
  44. typedef cl_ulong cl_bitfield;
  45. typedef cl_bitfield cl_device_type;
  46. typedef cl_uint cl_platform_info;
  47. typedef cl_uint cl_device_info;
  48. typedef cl_bitfield cl_device_fp_config;
  49. typedef cl_uint cl_device_mem_cache_type;
  50. typedef cl_uint cl_device_local_mem_type;
  51. typedef cl_bitfield cl_device_exec_capabilities;
  52. typedef cl_bitfield cl_command_queue_properties;
  53. typedef intptr_t cl_device_partition_property;
  54. typedef cl_bitfield cl_device_affinity_domain;
  55. typedef intptr_t cl_context_properties;
  56. typedef cl_uint cl_context_info;
  57. typedef cl_uint cl_command_queue_info;
  58. typedef cl_uint cl_channel_order;
  59. typedef cl_uint cl_channel_type;
  60. typedef cl_bitfield cl_mem_flags;
  61. typedef cl_uint cl_mem_object_type;
  62. typedef cl_uint cl_mem_info;
  63. typedef cl_bitfield cl_mem_migration_flags;
  64. typedef cl_uint cl_image_info;
  65. typedef cl_uint cl_buffer_create_type;
  66. typedef cl_uint cl_addressing_mode;
  67. typedef cl_uint cl_filter_mode;
  68. typedef cl_uint cl_sampler_info;
  69. typedef cl_bitfield cl_map_flags;
  70. typedef cl_uint cl_program_info;
  71. typedef cl_uint cl_program_build_info;
  72. typedef cl_uint cl_program_binary_type;
  73. typedef cl_int cl_build_status;
  74. typedef cl_uint cl_kernel_info;
  75. typedef cl_uint cl_kernel_arg_info;
  76. typedef cl_uint cl_kernel_arg_address_qualifier;
  77. typedef cl_uint cl_kernel_arg_access_qualifier;
  78. typedef cl_bitfield cl_kernel_arg_type_qualifier;
  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. typedef struct _cl_image_format {
  84. cl_channel_order image_channel_order;
  85. cl_channel_type image_channel_data_type;
  86. } cl_image_format;
  87. typedef struct _cl_image_desc {
  88. cl_mem_object_type image_type;
  89. size_t image_width;
  90. size_t image_height;
  91. size_t image_depth;
  92. size_t image_array_size;
  93. size_t image_row_pitch;
  94. size_t image_slice_pitch;
  95. cl_uint num_mip_levels;
  96. cl_uint num_samples;
  97. cl_mem buffer;
  98. } cl_image_desc;
  99. typedef struct _cl_buffer_region {
  100. size_t origin;
  101. size_t size;
  102. } cl_buffer_region;
  103. /******************************************************************************/
  104. /* Error Codes */
  105. #define CL_SUCCESS 0
  106. #define CL_DEVICE_NOT_FOUND -1
  107. #define CL_DEVICE_NOT_AVAILABLE -2
  108. #define CL_COMPILER_NOT_AVAILABLE -3
  109. #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
  110. #define CL_OUT_OF_RESOURCES -5
  111. #define CL_OUT_OF_HOST_MEMORY -6
  112. #define CL_PROFILING_INFO_NOT_AVAILABLE -7
  113. #define CL_MEM_COPY_OVERLAP -8
  114. #define CL_IMAGE_FORMAT_MISMATCH -9
  115. #define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
  116. #define CL_BUILD_PROGRAM_FAILURE -11
  117. #define CL_MAP_FAILURE -12
  118. #define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
  119. #define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
  120. #define CL_COMPILE_PROGRAM_FAILURE -15
  121. #define CL_LINKER_NOT_AVAILABLE -16
  122. #define CL_LINK_PROGRAM_FAILURE -17
  123. #define CL_DEVICE_PARTITION_FAILED -18
  124. #define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19
  125. #define CL_INVALID_VALUE -30
  126. #define CL_INVALID_DEVICE_TYPE -31
  127. #define CL_INVALID_PLATFORM -32
  128. #define CL_INVALID_DEVICE -33
  129. #define CL_INVALID_CONTEXT -34
  130. #define CL_INVALID_QUEUE_PROPERTIES -35
  131. #define CL_INVALID_COMMAND_QUEUE -36
  132. #define CL_INVALID_HOST_PTR -37
  133. #define CL_INVALID_MEM_OBJECT -38
  134. #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
  135. #define CL_INVALID_IMAGE_SIZE -40
  136. #define CL_INVALID_SAMPLER -41
  137. #define CL_INVALID_BINARY -42
  138. #define CL_INVALID_BUILD_OPTIONS -43
  139. #define CL_INVALID_PROGRAM -44
  140. #define CL_INVALID_PROGRAM_EXECUTABLE -45
  141. #define CL_INVALID_KERNEL_NAME -46
  142. #define CL_INVALID_KERNEL_DEFINITION -47
  143. #define CL_INVALID_KERNEL -48
  144. #define CL_INVALID_ARG_INDEX -49
  145. #define CL_INVALID_ARG_VALUE -50
  146. #define CL_INVALID_ARG_SIZE -51
  147. #define CL_INVALID_KERNEL_ARGS -52
  148. #define CL_INVALID_WORK_DIMENSION -53
  149. #define CL_INVALID_WORK_GROUP_SIZE -54
  150. #define CL_INVALID_WORK_ITEM_SIZE -55
  151. #define CL_INVALID_GLOBAL_OFFSET -56
  152. #define CL_INVALID_EVENT_WAIT_LIST -57
  153. #define CL_INVALID_EVENT -58
  154. #define CL_INVALID_OPERATION -59
  155. #define CL_INVALID_GL_OBJECT -60
  156. #define CL_INVALID_BUFFER_SIZE -61
  157. #define CL_INVALID_MIP_LEVEL -62
  158. #define CL_INVALID_GLOBAL_WORK_SIZE -63
  159. #define CL_INVALID_PROPERTY -64
  160. #define CL_INVALID_IMAGE_DESCRIPTOR -65
  161. #define CL_INVALID_COMPILER_OPTIONS -66
  162. #define CL_INVALID_LINKER_OPTIONS -67
  163. #define CL_INVALID_DEVICE_PARTITION_COUNT -68
  164. /* OpenCL Version */
  165. #define CL_VERSION_1_0 1
  166. #define CL_VERSION_1_1 1
  167. #define CL_VERSION_1_2 1
  168. /* cl_bool */
  169. #define CL_FALSE 0
  170. #define CL_TRUE 1
  171. #define CL_BLOCKING CL_TRUE
  172. #define CL_NON_BLOCKING CL_FALSE
  173. /* cl_platform_info */
  174. #define CL_PLATFORM_PROFILE 0x0900
  175. #define CL_PLATFORM_VERSION 0x0901
  176. #define CL_PLATFORM_NAME 0x0902
  177. #define CL_PLATFORM_VENDOR 0x0903
  178. #define CL_PLATFORM_EXTENSIONS 0x0904
  179. /* cl_device_type - bitfield */
  180. #define CL_DEVICE_TYPE_DEFAULT (1 << 0)
  181. #define CL_DEVICE_TYPE_CPU (1 << 1)
  182. #define CL_DEVICE_TYPE_GPU (1 << 2)
  183. #define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
  184. #define CL_DEVICE_TYPE_CUSTOM (1 << 4)
  185. #define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
  186. /* cl_device_info */
  187. #define CL_DEVICE_TYPE 0x1000
  188. #define CL_DEVICE_VENDOR_ID 0x1001
  189. #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
  190. #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
  191. #define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
  192. #define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
  193. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
  194. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
  195. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
  196. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
  197. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
  198. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
  199. #define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
  200. #define CL_DEVICE_ADDRESS_BITS 0x100D
  201. #define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
  202. #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
  203. #define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
  204. #define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
  205. #define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
  206. #define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
  207. #define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
  208. #define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
  209. #define CL_DEVICE_IMAGE_SUPPORT 0x1016
  210. #define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
  211. #define CL_DEVICE_MAX_SAMPLERS 0x1018
  212. #define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
  213. #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
  214. #define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
  215. #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
  216. #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
  217. #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
  218. #define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
  219. #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
  220. #define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
  221. #define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
  222. #define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
  223. #define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
  224. #define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
  225. #define CL_DEVICE_ENDIAN_LITTLE 0x1026
  226. #define CL_DEVICE_AVAILABLE 0x1027
  227. #define CL_DEVICE_COMPILER_AVAILABLE 0x1028
  228. #define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
  229. #define CL_DEVICE_QUEUE_PROPERTIES 0x102A
  230. #define CL_DEVICE_NAME 0x102B
  231. #define CL_DEVICE_VENDOR 0x102C
  232. #define CL_DRIVER_VERSION 0x102D
  233. #define CL_DEVICE_PROFILE 0x102E
  234. #define CL_DEVICE_VERSION 0x102F
  235. #define CL_DEVICE_EXTENSIONS 0x1030
  236. #define CL_DEVICE_PLATFORM 0x1031
  237. #define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
  238. /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
  239. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
  240. #define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
  241. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
  242. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037
  243. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038
  244. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039
  245. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A
  246. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
  247. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
  248. #define CL_DEVICE_OPENCL_C_VERSION 0x103D
  249. #define CL_DEVICE_LINKER_AVAILABLE 0x103E
  250. #define CL_DEVICE_BUILT_IN_KERNELS 0x103F
  251. #define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040
  252. #define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041
  253. #define CL_DEVICE_PARENT_DEVICE 0x1042
  254. #define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043
  255. #define CL_DEVICE_PARTITION_PROPERTIES 0x1044
  256. #define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045
  257. #define CL_DEVICE_PARTITION_TYPE 0x1046
  258. #define CL_DEVICE_REFERENCE_COUNT 0x1047
  259. #define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048
  260. #define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
  261. /* cl_device_fp_config - bitfield */
  262. #define CL_FP_DENORM (1 << 0)
  263. #define CL_FP_INF_NAN (1 << 1)
  264. #define CL_FP_ROUND_TO_NEAREST (1 << 2)
  265. #define CL_FP_ROUND_TO_ZERO (1 << 3)
  266. #define CL_FP_ROUND_TO_INF (1 << 4)
  267. #define CL_FP_FMA (1 << 5)
  268. #define CL_FP_SOFT_FLOAT (1 << 6)
  269. #define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
  270. /* cl_device_mem_cache_type */
  271. #define CL_NONE 0x0
  272. #define CL_READ_ONLY_CACHE 0x1
  273. #define CL_READ_WRITE_CACHE 0x2
  274. /* cl_device_local_mem_type */
  275. #define CL_LOCAL 0x1
  276. #define CL_GLOBAL 0x2
  277. /* cl_device_exec_capabilities - bitfield */
  278. #define CL_EXEC_KERNEL (1 << 0)
  279. #define CL_EXEC_NATIVE_KERNEL (1 << 1)
  280. /* cl_command_queue_properties - bitfield */
  281. #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
  282. #define CL_QUEUE_PROFILING_ENABLE (1 << 1)
  283. /* cl_context_info */
  284. #define CL_CONTEXT_REFERENCE_COUNT 0x1080
  285. #define CL_CONTEXT_DEVICES 0x1081
  286. #define CL_CONTEXT_PROPERTIES 0x1082
  287. #define CL_CONTEXT_NUM_DEVICES 0x1083
  288. /* cl_context_properties */
  289. #define CL_CONTEXT_PLATFORM 0x1084
  290. #define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
  291. /* cl_device_partition_property */
  292. #define CL_DEVICE_PARTITION_EQUALLY 0x1086
  293. #define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
  294. #define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
  295. #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
  296. /* cl_device_affinity_domain */
  297. #define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
  298. #define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
  299. #define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
  300. #define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
  301. #define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
  302. #define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
  303. /* cl_command_queue_info */
  304. #define CL_QUEUE_CONTEXT 0x1090
  305. #define CL_QUEUE_DEVICE 0x1091
  306. #define CL_QUEUE_REFERENCE_COUNT 0x1092
  307. #define CL_QUEUE_PROPERTIES 0x1093
  308. /* cl_mem_flags - bitfield */
  309. #define CL_MEM_READ_WRITE (1 << 0)
  310. #define CL_MEM_WRITE_ONLY (1 << 1)
  311. #define CL_MEM_READ_ONLY (1 << 2)
  312. #define CL_MEM_USE_HOST_PTR (1 << 3)
  313. #define CL_MEM_ALLOC_HOST_PTR (1 << 4)
  314. #define CL_MEM_COPY_HOST_PTR (1 << 5)
  315. // reserved (1 << 6)
  316. #define CL_MEM_HOST_WRITE_ONLY (1 << 7)
  317. #define CL_MEM_HOST_READ_ONLY (1 << 8)
  318. #define CL_MEM_HOST_NO_ACCESS (1 << 9)
  319. /* cl_mem_migration_flags - bitfield */
  320. #define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
  321. #define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
  322. /* cl_channel_order */
  323. #define CL_R 0x10B0
  324. #define CL_A 0x10B1
  325. #define CL_RG 0x10B2
  326. #define CL_RA 0x10B3
  327. #define CL_RGB 0x10B4
  328. #define CL_RGBA 0x10B5
  329. #define CL_BGRA 0x10B6
  330. #define CL_ARGB 0x10B7
  331. #define CL_INTENSITY 0x10B8
  332. #define CL_LUMINANCE 0x10B9
  333. #define CL_Rx 0x10BA
  334. #define CL_RGx 0x10BB
  335. #define CL_RGBx 0x10BC
  336. /* cl_channel_type */
  337. #define CL_SNORM_INT8 0x10D0
  338. #define CL_SNORM_INT16 0x10D1
  339. #define CL_UNORM_INT8 0x10D2
  340. #define CL_UNORM_INT16 0x10D3
  341. #define CL_UNORM_SHORT_565 0x10D4
  342. #define CL_UNORM_SHORT_555 0x10D5
  343. #define CL_UNORM_INT_101010 0x10D6
  344. #define CL_SIGNED_INT8 0x10D7
  345. #define CL_SIGNED_INT16 0x10D8
  346. #define CL_SIGNED_INT32 0x10D9
  347. #define CL_UNSIGNED_INT8 0x10DA
  348. #define CL_UNSIGNED_INT16 0x10DB
  349. #define CL_UNSIGNED_INT32 0x10DC
  350. #define CL_HALF_FLOAT 0x10DD
  351. #define CL_FLOAT 0x10DE
  352. /* cl_mem_object_type */
  353. #define CL_MEM_OBJECT_BUFFER 0x10F0
  354. #define CL_MEM_OBJECT_IMAGE2D 0x10F1
  355. #define CL_MEM_OBJECT_IMAGE3D 0x10F2
  356. #define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
  357. #define CL_MEM_OBJECT_IMAGE1D 0x10F4
  358. #define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
  359. #define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
  360. /* cl_mem_info */
  361. #define CL_MEM_TYPE 0x1100
  362. #define CL_MEM_FLAGS 0x1101
  363. #define CL_MEM_SIZE 0x1102
  364. #define CL_MEM_HOST_PTR 0x1103
  365. #define CL_MEM_MAP_COUNT 0x1104
  366. #define CL_MEM_REFERENCE_COUNT 0x1105
  367. #define CL_MEM_CONTEXT 0x1106
  368. #define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107
  369. #define CL_MEM_OFFSET 0x1108
  370. /* cl_image_info */
  371. #define CL_IMAGE_FORMAT 0x1110
  372. #define CL_IMAGE_ELEMENT_SIZE 0x1111
  373. #define CL_IMAGE_ROW_PITCH 0x1112
  374. #define CL_IMAGE_SLICE_PITCH 0x1113
  375. #define CL_IMAGE_WIDTH 0x1114
  376. #define CL_IMAGE_HEIGHT 0x1115
  377. #define CL_IMAGE_DEPTH 0x1116
  378. #define CL_IMAGE_ARRAY_SIZE 0x1117
  379. #define CL_IMAGE_BUFFER 0x1118
  380. #define CL_IMAGE_NUM_MIP_LEVELS 0x1119
  381. #define CL_IMAGE_NUM_SAMPLES 0x111A
  382. /* cl_addressing_mode */
  383. #define CL_ADDRESS_NONE 0x1130
  384. #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
  385. #define CL_ADDRESS_CLAMP 0x1132
  386. #define CL_ADDRESS_REPEAT 0x1133
  387. #define CL_ADDRESS_MIRRORED_REPEAT 0x1134
  388. /* cl_filter_mode */
  389. #define CL_FILTER_NEAREST 0x1140
  390. #define CL_FILTER_LINEAR 0x1141
  391. /* cl_sampler_info */
  392. #define CL_SAMPLER_REFERENCE_COUNT 0x1150
  393. #define CL_SAMPLER_CONTEXT 0x1151
  394. #define CL_SAMPLER_NORMALIZED_COORDS 0x1152
  395. #define CL_SAMPLER_ADDRESSING_MODE 0x1153
  396. #define CL_SAMPLER_FILTER_MODE 0x1154
  397. /* cl_map_flags - bitfield */
  398. #define CL_MAP_READ (1 << 0)
  399. #define CL_MAP_WRITE (1 << 1)
  400. #define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
  401. /* cl_program_info */
  402. #define CL_PROGRAM_REFERENCE_COUNT 0x1160
  403. #define CL_PROGRAM_CONTEXT 0x1161
  404. #define CL_PROGRAM_NUM_DEVICES 0x1162
  405. #define CL_PROGRAM_DEVICES 0x1163
  406. #define CL_PROGRAM_SOURCE 0x1164
  407. #define CL_PROGRAM_BINARY_SIZES 0x1165
  408. #define CL_PROGRAM_BINARIES 0x1166
  409. #define CL_PROGRAM_NUM_KERNELS 0x1167
  410. #define CL_PROGRAM_KERNEL_NAMES 0x1168
  411. /* cl_program_build_info */
  412. #define CL_PROGRAM_BUILD_STATUS 0x1181
  413. #define CL_PROGRAM_BUILD_OPTIONS 0x1182
  414. #define CL_PROGRAM_BUILD_LOG 0x1183
  415. #define CL_PROGRAM_BINARY_TYPE 0x1184
  416. /* cl_program_binary_type */
  417. #define CL_PROGRAM_BINARY_TYPE_NONE 0x0
  418. #define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
  419. #define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
  420. #define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
  421. /* cl_build_status */
  422. #define CL_BUILD_SUCCESS 0
  423. #define CL_BUILD_NONE -1
  424. #define CL_BUILD_ERROR -2
  425. #define CL_BUILD_IN_PROGRESS -3
  426. /* cl_kernel_info */
  427. #define CL_KERNEL_FUNCTION_NAME 0x1190
  428. #define CL_KERNEL_NUM_ARGS 0x1191
  429. #define CL_KERNEL_REFERENCE_COUNT 0x1192
  430. #define CL_KERNEL_CONTEXT 0x1193
  431. #define CL_KERNEL_PROGRAM 0x1194
  432. #define CL_KERNEL_ATTRIBUTES 0x1195
  433. /* cl_kernel_arg_info */
  434. #define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
  435. #define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
  436. #define CL_KERNEL_ARG_TYPE_NAME 0x1198
  437. #define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
  438. #define CL_KERNEL_ARG_NAME 0x119A
  439. /* cl_kernel_arg_address_qualifier */
  440. #define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
  441. #define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
  442. #define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
  443. #define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
  444. /* cl_kernel_arg_access_qualifier */
  445. #define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
  446. #define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
  447. #define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
  448. #define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
  449. /* cl_kernel_arg_type_qualifer */
  450. #define CL_KERNEL_ARG_TYPE_NONE 0
  451. #define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
  452. #define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
  453. #define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
  454. /* cl_kernel_work_group_info */
  455. #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
  456. #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
  457. #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
  458. #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
  459. #define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
  460. #define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
  461. /* cl_event_info */
  462. #define CL_EVENT_COMMAND_QUEUE 0x11D0
  463. #define CL_EVENT_COMMAND_TYPE 0x11D1
  464. #define CL_EVENT_REFERENCE_COUNT 0x11D2
  465. #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
  466. #define CL_EVENT_CONTEXT 0x11D4
  467. /* cl_command_type */
  468. #define CL_COMMAND_NDRANGE_KERNEL 0x11F0
  469. #define CL_COMMAND_TASK 0x11F1
  470. #define CL_COMMAND_NATIVE_KERNEL 0x11F2
  471. #define CL_COMMAND_READ_BUFFER 0x11F3
  472. #define CL_COMMAND_WRITE_BUFFER 0x11F4
  473. #define CL_COMMAND_COPY_BUFFER 0x11F5
  474. #define CL_COMMAND_READ_IMAGE 0x11F6
  475. #define CL_COMMAND_WRITE_IMAGE 0x11F7
  476. #define CL_COMMAND_COPY_IMAGE 0x11F8
  477. #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
  478. #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
  479. #define CL_COMMAND_MAP_BUFFER 0x11FB
  480. #define CL_COMMAND_MAP_IMAGE 0x11FC
  481. #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
  482. #define CL_COMMAND_MARKER 0x11FE
  483. #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
  484. #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
  485. #define CL_COMMAND_READ_BUFFER_RECT 0x1201
  486. #define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
  487. #define CL_COMMAND_COPY_BUFFER_RECT 0x1203
  488. #define CL_COMMAND_USER 0x1204
  489. #define CL_COMMAND_BARRIER 0x1205
  490. #define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
  491. #define CL_COMMAND_FILL_BUFFER 0x1207
  492. #define CL_COMMAND_FILL_IMAGE 0x1208
  493. /* command execution status */
  494. #define CL_COMPLETE 0x0
  495. #define CL_RUNNING 0x1
  496. #define CL_SUBMITTED 0x2
  497. #define CL_QUEUED 0x3
  498. /* cl_buffer_create_type */
  499. #define CL_BUFFER_CREATE_TYPE_REGION 0x1220
  500. /* cl_profiling_info */
  501. #define CL_PROFILING_COMMAND_QUEUED 0x1280
  502. #define CL_PROFILING_COMMAND_SUBMIT 0x1281
  503. #define CL_PROFILING_COMMAND_START 0x1282
  504. #define CL_PROFILING_COMMAND_END 0x1283
  505. /********************************************************************************************************/
  506. /* Platform API */
  507. extern CL_API_ENTRY cl_int CL_API_CALL
  508. clGetPlatformIDs(cl_uint /* num_entries */,
  509. cl_platform_id * /* platforms */,
  510. cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
  511. extern CL_API_ENTRY cl_int CL_API_CALL
  512. clGetPlatformInfo(cl_platform_id /* platform */,
  513. cl_platform_info /* param_name */,
  514. size_t /* param_value_size */,
  515. void * /* param_value */,
  516. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  517. /* Device APIs */
  518. extern CL_API_ENTRY cl_int CL_API_CALL
  519. clGetDeviceIDs(cl_platform_id /* platform */,
  520. cl_device_type /* device_type */,
  521. cl_uint /* num_entries */,
  522. cl_device_id * /* devices */,
  523. cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
  524. extern CL_API_ENTRY cl_int CL_API_CALL
  525. clGetDeviceInfo(cl_device_id /* device */,
  526. cl_device_info /* param_name */,
  527. size_t /* param_value_size */,
  528. void * /* param_value */,
  529. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  530. extern CL_API_ENTRY cl_int CL_API_CALL
  531. clCreateSubDevices(cl_device_id /* in_device */,
  532. const cl_device_partition_property * /* properties */,
  533. cl_uint /* num_devices */,
  534. cl_device_id * /* out_devices */,
  535. cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
  536. extern CL_API_ENTRY cl_int CL_API_CALL
  537. clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
  538. extern CL_API_ENTRY cl_int CL_API_CALL
  539. clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
  540. /* Context APIs */
  541. extern CL_API_ENTRY cl_context CL_API_CALL
  542. clCreateContext(const cl_context_properties * /* properties */,
  543. cl_uint /* num_devices */,
  544. const cl_device_id * /* devices */,
  545. void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
  546. void * /* user_data */,
  547. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  548. extern CL_API_ENTRY cl_context CL_API_CALL
  549. clCreateContextFromType(const cl_context_properties * /* properties */,
  550. cl_device_type /* device_type */,
  551. void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
  552. void * /* user_data */,
  553. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  554. extern CL_API_ENTRY cl_int CL_API_CALL
  555. clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  556. extern CL_API_ENTRY cl_int CL_API_CALL
  557. clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  558. extern CL_API_ENTRY cl_int CL_API_CALL
  559. clGetContextInfo(cl_context /* context */,
  560. cl_context_info /* param_name */,
  561. size_t /* param_value_size */,
  562. void * /* param_value */,
  563. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  564. /* Command Queue APIs */
  565. extern CL_API_ENTRY cl_command_queue CL_API_CALL
  566. clCreateCommandQueue(cl_context /* context */,
  567. cl_device_id /* device */,
  568. cl_command_queue_properties /* properties */,
  569. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  570. extern CL_API_ENTRY cl_int CL_API_CALL
  571. clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  572. extern CL_API_ENTRY cl_int CL_API_CALL
  573. clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  574. extern CL_API_ENTRY cl_int CL_API_CALL
  575. clGetCommandQueueInfo(cl_command_queue /* command_queue */,
  576. cl_command_queue_info /* param_name */,
  577. size_t /* param_value_size */,
  578. void * /* param_value */,
  579. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  580. /* Memory Object APIs */
  581. extern CL_API_ENTRY cl_mem CL_API_CALL
  582. clCreateBuffer(cl_context /* context */,
  583. cl_mem_flags /* flags */,
  584. size_t /* size */,
  585. void * /* host_ptr */,
  586. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  587. extern CL_API_ENTRY cl_mem CL_API_CALL
  588. clCreateSubBuffer(cl_mem /* buffer */,
  589. cl_mem_flags /* flags */,
  590. cl_buffer_create_type /* buffer_create_type */,
  591. const void * /* buffer_create_info */,
  592. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
  593. extern CL_API_ENTRY cl_mem CL_API_CALL
  594. clCreateImage(cl_context /* context */,
  595. cl_mem_flags /* flags */,
  596. const cl_image_format * /* image_format */,
  597. const cl_image_desc * /* image_desc */,
  598. void * /* host_ptr */,
  599. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
  600. extern CL_API_ENTRY cl_int CL_API_CALL
  601. clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  602. extern CL_API_ENTRY cl_int CL_API_CALL
  603. clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  604. extern CL_API_ENTRY cl_int CL_API_CALL
  605. clGetSupportedImageFormats(cl_context /* context */,
  606. cl_mem_flags /* flags */,
  607. cl_mem_object_type /* image_type */,
  608. cl_uint /* num_entries */,
  609. cl_image_format * /* image_formats */,
  610. cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
  611. extern CL_API_ENTRY cl_int CL_API_CALL
  612. clGetMemObjectInfo(cl_mem /* memobj */,
  613. cl_mem_info /* param_name */,
  614. size_t /* param_value_size */,
  615. void * /* param_value */,
  616. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  617. extern CL_API_ENTRY cl_int CL_API_CALL
  618. clGetImageInfo(cl_mem /* image */,
  619. cl_image_info /* param_name */,
  620. size_t /* param_value_size */,
  621. void * /* param_value */,
  622. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  623. extern CL_API_ENTRY cl_int CL_API_CALL
  624. clSetMemObjectDestructorCallback( cl_mem /* memobj */,
  625. void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
  626. void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
  627. /* Sampler APIs */
  628. extern CL_API_ENTRY cl_sampler CL_API_CALL
  629. clCreateSampler(cl_context /* context */,
  630. cl_bool /* normalized_coords */,
  631. cl_addressing_mode /* addressing_mode */,
  632. cl_filter_mode /* filter_mode */,
  633. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  634. extern CL_API_ENTRY cl_int CL_API_CALL
  635. clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  636. extern CL_API_ENTRY cl_int CL_API_CALL
  637. clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  638. extern CL_API_ENTRY cl_int CL_API_CALL
  639. clGetSamplerInfo(cl_sampler /* sampler */,
  640. cl_sampler_info /* param_name */,
  641. size_t /* param_value_size */,
  642. void * /* param_value */,
  643. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  644. /* Program Object APIs */
  645. extern CL_API_ENTRY cl_program CL_API_CALL
  646. clCreateProgramWithSource(cl_context /* context */,
  647. cl_uint /* count */,
  648. const char ** /* strings */,
  649. const size_t * /* lengths */,
  650. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  651. extern CL_API_ENTRY cl_program CL_API_CALL
  652. clCreateProgramWithBinary(cl_context /* context */,
  653. cl_uint /* num_devices */,
  654. const cl_device_id * /* device_list */,
  655. const size_t * /* lengths */,
  656. const unsigned char ** /* binaries */,
  657. cl_int * /* binary_status */,
  658. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  659. extern CL_API_ENTRY cl_program CL_API_CALL
  660. clCreateProgramWithBuiltInKernels(cl_context /* context */,
  661. cl_uint /* num_devices */,
  662. const cl_device_id * /* device_list */,
  663. const char * /* kernel_names */,
  664. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
  665. extern CL_API_ENTRY cl_int CL_API_CALL
  666. clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  667. extern CL_API_ENTRY cl_int CL_API_CALL
  668. clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  669. extern CL_API_ENTRY cl_int CL_API_CALL
  670. clBuildProgram(cl_program /* program */,
  671. cl_uint /* num_devices */,
  672. const cl_device_id * /* device_list */,
  673. const char * /* options */,
  674. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  675. void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
  676. extern CL_API_ENTRY cl_int CL_API_CALL
  677. clCompileProgram(cl_program /* program */,
  678. cl_uint /* num_devices */,
  679. const cl_device_id * /* device_list */,
  680. const char * /* options */,
  681. cl_uint /* num_input_headers */,
  682. const cl_program * /* input_headers */,
  683. const char ** /* header_include_names */,
  684. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  685. void * /* user_data */) CL_API_SUFFIX__VERSION_1_2;
  686. extern CL_API_ENTRY cl_program CL_API_CALL
  687. clLinkProgram(cl_context /* context */,
  688. cl_uint /* num_devices */,
  689. const cl_device_id * /* device_list */,
  690. const char * /* options */,
  691. cl_uint /* num_input_programs */,
  692. const cl_program * /* input_programs */,
  693. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  694. void * /* user_data */,
  695. cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
  696. extern CL_API_ENTRY cl_int CL_API_CALL
  697. clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
  698. extern CL_API_ENTRY cl_int CL_API_CALL
  699. clGetProgramInfo(cl_program /* program */,
  700. cl_program_info /* param_name */,
  701. size_t /* param_value_size */,
  702. void * /* param_value */,
  703. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  704. extern CL_API_ENTRY cl_int CL_API_CALL
  705. clGetProgramBuildInfo(cl_program /* program */,
  706. cl_device_id /* device */,
  707. cl_program_build_info /* param_name */,
  708. size_t /* param_value_size */,
  709. void * /* param_value */,
  710. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  711. /* Kernel Object APIs */
  712. extern CL_API_ENTRY cl_kernel CL_API_CALL
  713. clCreateKernel(cl_program /* program */,
  714. const char * /* kernel_name */,
  715. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  716. extern CL_API_ENTRY cl_int CL_API_CALL
  717. clCreateKernelsInProgram(cl_program /* program */,
  718. cl_uint /* num_kernels */,
  719. cl_kernel * /* kernels */,
  720. cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
  721. extern CL_API_ENTRY cl_int CL_API_CALL
  722. clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  723. extern CL_API_ENTRY cl_int CL_API_CALL
  724. clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  725. extern CL_API_ENTRY cl_int CL_API_CALL
  726. clSetKernelArg(cl_kernel /* kernel */,
  727. cl_uint /* arg_index */,
  728. size_t /* arg_size */,
  729. const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
  730. extern CL_API_ENTRY cl_int CL_API_CALL
  731. clGetKernelInfo(cl_kernel /* kernel */,
  732. cl_kernel_info /* param_name */,
  733. size_t /* param_value_size */,
  734. void * /* param_value */,
  735. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  736. extern CL_API_ENTRY cl_int CL_API_CALL
  737. clGetKernelArgInfo(cl_kernel /* kernel */,
  738. cl_uint /* arg_indx */,
  739. cl_kernel_arg_info /* param_name */,
  740. size_t /* param_value_size */,
  741. void * /* param_value */,
  742. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
  743. extern CL_API_ENTRY cl_int CL_API_CALL
  744. clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
  745. cl_device_id /* device */,
  746. cl_kernel_work_group_info /* param_name */,
  747. size_t /* param_value_size */,
  748. void * /* param_value */,
  749. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  750. /* Event Object APIs */
  751. extern CL_API_ENTRY cl_int CL_API_CALL
  752. clWaitForEvents(cl_uint /* num_events */,
  753. const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
  754. extern CL_API_ENTRY cl_int CL_API_CALL
  755. clGetEventInfo(cl_event /* event */,
  756. cl_event_info /* param_name */,
  757. size_t /* param_value_size */,
  758. void * /* param_value */,
  759. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  760. extern CL_API_ENTRY cl_event CL_API_CALL
  761. clCreateUserEvent(cl_context /* context */,
  762. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
  763. extern CL_API_ENTRY cl_int CL_API_CALL
  764. clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  765. extern CL_API_ENTRY cl_int CL_API_CALL
  766. clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  767. extern CL_API_ENTRY cl_int CL_API_CALL
  768. clSetUserEventStatus(cl_event /* event */,
  769. cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
  770. extern CL_API_ENTRY cl_int CL_API_CALL
  771. clSetEventCallback( cl_event /* event */,
  772. cl_int /* command_exec_callback_type */,
  773. void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
  774. void * /* user_data */) CL_API_SUFFIX__VERSION_1_1;
  775. /* Profiling APIs */
  776. extern CL_API_ENTRY cl_int CL_API_CALL
  777. clGetEventProfilingInfo(cl_event /* event */,
  778. cl_profiling_info /* param_name */,
  779. size_t /* param_value_size */,
  780. void * /* param_value */,
  781. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  782. /* Flush and Finish APIs */
  783. extern CL_API_ENTRY cl_int CL_API_CALL
  784. clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  785. extern CL_API_ENTRY cl_int CL_API_CALL
  786. clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  787. /* Enqueued Commands APIs */
  788. extern CL_API_ENTRY cl_int CL_API_CALL
  789. clEnqueueReadBuffer(cl_command_queue /* command_queue */,
  790. cl_mem /* buffer */,
  791. cl_bool /* blocking_read */,
  792. size_t /* offset */,
  793. size_t /* size */,
  794. void * /* ptr */,
  795. cl_uint /* num_events_in_wait_list */,
  796. const cl_event * /* event_wait_list */,
  797. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  798. extern CL_API_ENTRY cl_int CL_API_CALL
  799. clEnqueueReadBufferRect(cl_command_queue /* command_queue */,
  800. cl_mem /* buffer */,
  801. cl_bool /* blocking_read */,
  802. const size_t * /* buffer_offset */,
  803. const size_t * /* host_offset */,
  804. const size_t * /* region */,
  805. size_t /* buffer_row_pitch */,
  806. size_t /* buffer_slice_pitch */,
  807. size_t /* host_row_pitch */,
  808. size_t /* host_slice_pitch */,
  809. void * /* ptr */,
  810. cl_uint /* num_events_in_wait_list */,
  811. const cl_event * /* event_wait_list */,
  812. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  813. extern CL_API_ENTRY cl_int CL_API_CALL
  814. clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
  815. cl_mem /* buffer */,
  816. cl_bool /* blocking_write */,
  817. size_t /* offset */,
  818. size_t /* size */,
  819. const void * /* ptr */,
  820. cl_uint /* num_events_in_wait_list */,
  821. const cl_event * /* event_wait_list */,
  822. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  823. extern CL_API_ENTRY cl_int CL_API_CALL
  824. clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
  825. cl_mem /* buffer */,
  826. cl_bool /* blocking_write */,
  827. const size_t * /* buffer_offset */,
  828. const size_t * /* host_offset */,
  829. const size_t * /* region */,
  830. size_t /* buffer_row_pitch */,
  831. size_t /* buffer_slice_pitch */,
  832. size_t /* host_row_pitch */,
  833. size_t /* host_slice_pitch */,
  834. const void * /* ptr */,
  835. cl_uint /* num_events_in_wait_list */,
  836. const cl_event * /* event_wait_list */,
  837. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  838. extern CL_API_ENTRY cl_int CL_API_CALL
  839. clEnqueueFillBuffer(cl_command_queue /* command_queue */,
  840. cl_mem /* buffer */,
  841. const void * /* pattern */,
  842. size_t /* pattern_size */,
  843. size_t /* offset */,
  844. size_t /* size */,
  845. cl_uint /* num_events_in_wait_list */,
  846. const cl_event * /* event_wait_list */,
  847. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  848. extern CL_API_ENTRY cl_int CL_API_CALL
  849. clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
  850. cl_mem /* src_buffer */,
  851. cl_mem /* dst_buffer */,
  852. size_t /* src_offset */,
  853. size_t /* dst_offset */,
  854. size_t /* size */,
  855. cl_uint /* num_events_in_wait_list */,
  856. const cl_event * /* event_wait_list */,
  857. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  858. extern CL_API_ENTRY cl_int CL_API_CALL
  859. clEnqueueCopyBufferRect(cl_command_queue /* command_queue */,
  860. cl_mem /* src_buffer */,
  861. cl_mem /* dst_buffer */,
  862. const size_t * /* src_origin */,
  863. const size_t * /* dst_origin */,
  864. const size_t * /* region */,
  865. size_t /* src_row_pitch */,
  866. size_t /* src_slice_pitch */,
  867. size_t /* dst_row_pitch */,
  868. size_t /* dst_slice_pitch */,
  869. cl_uint /* num_events_in_wait_list */,
  870. const cl_event * /* event_wait_list */,
  871. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  872. extern CL_API_ENTRY cl_int CL_API_CALL
  873. clEnqueueReadImage(cl_command_queue /* command_queue */,
  874. cl_mem /* image */,
  875. cl_bool /* blocking_read */,
  876. const size_t * /* origin[3] */,
  877. const size_t * /* region[3] */,
  878. size_t /* row_pitch */,
  879. size_t /* slice_pitch */,
  880. void * /* ptr */,
  881. cl_uint /* num_events_in_wait_list */,
  882. const cl_event * /* event_wait_list */,
  883. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  884. extern CL_API_ENTRY cl_int CL_API_CALL
  885. clEnqueueWriteImage(cl_command_queue /* command_queue */,
  886. cl_mem /* image */,
  887. cl_bool /* blocking_write */,
  888. const size_t * /* origin[3] */,
  889. const size_t * /* region[3] */,
  890. size_t /* input_row_pitch */,
  891. size_t /* input_slice_pitch */,
  892. const void * /* ptr */,
  893. cl_uint /* num_events_in_wait_list */,
  894. const cl_event * /* event_wait_list */,
  895. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  896. extern CL_API_ENTRY cl_int CL_API_CALL
  897. clEnqueueFillImage(cl_command_queue /* command_queue */,
  898. cl_mem /* image */,
  899. const void * /* fill_color */,
  900. const size_t * /* origin[3] */,
  901. const size_t * /* region[3] */,
  902. cl_uint /* num_events_in_wait_list */,
  903. const cl_event * /* event_wait_list */,
  904. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  905. extern CL_API_ENTRY cl_int CL_API_CALL
  906. clEnqueueCopyImage(cl_command_queue /* command_queue */,
  907. cl_mem /* src_image */,
  908. cl_mem /* dst_image */,
  909. const size_t * /* src_origin[3] */,
  910. const size_t * /* dst_origin[3] */,
  911. const size_t * /* region[3] */,
  912. cl_uint /* num_events_in_wait_list */,
  913. const cl_event * /* event_wait_list */,
  914. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  915. extern CL_API_ENTRY cl_int CL_API_CALL
  916. clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
  917. cl_mem /* src_image */,
  918. cl_mem /* dst_buffer */,
  919. const size_t * /* src_origin[3] */,
  920. const size_t * /* region[3] */,
  921. size_t /* dst_offset */,
  922. cl_uint /* num_events_in_wait_list */,
  923. const cl_event * /* event_wait_list */,
  924. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  925. extern CL_API_ENTRY cl_int CL_API_CALL
  926. clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
  927. cl_mem /* src_buffer */,
  928. cl_mem /* dst_image */,
  929. size_t /* src_offset */,
  930. const size_t * /* dst_origin[3] */,
  931. const size_t * /* region[3] */,
  932. cl_uint /* num_events_in_wait_list */,
  933. const cl_event * /* event_wait_list */,
  934. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  935. extern CL_API_ENTRY void * CL_API_CALL
  936. clEnqueueMapBuffer(cl_command_queue /* command_queue */,
  937. cl_mem /* buffer */,
  938. cl_bool /* blocking_map */,
  939. cl_map_flags /* map_flags */,
  940. size_t /* offset */,
  941. size_t /* size */,
  942. cl_uint /* num_events_in_wait_list */,
  943. const cl_event * /* event_wait_list */,
  944. cl_event * /* event */,
  945. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  946. extern CL_API_ENTRY void * CL_API_CALL
  947. clEnqueueMapImage(cl_command_queue /* command_queue */,
  948. cl_mem /* image */,
  949. cl_bool /* blocking_map */,
  950. cl_map_flags /* map_flags */,
  951. const size_t * /* origin[3] */,
  952. const size_t * /* region[3] */,
  953. size_t * /* image_row_pitch */,
  954. size_t * /* image_slice_pitch */,
  955. cl_uint /* num_events_in_wait_list */,
  956. const cl_event * /* event_wait_list */,
  957. cl_event * /* event */,
  958. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  959. extern CL_API_ENTRY cl_int CL_API_CALL
  960. clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
  961. cl_mem /* memobj */,
  962. void * /* mapped_ptr */,
  963. cl_uint /* num_events_in_wait_list */,
  964. const cl_event * /* event_wait_list */,
  965. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  966. extern CL_API_ENTRY cl_int CL_API_CALL
  967. clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */,
  968. cl_uint /* num_mem_objects */,
  969. const cl_mem * /* mem_objects */,
  970. cl_mem_migration_flags /* flags */,
  971. cl_uint /* num_events_in_wait_list */,
  972. const cl_event * /* event_wait_list */,
  973. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  974. extern CL_API_ENTRY cl_int CL_API_CALL
  975. clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
  976. cl_kernel /* kernel */,
  977. cl_uint /* work_dim */,
  978. const size_t * /* global_work_offset */,
  979. const size_t * /* global_work_size */,
  980. const size_t * /* local_work_size */,
  981. cl_uint /* num_events_in_wait_list */,
  982. const cl_event * /* event_wait_list */,
  983. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  984. extern CL_API_ENTRY cl_int CL_API_CALL
  985. clEnqueueTask(cl_command_queue /* command_queue */,
  986. cl_kernel /* kernel */,
  987. cl_uint /* num_events_in_wait_list */,
  988. const cl_event * /* event_wait_list */,
  989. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  990. extern CL_API_ENTRY cl_int CL_API_CALL
  991. clEnqueueNativeKernel(cl_command_queue /* command_queue */,
  992. void (CL_CALLBACK * /*user_func*/)(void *),
  993. void * /* args */,
  994. size_t /* cb_args */,
  995. cl_uint /* num_mem_objects */,
  996. const cl_mem * /* mem_list */,
  997. const void ** /* args_mem_loc */,
  998. cl_uint /* num_events_in_wait_list */,
  999. const cl_event * /* event_wait_list */,
  1000. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  1001. extern CL_API_ENTRY cl_int CL_API_CALL
  1002. clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */,
  1003. cl_uint /* num_events_in_wait_list */,
  1004. const cl_event * /* event_wait_list */,
  1005. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  1006. extern CL_API_ENTRY cl_int CL_API_CALL
  1007. clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
  1008. cl_uint /* num_events_in_wait_list */,
  1009. const cl_event * /* event_wait_list */,
  1010. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  1011. extern CL_API_ENTRY cl_int CL_API_CALL
  1012. clSetPrintfCallback(cl_context /* context */,
  1013. void (CL_CALLBACK * /* pfn_notify */)(cl_context /* program */,
  1014. cl_uint /*printf_data_len */,
  1015. char * /* printf_data_ptr */,
  1016. void * /* user_data */),
  1017. void * /* user_data */) CL_API_SUFFIX__VERSION_1_2;
  1018. /* Extension function access
  1019. *
  1020. * Returns the extension function address for the given function name,
  1021. * or NULL if a valid function can not be found. The client must
  1022. * check to make sure the address is not NULL, before using or
  1023. * calling the returned function address.
  1024. */
  1025. extern CL_API_ENTRY void * CL_API_CALL
  1026. clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
  1027. const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2;
  1028. #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
  1029. #warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
  1030. /*
  1031. * WARNING:
  1032. * This API introduces mutable state into the OpenCL implementation. It has been REMOVED
  1033. * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
  1034. * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
  1035. * It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
  1036. *
  1037. * Software developers previously relying on this API are instructed to set the command queue
  1038. * properties when creating the queue, instead.
  1039. */
  1040. extern CL_API_ENTRY cl_int CL_API_CALL
  1041. clSetCommandQueueProperty(cl_command_queue /* command_queue */,
  1042. cl_command_queue_properties /* properties */,
  1043. cl_bool /* enable */,
  1044. cl_command_queue_properties * /* old_properties */) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
  1045. #endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
  1046. #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
  1047. extern CL_API_ENTRY cl_mem CL_API_CALL
  1048. clCreateImage2D(cl_context /* context */,
  1049. cl_mem_flags /* flags */,
  1050. const cl_image_format * /* image_format */,
  1051. size_t /* image_width */,
  1052. size_t /* image_height */,
  1053. size_t /* image_row_pitch */,
  1054. void * /* host_ptr */,
  1055. cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1056. extern CL_API_ENTRY cl_mem CL_API_CALL
  1057. clCreateImage3D(cl_context /* context */,
  1058. cl_mem_flags /* flags */,
  1059. const cl_image_format * /* image_format */,
  1060. size_t /* image_width */,
  1061. size_t /* image_height */,
  1062. size_t /* image_depth */,
  1063. size_t /* image_row_pitch */,
  1064. size_t /* image_slice_pitch */,
  1065. void * /* host_ptr */,
  1066. cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1067. extern CL_API_ENTRY cl_int CL_API_CALL
  1068. clEnqueueMarker(cl_command_queue /* command_queue */,
  1069. cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1070. extern CL_API_ENTRY cl_int CL_API_CALL
  1071. clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
  1072. cl_uint /* num_events */,
  1073. const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1074. extern CL_API_ENTRY cl_int CL_API_CALL
  1075. clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1076. extern CL_API_ENTRY cl_int CL_API_CALL
  1077. clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1078. extern CL_API_ENTRY void * CL_API_CALL
  1079. clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1080. #endif /* CL_USE_DEPRECATED_OPENCL_1_2_APIS */
  1081. #ifdef __cplusplus
  1082. }
  1083. #endif
  1084. #endif /* __OPENCL_CL_H */