cl.h 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214
  1. /*******************************************************************************
  2. * Copyright (c) 2008 - 2012 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/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. #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
  262. #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
  263. /* cl_device_fp_config - bitfield */
  264. #define CL_FP_DENORM (1 << 0)
  265. #define CL_FP_INF_NAN (1 << 1)
  266. #define CL_FP_ROUND_TO_NEAREST (1 << 2)
  267. #define CL_FP_ROUND_TO_ZERO (1 << 3)
  268. #define CL_FP_ROUND_TO_INF (1 << 4)
  269. #define CL_FP_FMA (1 << 5)
  270. #define CL_FP_SOFT_FLOAT (1 << 6)
  271. #define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
  272. /* cl_device_mem_cache_type */
  273. #define CL_NONE 0x0
  274. #define CL_READ_ONLY_CACHE 0x1
  275. #define CL_READ_WRITE_CACHE 0x2
  276. /* cl_device_local_mem_type */
  277. #define CL_LOCAL 0x1
  278. #define CL_GLOBAL 0x2
  279. /* cl_device_exec_capabilities - bitfield */
  280. #define CL_EXEC_KERNEL (1 << 0)
  281. #define CL_EXEC_NATIVE_KERNEL (1 << 1)
  282. /* cl_command_queue_properties - bitfield */
  283. #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
  284. #define CL_QUEUE_PROFILING_ENABLE (1 << 1)
  285. /* cl_context_info */
  286. #define CL_CONTEXT_REFERENCE_COUNT 0x1080
  287. #define CL_CONTEXT_DEVICES 0x1081
  288. #define CL_CONTEXT_PROPERTIES 0x1082
  289. #define CL_CONTEXT_NUM_DEVICES 0x1083
  290. /* cl_context_properties */
  291. #define CL_CONTEXT_PLATFORM 0x1084
  292. #define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
  293. /* cl_device_partition_property */
  294. #define CL_DEVICE_PARTITION_EQUALLY 0x1086
  295. #define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
  296. #define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
  297. #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
  298. /* cl_device_affinity_domain */
  299. #define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
  300. #define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
  301. #define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
  302. #define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
  303. #define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
  304. #define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
  305. /* cl_command_queue_info */
  306. #define CL_QUEUE_CONTEXT 0x1090
  307. #define CL_QUEUE_DEVICE 0x1091
  308. #define CL_QUEUE_REFERENCE_COUNT 0x1092
  309. #define CL_QUEUE_PROPERTIES 0x1093
  310. /* cl_mem_flags - bitfield */
  311. #define CL_MEM_READ_WRITE (1 << 0)
  312. #define CL_MEM_WRITE_ONLY (1 << 1)
  313. #define CL_MEM_READ_ONLY (1 << 2)
  314. #define CL_MEM_USE_HOST_PTR (1 << 3)
  315. #define CL_MEM_ALLOC_HOST_PTR (1 << 4)
  316. #define CL_MEM_COPY_HOST_PTR (1 << 5)
  317. // reserved (1 << 6)
  318. #define CL_MEM_HOST_WRITE_ONLY (1 << 7)
  319. #define CL_MEM_HOST_READ_ONLY (1 << 8)
  320. #define CL_MEM_HOST_NO_ACCESS (1 << 9)
  321. /* cl_mem_migration_flags - bitfield */
  322. #define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
  323. #define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
  324. /* cl_channel_order */
  325. #define CL_R 0x10B0
  326. #define CL_A 0x10B1
  327. #define CL_RG 0x10B2
  328. #define CL_RA 0x10B3
  329. #define CL_RGB 0x10B4
  330. #define CL_RGBA 0x10B5
  331. #define CL_BGRA 0x10B6
  332. #define CL_ARGB 0x10B7
  333. #define CL_INTENSITY 0x10B8
  334. #define CL_LUMINANCE 0x10B9
  335. #define CL_Rx 0x10BA
  336. #define CL_RGx 0x10BB
  337. #define CL_RGBx 0x10BC
  338. #define CL_DEPTH 0x10BD
  339. #define CL_DEPTH_STENCIL 0x10BE
  340. /* cl_channel_type */
  341. #define CL_SNORM_INT8 0x10D0
  342. #define CL_SNORM_INT16 0x10D1
  343. #define CL_UNORM_INT8 0x10D2
  344. #define CL_UNORM_INT16 0x10D3
  345. #define CL_UNORM_SHORT_565 0x10D4
  346. #define CL_UNORM_SHORT_555 0x10D5
  347. #define CL_UNORM_INT_101010 0x10D6
  348. #define CL_SIGNED_INT8 0x10D7
  349. #define CL_SIGNED_INT16 0x10D8
  350. #define CL_SIGNED_INT32 0x10D9
  351. #define CL_UNSIGNED_INT8 0x10DA
  352. #define CL_UNSIGNED_INT16 0x10DB
  353. #define CL_UNSIGNED_INT32 0x10DC
  354. #define CL_HALF_FLOAT 0x10DD
  355. #define CL_FLOAT 0x10DE
  356. #define CL_UNORM_INT24 0x10DF
  357. /* cl_mem_object_type */
  358. #define CL_MEM_OBJECT_BUFFER 0x10F0
  359. #define CL_MEM_OBJECT_IMAGE2D 0x10F1
  360. #define CL_MEM_OBJECT_IMAGE3D 0x10F2
  361. #define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
  362. #define CL_MEM_OBJECT_IMAGE1D 0x10F4
  363. #define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
  364. #define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
  365. /* cl_mem_info */
  366. #define CL_MEM_TYPE 0x1100
  367. #define CL_MEM_FLAGS 0x1101
  368. #define CL_MEM_SIZE 0x1102
  369. #define CL_MEM_HOST_PTR 0x1103
  370. #define CL_MEM_MAP_COUNT 0x1104
  371. #define CL_MEM_REFERENCE_COUNT 0x1105
  372. #define CL_MEM_CONTEXT 0x1106
  373. #define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107
  374. #define CL_MEM_OFFSET 0x1108
  375. /* cl_image_info */
  376. #define CL_IMAGE_FORMAT 0x1110
  377. #define CL_IMAGE_ELEMENT_SIZE 0x1111
  378. #define CL_IMAGE_ROW_PITCH 0x1112
  379. #define CL_IMAGE_SLICE_PITCH 0x1113
  380. #define CL_IMAGE_WIDTH 0x1114
  381. #define CL_IMAGE_HEIGHT 0x1115
  382. #define CL_IMAGE_DEPTH 0x1116
  383. #define CL_IMAGE_ARRAY_SIZE 0x1117
  384. #define CL_IMAGE_BUFFER 0x1118
  385. #define CL_IMAGE_NUM_MIP_LEVELS 0x1119
  386. #define CL_IMAGE_NUM_SAMPLES 0x111A
  387. /* cl_addressing_mode */
  388. #define CL_ADDRESS_NONE 0x1130
  389. #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
  390. #define CL_ADDRESS_CLAMP 0x1132
  391. #define CL_ADDRESS_REPEAT 0x1133
  392. #define CL_ADDRESS_MIRRORED_REPEAT 0x1134
  393. /* cl_filter_mode */
  394. #define CL_FILTER_NEAREST 0x1140
  395. #define CL_FILTER_LINEAR 0x1141
  396. /* cl_sampler_info */
  397. #define CL_SAMPLER_REFERENCE_COUNT 0x1150
  398. #define CL_SAMPLER_CONTEXT 0x1151
  399. #define CL_SAMPLER_NORMALIZED_COORDS 0x1152
  400. #define CL_SAMPLER_ADDRESSING_MODE 0x1153
  401. #define CL_SAMPLER_FILTER_MODE 0x1154
  402. /* cl_map_flags - bitfield */
  403. #define CL_MAP_READ (1 << 0)
  404. #define CL_MAP_WRITE (1 << 1)
  405. #define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
  406. /* cl_program_info */
  407. #define CL_PROGRAM_REFERENCE_COUNT 0x1160
  408. #define CL_PROGRAM_CONTEXT 0x1161
  409. #define CL_PROGRAM_NUM_DEVICES 0x1162
  410. #define CL_PROGRAM_DEVICES 0x1163
  411. #define CL_PROGRAM_SOURCE 0x1164
  412. #define CL_PROGRAM_BINARY_SIZES 0x1165
  413. #define CL_PROGRAM_BINARIES 0x1166
  414. #define CL_PROGRAM_NUM_KERNELS 0x1167
  415. #define CL_PROGRAM_KERNEL_NAMES 0x1168
  416. /* cl_program_build_info */
  417. #define CL_PROGRAM_BUILD_STATUS 0x1181
  418. #define CL_PROGRAM_BUILD_OPTIONS 0x1182
  419. #define CL_PROGRAM_BUILD_LOG 0x1183
  420. #define CL_PROGRAM_BINARY_TYPE 0x1184
  421. /* cl_program_binary_type */
  422. #define CL_PROGRAM_BINARY_TYPE_NONE 0x0
  423. #define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
  424. #define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
  425. #define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
  426. /* cl_build_status */
  427. #define CL_BUILD_SUCCESS 0
  428. #define CL_BUILD_NONE -1
  429. #define CL_BUILD_ERROR -2
  430. #define CL_BUILD_IN_PROGRESS -3
  431. /* cl_kernel_info */
  432. #define CL_KERNEL_FUNCTION_NAME 0x1190
  433. #define CL_KERNEL_NUM_ARGS 0x1191
  434. #define CL_KERNEL_REFERENCE_COUNT 0x1192
  435. #define CL_KERNEL_CONTEXT 0x1193
  436. #define CL_KERNEL_PROGRAM 0x1194
  437. #define CL_KERNEL_ATTRIBUTES 0x1195
  438. /* cl_kernel_arg_info */
  439. #define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
  440. #define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
  441. #define CL_KERNEL_ARG_TYPE_NAME 0x1198
  442. #define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
  443. #define CL_KERNEL_ARG_NAME 0x119A
  444. /* cl_kernel_arg_address_qualifier */
  445. #define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
  446. #define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
  447. #define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
  448. #define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
  449. /* cl_kernel_arg_access_qualifier */
  450. #define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
  451. #define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
  452. #define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
  453. #define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
  454. /* cl_kernel_arg_type_qualifer */
  455. #define CL_KERNEL_ARG_TYPE_NONE 0
  456. #define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
  457. #define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
  458. #define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
  459. /* cl_kernel_work_group_info */
  460. #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
  461. #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
  462. #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
  463. #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
  464. #define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
  465. #define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
  466. /* cl_event_info */
  467. #define CL_EVENT_COMMAND_QUEUE 0x11D0
  468. #define CL_EVENT_COMMAND_TYPE 0x11D1
  469. #define CL_EVENT_REFERENCE_COUNT 0x11D2
  470. #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
  471. #define CL_EVENT_CONTEXT 0x11D4
  472. /* cl_command_type */
  473. #define CL_COMMAND_NDRANGE_KERNEL 0x11F0
  474. #define CL_COMMAND_TASK 0x11F1
  475. #define CL_COMMAND_NATIVE_KERNEL 0x11F2
  476. #define CL_COMMAND_READ_BUFFER 0x11F3
  477. #define CL_COMMAND_WRITE_BUFFER 0x11F4
  478. #define CL_COMMAND_COPY_BUFFER 0x11F5
  479. #define CL_COMMAND_READ_IMAGE 0x11F6
  480. #define CL_COMMAND_WRITE_IMAGE 0x11F7
  481. #define CL_COMMAND_COPY_IMAGE 0x11F8
  482. #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
  483. #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
  484. #define CL_COMMAND_MAP_BUFFER 0x11FB
  485. #define CL_COMMAND_MAP_IMAGE 0x11FC
  486. #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
  487. #define CL_COMMAND_MARKER 0x11FE
  488. #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
  489. #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
  490. #define CL_COMMAND_READ_BUFFER_RECT 0x1201
  491. #define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
  492. #define CL_COMMAND_COPY_BUFFER_RECT 0x1203
  493. #define CL_COMMAND_USER 0x1204
  494. #define CL_COMMAND_BARRIER 0x1205
  495. #define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
  496. #define CL_COMMAND_FILL_BUFFER 0x1207
  497. #define CL_COMMAND_FILL_IMAGE 0x1208
  498. /* command execution status */
  499. #define CL_COMPLETE 0x0
  500. #define CL_RUNNING 0x1
  501. #define CL_SUBMITTED 0x2
  502. #define CL_QUEUED 0x3
  503. /* cl_buffer_create_type */
  504. #define CL_BUFFER_CREATE_TYPE_REGION 0x1220
  505. /* cl_profiling_info */
  506. #define CL_PROFILING_COMMAND_QUEUED 0x1280
  507. #define CL_PROFILING_COMMAND_SUBMIT 0x1281
  508. #define CL_PROFILING_COMMAND_START 0x1282
  509. #define CL_PROFILING_COMMAND_END 0x1283
  510. /********************************************************************************************************/
  511. /* Platform API */
  512. extern CL_API_ENTRY cl_int CL_API_CALL
  513. clGetPlatformIDs(cl_uint /* num_entries */,
  514. cl_platform_id * /* platforms */,
  515. cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
  516. extern CL_API_ENTRY cl_int CL_API_CALL
  517. clGetPlatformInfo(cl_platform_id /* platform */,
  518. cl_platform_info /* param_name */,
  519. size_t /* param_value_size */,
  520. void * /* param_value */,
  521. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  522. /* Device APIs */
  523. extern CL_API_ENTRY cl_int CL_API_CALL
  524. clGetDeviceIDs(cl_platform_id /* platform */,
  525. cl_device_type /* device_type */,
  526. cl_uint /* num_entries */,
  527. cl_device_id * /* devices */,
  528. cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
  529. extern CL_API_ENTRY cl_int CL_API_CALL
  530. clGetDeviceInfo(cl_device_id /* device */,
  531. cl_device_info /* param_name */,
  532. size_t /* param_value_size */,
  533. void * /* param_value */,
  534. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  535. extern CL_API_ENTRY cl_int CL_API_CALL
  536. clCreateSubDevices(cl_device_id /* in_device */,
  537. const cl_device_partition_property * /* properties */,
  538. cl_uint /* num_devices */,
  539. cl_device_id * /* out_devices */,
  540. cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
  541. extern CL_API_ENTRY cl_int CL_API_CALL
  542. clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
  543. extern CL_API_ENTRY cl_int CL_API_CALL
  544. clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
  545. /* Context APIs */
  546. extern CL_API_ENTRY cl_context CL_API_CALL
  547. clCreateContext(const cl_context_properties * /* properties */,
  548. cl_uint /* num_devices */,
  549. const cl_device_id * /* devices */,
  550. void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
  551. void * /* user_data */,
  552. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  553. extern CL_API_ENTRY cl_context CL_API_CALL
  554. clCreateContextFromType(const cl_context_properties * /* properties */,
  555. cl_device_type /* device_type */,
  556. void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
  557. void * /* user_data */,
  558. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  559. extern CL_API_ENTRY cl_int CL_API_CALL
  560. clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  561. extern CL_API_ENTRY cl_int CL_API_CALL
  562. clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  563. extern CL_API_ENTRY cl_int CL_API_CALL
  564. clGetContextInfo(cl_context /* context */,
  565. cl_context_info /* param_name */,
  566. size_t /* param_value_size */,
  567. void * /* param_value */,
  568. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  569. /* Command Queue APIs */
  570. extern CL_API_ENTRY cl_command_queue CL_API_CALL
  571. clCreateCommandQueue(cl_context /* context */,
  572. cl_device_id /* device */,
  573. cl_command_queue_properties /* properties */,
  574. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  575. extern CL_API_ENTRY cl_int CL_API_CALL
  576. clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  577. extern CL_API_ENTRY cl_int CL_API_CALL
  578. clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  579. extern CL_API_ENTRY cl_int CL_API_CALL
  580. clGetCommandQueueInfo(cl_command_queue /* command_queue */,
  581. cl_command_queue_info /* param_name */,
  582. size_t /* param_value_size */,
  583. void * /* param_value */,
  584. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  585. /* Memory Object APIs */
  586. extern CL_API_ENTRY cl_mem CL_API_CALL
  587. clCreateBuffer(cl_context /* context */,
  588. cl_mem_flags /* flags */,
  589. size_t /* size */,
  590. void * /* host_ptr */,
  591. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  592. extern CL_API_ENTRY cl_mem CL_API_CALL
  593. clCreateSubBuffer(cl_mem /* buffer */,
  594. cl_mem_flags /* flags */,
  595. cl_buffer_create_type /* buffer_create_type */,
  596. const void * /* buffer_create_info */,
  597. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
  598. extern CL_API_ENTRY cl_mem CL_API_CALL
  599. clCreateImage(cl_context /* context */,
  600. cl_mem_flags /* flags */,
  601. const cl_image_format * /* image_format */,
  602. const cl_image_desc * /* image_desc */,
  603. void * /* host_ptr */,
  604. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
  605. extern CL_API_ENTRY cl_int CL_API_CALL
  606. clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  607. extern CL_API_ENTRY cl_int CL_API_CALL
  608. clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  609. extern CL_API_ENTRY cl_int CL_API_CALL
  610. clGetSupportedImageFormats(cl_context /* context */,
  611. cl_mem_flags /* flags */,
  612. cl_mem_object_type /* image_type */,
  613. cl_uint /* num_entries */,
  614. cl_image_format * /* image_formats */,
  615. cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
  616. extern CL_API_ENTRY cl_int CL_API_CALL
  617. clGetMemObjectInfo(cl_mem /* memobj */,
  618. cl_mem_info /* param_name */,
  619. size_t /* param_value_size */,
  620. void * /* param_value */,
  621. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  622. extern CL_API_ENTRY cl_int CL_API_CALL
  623. clGetImageInfo(cl_mem /* image */,
  624. cl_image_info /* param_name */,
  625. size_t /* param_value_size */,
  626. void * /* param_value */,
  627. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  628. extern CL_API_ENTRY cl_int CL_API_CALL
  629. clSetMemObjectDestructorCallback( cl_mem /* memobj */,
  630. void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
  631. void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
  632. /* Sampler APIs */
  633. extern CL_API_ENTRY cl_sampler CL_API_CALL
  634. clCreateSampler(cl_context /* context */,
  635. cl_bool /* normalized_coords */,
  636. cl_addressing_mode /* addressing_mode */,
  637. cl_filter_mode /* filter_mode */,
  638. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  639. extern CL_API_ENTRY cl_int CL_API_CALL
  640. clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  641. extern CL_API_ENTRY cl_int CL_API_CALL
  642. clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  643. extern CL_API_ENTRY cl_int CL_API_CALL
  644. clGetSamplerInfo(cl_sampler /* sampler */,
  645. cl_sampler_info /* param_name */,
  646. size_t /* param_value_size */,
  647. void * /* param_value */,
  648. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  649. /* Program Object APIs */
  650. extern CL_API_ENTRY cl_program CL_API_CALL
  651. clCreateProgramWithSource(cl_context /* context */,
  652. cl_uint /* count */,
  653. const char ** /* strings */,
  654. const size_t * /* lengths */,
  655. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  656. extern CL_API_ENTRY cl_program CL_API_CALL
  657. clCreateProgramWithBinary(cl_context /* context */,
  658. cl_uint /* num_devices */,
  659. const cl_device_id * /* device_list */,
  660. const size_t * /* lengths */,
  661. const unsigned char ** /* binaries */,
  662. cl_int * /* binary_status */,
  663. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  664. extern CL_API_ENTRY cl_program CL_API_CALL
  665. clCreateProgramWithBuiltInKernels(cl_context /* context */,
  666. cl_uint /* num_devices */,
  667. const cl_device_id * /* device_list */,
  668. const char * /* kernel_names */,
  669. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
  670. extern CL_API_ENTRY cl_int CL_API_CALL
  671. clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  672. extern CL_API_ENTRY cl_int CL_API_CALL
  673. clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  674. extern CL_API_ENTRY cl_int CL_API_CALL
  675. clBuildProgram(cl_program /* program */,
  676. cl_uint /* num_devices */,
  677. const cl_device_id * /* device_list */,
  678. const char * /* options */,
  679. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  680. void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
  681. extern CL_API_ENTRY cl_int CL_API_CALL
  682. clCompileProgram(cl_program /* program */,
  683. cl_uint /* num_devices */,
  684. const cl_device_id * /* device_list */,
  685. const char * /* options */,
  686. cl_uint /* num_input_headers */,
  687. const cl_program * /* input_headers */,
  688. const char ** /* header_include_names */,
  689. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  690. void * /* user_data */) CL_API_SUFFIX__VERSION_1_2;
  691. extern CL_API_ENTRY cl_program CL_API_CALL
  692. clLinkProgram(cl_context /* context */,
  693. cl_uint /* num_devices */,
  694. const cl_device_id * /* device_list */,
  695. const char * /* options */,
  696. cl_uint /* num_input_programs */,
  697. const cl_program * /* input_programs */,
  698. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  699. void * /* user_data */,
  700. cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
  701. extern CL_API_ENTRY cl_int CL_API_CALL
  702. clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
  703. extern CL_API_ENTRY cl_int CL_API_CALL
  704. clGetProgramInfo(cl_program /* program */,
  705. cl_program_info /* param_name */,
  706. size_t /* param_value_size */,
  707. void * /* param_value */,
  708. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  709. extern CL_API_ENTRY cl_int CL_API_CALL
  710. clGetProgramBuildInfo(cl_program /* program */,
  711. cl_device_id /* device */,
  712. cl_program_build_info /* param_name */,
  713. size_t /* param_value_size */,
  714. void * /* param_value */,
  715. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  716. /* Kernel Object APIs */
  717. extern CL_API_ENTRY cl_kernel CL_API_CALL
  718. clCreateKernel(cl_program /* program */,
  719. const char * /* kernel_name */,
  720. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  721. extern CL_API_ENTRY cl_int CL_API_CALL
  722. clCreateKernelsInProgram(cl_program /* program */,
  723. cl_uint /* num_kernels */,
  724. cl_kernel * /* kernels */,
  725. cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
  726. extern CL_API_ENTRY cl_int CL_API_CALL
  727. clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  728. extern CL_API_ENTRY cl_int CL_API_CALL
  729. clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  730. extern CL_API_ENTRY cl_int CL_API_CALL
  731. clSetKernelArg(cl_kernel /* kernel */,
  732. cl_uint /* arg_index */,
  733. size_t /* arg_size */,
  734. const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
  735. extern CL_API_ENTRY cl_int CL_API_CALL
  736. clGetKernelInfo(cl_kernel /* kernel */,
  737. cl_kernel_info /* param_name */,
  738. size_t /* param_value_size */,
  739. void * /* param_value */,
  740. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  741. extern CL_API_ENTRY cl_int CL_API_CALL
  742. clGetKernelArgInfo(cl_kernel /* kernel */,
  743. cl_uint /* arg_indx */,
  744. cl_kernel_arg_info /* param_name */,
  745. size_t /* param_value_size */,
  746. void * /* param_value */,
  747. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
  748. extern CL_API_ENTRY cl_int CL_API_CALL
  749. clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
  750. cl_device_id /* device */,
  751. cl_kernel_work_group_info /* param_name */,
  752. size_t /* param_value_size */,
  753. void * /* param_value */,
  754. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  755. /* Event Object APIs */
  756. extern CL_API_ENTRY cl_int CL_API_CALL
  757. clWaitForEvents(cl_uint /* num_events */,
  758. const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
  759. extern CL_API_ENTRY cl_int CL_API_CALL
  760. clGetEventInfo(cl_event /* event */,
  761. cl_event_info /* param_name */,
  762. size_t /* param_value_size */,
  763. void * /* param_value */,
  764. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  765. extern CL_API_ENTRY cl_event CL_API_CALL
  766. clCreateUserEvent(cl_context /* context */,
  767. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
  768. extern CL_API_ENTRY cl_int CL_API_CALL
  769. clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  770. extern CL_API_ENTRY cl_int CL_API_CALL
  771. clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  772. extern CL_API_ENTRY cl_int CL_API_CALL
  773. clSetUserEventStatus(cl_event /* event */,
  774. cl_int /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
  775. extern CL_API_ENTRY cl_int CL_API_CALL
  776. clSetEventCallback( cl_event /* event */,
  777. cl_int /* command_exec_callback_type */,
  778. void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
  779. void * /* user_data */) CL_API_SUFFIX__VERSION_1_1;
  780. /* Profiling APIs */
  781. extern CL_API_ENTRY cl_int CL_API_CALL
  782. clGetEventProfilingInfo(cl_event /* event */,
  783. cl_profiling_info /* param_name */,
  784. size_t /* param_value_size */,
  785. void * /* param_value */,
  786. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  787. /* Flush and Finish APIs */
  788. extern CL_API_ENTRY cl_int CL_API_CALL
  789. clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  790. extern CL_API_ENTRY cl_int CL_API_CALL
  791. clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  792. /* Enqueued Commands APIs */
  793. extern CL_API_ENTRY cl_int CL_API_CALL
  794. clEnqueueReadBuffer(cl_command_queue /* command_queue */,
  795. cl_mem /* buffer */,
  796. cl_bool /* blocking_read */,
  797. size_t /* offset */,
  798. size_t /* size */,
  799. void * /* ptr */,
  800. cl_uint /* num_events_in_wait_list */,
  801. const cl_event * /* event_wait_list */,
  802. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  803. extern CL_API_ENTRY cl_int CL_API_CALL
  804. clEnqueueReadBufferRect(cl_command_queue /* command_queue */,
  805. cl_mem /* buffer */,
  806. cl_bool /* blocking_read */,
  807. const size_t * /* buffer_offset */,
  808. const size_t * /* host_offset */,
  809. const size_t * /* region */,
  810. size_t /* buffer_row_pitch */,
  811. size_t /* buffer_slice_pitch */,
  812. size_t /* host_row_pitch */,
  813. size_t /* host_slice_pitch */,
  814. void * /* ptr */,
  815. cl_uint /* num_events_in_wait_list */,
  816. const cl_event * /* event_wait_list */,
  817. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  818. extern CL_API_ENTRY cl_int CL_API_CALL
  819. clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
  820. cl_mem /* buffer */,
  821. cl_bool /* blocking_write */,
  822. size_t /* offset */,
  823. size_t /* size */,
  824. const void * /* ptr */,
  825. cl_uint /* num_events_in_wait_list */,
  826. const cl_event * /* event_wait_list */,
  827. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  828. extern CL_API_ENTRY cl_int CL_API_CALL
  829. clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
  830. cl_mem /* buffer */,
  831. cl_bool /* blocking_write */,
  832. const size_t * /* buffer_offset */,
  833. const size_t * /* host_offset */,
  834. const size_t * /* region */,
  835. size_t /* buffer_row_pitch */,
  836. size_t /* buffer_slice_pitch */,
  837. size_t /* host_row_pitch */,
  838. size_t /* host_slice_pitch */,
  839. const void * /* ptr */,
  840. cl_uint /* num_events_in_wait_list */,
  841. const cl_event * /* event_wait_list */,
  842. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  843. extern CL_API_ENTRY cl_int CL_API_CALL
  844. clEnqueueFillBuffer(cl_command_queue /* command_queue */,
  845. cl_mem /* buffer */,
  846. const void * /* pattern */,
  847. size_t /* pattern_size */,
  848. size_t /* offset */,
  849. size_t /* size */,
  850. cl_uint /* num_events_in_wait_list */,
  851. const cl_event * /* event_wait_list */,
  852. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  853. extern CL_API_ENTRY cl_int CL_API_CALL
  854. clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
  855. cl_mem /* src_buffer */,
  856. cl_mem /* dst_buffer */,
  857. size_t /* src_offset */,
  858. size_t /* dst_offset */,
  859. size_t /* size */,
  860. cl_uint /* num_events_in_wait_list */,
  861. const cl_event * /* event_wait_list */,
  862. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  863. extern CL_API_ENTRY cl_int CL_API_CALL
  864. clEnqueueCopyBufferRect(cl_command_queue /* command_queue */,
  865. cl_mem /* src_buffer */,
  866. cl_mem /* dst_buffer */,
  867. const size_t * /* src_origin */,
  868. const size_t * /* dst_origin */,
  869. const size_t * /* region */,
  870. size_t /* src_row_pitch */,
  871. size_t /* src_slice_pitch */,
  872. size_t /* dst_row_pitch */,
  873. size_t /* dst_slice_pitch */,
  874. cl_uint /* num_events_in_wait_list */,
  875. const cl_event * /* event_wait_list */,
  876. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
  877. extern CL_API_ENTRY cl_int CL_API_CALL
  878. clEnqueueReadImage(cl_command_queue /* command_queue */,
  879. cl_mem /* image */,
  880. cl_bool /* blocking_read */,
  881. const size_t * /* origin[3] */,
  882. const size_t * /* region[3] */,
  883. size_t /* row_pitch */,
  884. size_t /* slice_pitch */,
  885. void * /* ptr */,
  886. cl_uint /* num_events_in_wait_list */,
  887. const cl_event * /* event_wait_list */,
  888. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  889. extern CL_API_ENTRY cl_int CL_API_CALL
  890. clEnqueueWriteImage(cl_command_queue /* command_queue */,
  891. cl_mem /* image */,
  892. cl_bool /* blocking_write */,
  893. const size_t * /* origin[3] */,
  894. const size_t * /* region[3] */,
  895. size_t /* input_row_pitch */,
  896. size_t /* input_slice_pitch */,
  897. const void * /* ptr */,
  898. cl_uint /* num_events_in_wait_list */,
  899. const cl_event * /* event_wait_list */,
  900. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  901. extern CL_API_ENTRY cl_int CL_API_CALL
  902. clEnqueueFillImage(cl_command_queue /* command_queue */,
  903. cl_mem /* image */,
  904. const void * /* fill_color */,
  905. const size_t * /* origin[3] */,
  906. const size_t * /* region[3] */,
  907. cl_uint /* num_events_in_wait_list */,
  908. const cl_event * /* event_wait_list */,
  909. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  910. extern CL_API_ENTRY cl_int CL_API_CALL
  911. clEnqueueCopyImage(cl_command_queue /* command_queue */,
  912. cl_mem /* src_image */,
  913. cl_mem /* dst_image */,
  914. const size_t * /* src_origin[3] */,
  915. const size_t * /* dst_origin[3] */,
  916. const size_t * /* region[3] */,
  917. cl_uint /* num_events_in_wait_list */,
  918. const cl_event * /* event_wait_list */,
  919. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  920. extern CL_API_ENTRY cl_int CL_API_CALL
  921. clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
  922. cl_mem /* src_image */,
  923. cl_mem /* dst_buffer */,
  924. const size_t * /* src_origin[3] */,
  925. const size_t * /* region[3] */,
  926. size_t /* dst_offset */,
  927. cl_uint /* num_events_in_wait_list */,
  928. const cl_event * /* event_wait_list */,
  929. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  930. extern CL_API_ENTRY cl_int CL_API_CALL
  931. clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
  932. cl_mem /* src_buffer */,
  933. cl_mem /* dst_image */,
  934. size_t /* src_offset */,
  935. const size_t * /* dst_origin[3] */,
  936. const size_t * /* region[3] */,
  937. cl_uint /* num_events_in_wait_list */,
  938. const cl_event * /* event_wait_list */,
  939. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  940. extern CL_API_ENTRY void * CL_API_CALL
  941. clEnqueueMapBuffer(cl_command_queue /* command_queue */,
  942. cl_mem /* buffer */,
  943. cl_bool /* blocking_map */,
  944. cl_map_flags /* map_flags */,
  945. size_t /* offset */,
  946. size_t /* size */,
  947. cl_uint /* num_events_in_wait_list */,
  948. const cl_event * /* event_wait_list */,
  949. cl_event * /* event */,
  950. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  951. extern CL_API_ENTRY void * CL_API_CALL
  952. clEnqueueMapImage(cl_command_queue /* command_queue */,
  953. cl_mem /* image */,
  954. cl_bool /* blocking_map */,
  955. cl_map_flags /* map_flags */,
  956. const size_t * /* origin[3] */,
  957. const size_t * /* region[3] */,
  958. size_t * /* image_row_pitch */,
  959. size_t * /* image_slice_pitch */,
  960. cl_uint /* num_events_in_wait_list */,
  961. const cl_event * /* event_wait_list */,
  962. cl_event * /* event */,
  963. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  964. extern CL_API_ENTRY cl_int CL_API_CALL
  965. clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
  966. cl_mem /* memobj */,
  967. void * /* mapped_ptr */,
  968. cl_uint /* num_events_in_wait_list */,
  969. const cl_event * /* event_wait_list */,
  970. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  971. extern CL_API_ENTRY cl_int CL_API_CALL
  972. clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */,
  973. cl_uint /* num_mem_objects */,
  974. const cl_mem * /* mem_objects */,
  975. cl_mem_migration_flags /* flags */,
  976. cl_uint /* num_events_in_wait_list */,
  977. const cl_event * /* event_wait_list */,
  978. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  979. extern CL_API_ENTRY cl_int CL_API_CALL
  980. clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
  981. cl_kernel /* kernel */,
  982. cl_uint /* work_dim */,
  983. const size_t * /* global_work_offset */,
  984. const size_t * /* global_work_size */,
  985. const size_t * /* local_work_size */,
  986. cl_uint /* num_events_in_wait_list */,
  987. const cl_event * /* event_wait_list */,
  988. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  989. extern CL_API_ENTRY cl_int CL_API_CALL
  990. clEnqueueTask(cl_command_queue /* command_queue */,
  991. cl_kernel /* kernel */,
  992. cl_uint /* num_events_in_wait_list */,
  993. const cl_event * /* event_wait_list */,
  994. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  995. extern CL_API_ENTRY cl_int CL_API_CALL
  996. clEnqueueNativeKernel(cl_command_queue /* command_queue */,
  997. void (CL_CALLBACK * /*user_func*/)(void *),
  998. void * /* args */,
  999. size_t /* cb_args */,
  1000. cl_uint /* num_mem_objects */,
  1001. const cl_mem * /* mem_list */,
  1002. const void ** /* args_mem_loc */,
  1003. cl_uint /* num_events_in_wait_list */,
  1004. const cl_event * /* event_wait_list */,
  1005. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  1006. extern CL_API_ENTRY cl_int CL_API_CALL
  1007. clEnqueueMarkerWithWaitList(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. clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
  1013. cl_uint /* num_events_in_wait_list */,
  1014. const cl_event * /* event_wait_list */,
  1015. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
  1016. /* Extension function access
  1017. *
  1018. * Returns the extension function address for the given function name,
  1019. * or NULL if a valid function can not be found. The client must
  1020. * check to make sure the address is not NULL, before using or
  1021. * calling the returned function address.
  1022. */
  1023. extern CL_API_ENTRY void * CL_API_CALL
  1024. clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
  1025. const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2;
  1026. // Deprecated OpenCL 1.1 APIs
  1027. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  1028. clCreateImage2D(cl_context /* context */,
  1029. cl_mem_flags /* flags */,
  1030. const cl_image_format * /* image_format */,
  1031. size_t /* image_width */,
  1032. size_t /* image_height */,
  1033. size_t /* image_row_pitch */,
  1034. void * /* host_ptr */,
  1035. cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1036. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  1037. clCreateImage3D(cl_context /* context */,
  1038. cl_mem_flags /* flags */,
  1039. const cl_image_format * /* image_format */,
  1040. size_t /* image_width */,
  1041. size_t /* image_height */,
  1042. size_t /* image_depth */,
  1043. size_t /* image_row_pitch */,
  1044. size_t /* image_slice_pitch */,
  1045. void * /* host_ptr */,
  1046. cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1047. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1048. clEnqueueMarker(cl_command_queue /* command_queue */,
  1049. cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1050. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1051. clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
  1052. cl_uint /* num_events */,
  1053. const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1054. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1055. clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1056. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1057. clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1058. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
  1059. clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1060. #ifdef __cplusplus
  1061. }
  1062. #endif
  1063. #endif /* __OPENCL_CL_H */