cl.h 61 KB

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