Clone of mesa.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800
  1. /*******************************************************************************
  2. * Copyright (c) 2008-2019 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. * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
  16. * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
  17. * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
  18. * https://www.khronos.org/registry/
  19. *
  20. * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  24. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  25. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  26. * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  27. ******************************************************************************/
  28. #ifndef __OPENCL_CL_H
  29. #define __OPENCL_CL_H
  30. #include <CL/cl_version.h>
  31. #include <CL/cl_platform.h>
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. /******************************************************************************/
  36. typedef struct _cl_platform_id * cl_platform_id;
  37. typedef struct _cl_device_id * cl_device_id;
  38. typedef struct _cl_context * cl_context;
  39. typedef struct _cl_command_queue * cl_command_queue;
  40. typedef struct _cl_mem * cl_mem;
  41. typedef struct _cl_program * cl_program;
  42. typedef struct _cl_kernel * cl_kernel;
  43. typedef struct _cl_event * cl_event;
  44. typedef struct _cl_sampler * cl_sampler;
  45. 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. */
  46. typedef cl_ulong cl_bitfield;
  47. typedef cl_bitfield cl_device_type;
  48. typedef cl_uint cl_platform_info;
  49. typedef cl_uint cl_device_info;
  50. typedef cl_bitfield cl_device_fp_config;
  51. typedef cl_uint cl_device_mem_cache_type;
  52. typedef cl_uint cl_device_local_mem_type;
  53. typedef cl_bitfield cl_device_exec_capabilities;
  54. #ifdef CL_VERSION_2_0
  55. typedef cl_bitfield cl_device_svm_capabilities;
  56. #endif
  57. typedef cl_bitfield cl_command_queue_properties;
  58. #ifdef CL_VERSION_1_2
  59. typedef intptr_t cl_device_partition_property;
  60. typedef cl_bitfield cl_device_affinity_domain;
  61. #endif
  62. typedef intptr_t cl_context_properties;
  63. typedef cl_uint cl_context_info;
  64. #ifdef CL_VERSION_2_0
  65. typedef cl_bitfield cl_queue_properties;
  66. #endif
  67. typedef cl_uint cl_command_queue_info;
  68. typedef cl_uint cl_channel_order;
  69. typedef cl_uint cl_channel_type;
  70. typedef cl_bitfield cl_mem_flags;
  71. #ifdef CL_VERSION_2_0
  72. typedef cl_bitfield cl_svm_mem_flags;
  73. #endif
  74. typedef cl_uint cl_mem_object_type;
  75. typedef cl_uint cl_mem_info;
  76. #ifdef CL_VERSION_1_2
  77. typedef cl_bitfield cl_mem_migration_flags;
  78. #endif
  79. typedef cl_uint cl_image_info;
  80. #ifdef CL_VERSION_1_1
  81. typedef cl_uint cl_buffer_create_type;
  82. #endif
  83. typedef cl_uint cl_addressing_mode;
  84. typedef cl_uint cl_filter_mode;
  85. typedef cl_uint cl_sampler_info;
  86. typedef cl_bitfield cl_map_flags;
  87. #ifdef CL_VERSION_2_0
  88. typedef intptr_t cl_pipe_properties;
  89. typedef cl_uint cl_pipe_info;
  90. #endif
  91. typedef cl_uint cl_program_info;
  92. typedef cl_uint cl_program_build_info;
  93. #ifdef CL_VERSION_1_2
  94. typedef cl_uint cl_program_binary_type;
  95. #endif
  96. typedef cl_int cl_build_status;
  97. typedef cl_uint cl_kernel_info;
  98. #ifdef CL_VERSION_1_2
  99. typedef cl_uint cl_kernel_arg_info;
  100. typedef cl_uint cl_kernel_arg_address_qualifier;
  101. typedef cl_uint cl_kernel_arg_access_qualifier;
  102. typedef cl_bitfield cl_kernel_arg_type_qualifier;
  103. #endif
  104. typedef cl_uint cl_kernel_work_group_info;
  105. #ifdef CL_VERSION_2_1
  106. typedef cl_uint cl_kernel_sub_group_info;
  107. #endif
  108. typedef cl_uint cl_event_info;
  109. typedef cl_uint cl_command_type;
  110. typedef cl_uint cl_profiling_info;
  111. #ifdef CL_VERSION_2_0
  112. typedef cl_bitfield cl_sampler_properties;
  113. typedef cl_uint cl_kernel_exec_info;
  114. #endif
  115. typedef struct _cl_image_format {
  116. cl_channel_order image_channel_order;
  117. cl_channel_type image_channel_data_type;
  118. } cl_image_format;
  119. #ifdef CL_VERSION_1_2
  120. typedef struct _cl_image_desc {
  121. cl_mem_object_type image_type;
  122. size_t image_width;
  123. size_t image_height;
  124. size_t image_depth;
  125. size_t image_array_size;
  126. size_t image_row_pitch;
  127. size_t image_slice_pitch;
  128. cl_uint num_mip_levels;
  129. cl_uint num_samples;
  130. #ifdef __GNUC__
  131. __extension__ /* Prevents warnings about anonymous union in -pedantic builds */
  132. #endif
  133. #ifdef _MSC_VER
  134. #pragma warning( push )
  135. #pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 /Za builds */
  136. #endif
  137. union {
  138. cl_mem buffer;
  139. cl_mem mem_object;
  140. };
  141. #ifdef _MSC_VER
  142. #pragma warning( pop )
  143. #endif
  144. } cl_image_desc;
  145. #endif
  146. #ifdef CL_VERSION_1_1
  147. typedef struct _cl_buffer_region {
  148. size_t origin;
  149. size_t size;
  150. } cl_buffer_region;
  151. #endif
  152. /******************************************************************************/
  153. /* Error Codes */
  154. #define CL_SUCCESS 0
  155. #define CL_DEVICE_NOT_FOUND -1
  156. #define CL_DEVICE_NOT_AVAILABLE -2
  157. #define CL_COMPILER_NOT_AVAILABLE -3
  158. #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
  159. #define CL_OUT_OF_RESOURCES -5
  160. #define CL_OUT_OF_HOST_MEMORY -6
  161. #define CL_PROFILING_INFO_NOT_AVAILABLE -7
  162. #define CL_MEM_COPY_OVERLAP -8
  163. #define CL_IMAGE_FORMAT_MISMATCH -9
  164. #define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
  165. #define CL_BUILD_PROGRAM_FAILURE -11
  166. #define CL_MAP_FAILURE -12
  167. #ifdef CL_VERSION_1_1
  168. #define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
  169. #define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
  170. #endif
  171. #ifdef CL_VERSION_1_2
  172. #define CL_COMPILE_PROGRAM_FAILURE -15
  173. #define CL_LINKER_NOT_AVAILABLE -16
  174. #define CL_LINK_PROGRAM_FAILURE -17
  175. #define CL_DEVICE_PARTITION_FAILED -18
  176. #define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19
  177. #endif
  178. #define CL_INVALID_VALUE -30
  179. #define CL_INVALID_DEVICE_TYPE -31
  180. #define CL_INVALID_PLATFORM -32
  181. #define CL_INVALID_DEVICE -33
  182. #define CL_INVALID_CONTEXT -34
  183. #define CL_INVALID_QUEUE_PROPERTIES -35
  184. #define CL_INVALID_COMMAND_QUEUE -36
  185. #define CL_INVALID_HOST_PTR -37
  186. #define CL_INVALID_MEM_OBJECT -38
  187. #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
  188. #define CL_INVALID_IMAGE_SIZE -40
  189. #define CL_INVALID_SAMPLER -41
  190. #define CL_INVALID_BINARY -42
  191. #define CL_INVALID_BUILD_OPTIONS -43
  192. #define CL_INVALID_PROGRAM -44
  193. #define CL_INVALID_PROGRAM_EXECUTABLE -45
  194. #define CL_INVALID_KERNEL_NAME -46
  195. #define CL_INVALID_KERNEL_DEFINITION -47
  196. #define CL_INVALID_KERNEL -48
  197. #define CL_INVALID_ARG_INDEX -49
  198. #define CL_INVALID_ARG_VALUE -50
  199. #define CL_INVALID_ARG_SIZE -51
  200. #define CL_INVALID_KERNEL_ARGS -52
  201. #define CL_INVALID_WORK_DIMENSION -53
  202. #define CL_INVALID_WORK_GROUP_SIZE -54
  203. #define CL_INVALID_WORK_ITEM_SIZE -55
  204. #define CL_INVALID_GLOBAL_OFFSET -56
  205. #define CL_INVALID_EVENT_WAIT_LIST -57
  206. #define CL_INVALID_EVENT -58
  207. #define CL_INVALID_OPERATION -59
  208. #define CL_INVALID_GL_OBJECT -60
  209. #define CL_INVALID_BUFFER_SIZE -61
  210. #define CL_INVALID_MIP_LEVEL -62
  211. #define CL_INVALID_GLOBAL_WORK_SIZE -63
  212. #ifdef CL_VERSION_1_1
  213. #define CL_INVALID_PROPERTY -64
  214. #endif
  215. #ifdef CL_VERSION_1_2
  216. #define CL_INVALID_IMAGE_DESCRIPTOR -65
  217. #define CL_INVALID_COMPILER_OPTIONS -66
  218. #define CL_INVALID_LINKER_OPTIONS -67
  219. #define CL_INVALID_DEVICE_PARTITION_COUNT -68
  220. #endif
  221. #ifdef CL_VERSION_2_0
  222. #define CL_INVALID_PIPE_SIZE -69
  223. #define CL_INVALID_DEVICE_QUEUE -70
  224. #endif
  225. #ifdef CL_VERSION_2_2
  226. #define CL_INVALID_SPEC_ID -71
  227. #define CL_MAX_SIZE_RESTRICTION_EXCEEDED -72
  228. #endif
  229. /* cl_bool */
  230. #define CL_FALSE 0
  231. #define CL_TRUE 1
  232. #ifdef CL_VERSION_1_2
  233. #define CL_BLOCKING CL_TRUE
  234. #define CL_NON_BLOCKING CL_FALSE
  235. #endif
  236. /* cl_platform_info */
  237. #define CL_PLATFORM_PROFILE 0x0900
  238. #define CL_PLATFORM_VERSION 0x0901
  239. #define CL_PLATFORM_NAME 0x0902
  240. #define CL_PLATFORM_VENDOR 0x0903
  241. #define CL_PLATFORM_EXTENSIONS 0x0904
  242. #ifdef CL_VERSION_2_1
  243. #define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905
  244. #endif
  245. /* cl_device_type - bitfield */
  246. #define CL_DEVICE_TYPE_DEFAULT (1 << 0)
  247. #define CL_DEVICE_TYPE_CPU (1 << 1)
  248. #define CL_DEVICE_TYPE_GPU (1 << 2)
  249. #define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
  250. #ifdef CL_VERSION_1_2
  251. #define CL_DEVICE_TYPE_CUSTOM (1 << 4)
  252. #endif
  253. #define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
  254. /* cl_device_info */
  255. #define CL_DEVICE_TYPE 0x1000
  256. #define CL_DEVICE_VENDOR_ID 0x1001
  257. #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
  258. #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
  259. #define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
  260. #define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
  261. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
  262. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
  263. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
  264. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
  265. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
  266. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
  267. #define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
  268. #define CL_DEVICE_ADDRESS_BITS 0x100D
  269. #define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
  270. #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
  271. #define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
  272. #define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
  273. #define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
  274. #define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
  275. #define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
  276. #define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
  277. #define CL_DEVICE_IMAGE_SUPPORT 0x1016
  278. #define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
  279. #define CL_DEVICE_MAX_SAMPLERS 0x1018
  280. #define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
  281. #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
  282. #define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
  283. #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
  284. #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
  285. #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
  286. #define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
  287. #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
  288. #define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
  289. #define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
  290. #define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
  291. #define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
  292. #define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
  293. #define CL_DEVICE_ENDIAN_LITTLE 0x1026
  294. #define CL_DEVICE_AVAILABLE 0x1027
  295. #define CL_DEVICE_COMPILER_AVAILABLE 0x1028
  296. #define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
  297. #define CL_DEVICE_QUEUE_PROPERTIES 0x102A /* deprecated */
  298. #ifdef CL_VERSION_2_0
  299. #define CL_DEVICE_QUEUE_ON_HOST_PROPERTIES 0x102A
  300. #endif
  301. #define CL_DEVICE_NAME 0x102B
  302. #define CL_DEVICE_VENDOR 0x102C
  303. #define CL_DRIVER_VERSION 0x102D
  304. #define CL_DEVICE_PROFILE 0x102E
  305. #define CL_DEVICE_VERSION 0x102F
  306. #define CL_DEVICE_EXTENSIONS 0x1030
  307. #define CL_DEVICE_PLATFORM 0x1031
  308. #ifdef CL_VERSION_1_2
  309. #define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
  310. #endif
  311. /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG which is already defined in "cl_ext.h" */
  312. #ifdef CL_VERSION_1_1
  313. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
  314. #define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */
  315. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
  316. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037
  317. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038
  318. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039
  319. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A
  320. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
  321. #define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
  322. #define CL_DEVICE_OPENCL_C_VERSION 0x103D
  323. #endif
  324. #ifdef CL_VERSION_1_2
  325. #define CL_DEVICE_LINKER_AVAILABLE 0x103E
  326. #define CL_DEVICE_BUILT_IN_KERNELS 0x103F
  327. #define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040
  328. #define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041
  329. #define CL_DEVICE_PARENT_DEVICE 0x1042
  330. #define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043
  331. #define CL_DEVICE_PARTITION_PROPERTIES 0x1044
  332. #define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045
  333. #define CL_DEVICE_PARTITION_TYPE 0x1046
  334. #define CL_DEVICE_REFERENCE_COUNT 0x1047
  335. #define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048
  336. #define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
  337. #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
  338. #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
  339. #endif
  340. #ifdef CL_VERSION_2_0
  341. #define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS 0x104C
  342. #define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE 0x104D
  343. #define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES 0x104E
  344. #define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE 0x104F
  345. #define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE 0x1050
  346. #define CL_DEVICE_MAX_ON_DEVICE_QUEUES 0x1051
  347. #define CL_DEVICE_MAX_ON_DEVICE_EVENTS 0x1052
  348. #define CL_DEVICE_SVM_CAPABILITIES 0x1053
  349. #define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE 0x1054
  350. #define CL_DEVICE_MAX_PIPE_ARGS 0x1055
  351. #define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS 0x1056
  352. #define CL_DEVICE_PIPE_MAX_PACKET_SIZE 0x1057
  353. #define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT 0x1058
  354. #define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT 0x1059
  355. #define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT 0x105A
  356. #endif
  357. #ifdef CL_VERSION_2_1
  358. #define CL_DEVICE_IL_VERSION 0x105B
  359. #define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C
  360. #define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D
  361. #endif
  362. /* cl_device_fp_config - bitfield */
  363. #define CL_FP_DENORM (1 << 0)
  364. #define CL_FP_INF_NAN (1 << 1)
  365. #define CL_FP_ROUND_TO_NEAREST (1 << 2)
  366. #define CL_FP_ROUND_TO_ZERO (1 << 3)
  367. #define CL_FP_ROUND_TO_INF (1 << 4)
  368. #define CL_FP_FMA (1 << 5)
  369. #ifdef CL_VERSION_1_1
  370. #define CL_FP_SOFT_FLOAT (1 << 6)
  371. #endif
  372. #ifdef CL_VERSION_1_2
  373. #define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
  374. #endif
  375. /* cl_device_mem_cache_type */
  376. #define CL_NONE 0x0
  377. #define CL_READ_ONLY_CACHE 0x1
  378. #define CL_READ_WRITE_CACHE 0x2
  379. /* cl_device_local_mem_type */
  380. #define CL_LOCAL 0x1
  381. #define CL_GLOBAL 0x2
  382. /* cl_device_exec_capabilities - bitfield */
  383. #define CL_EXEC_KERNEL (1 << 0)
  384. #define CL_EXEC_NATIVE_KERNEL (1 << 1)
  385. /* cl_command_queue_properties - bitfield */
  386. #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
  387. #define CL_QUEUE_PROFILING_ENABLE (1 << 1)
  388. #ifdef CL_VERSION_2_0
  389. #define CL_QUEUE_ON_DEVICE (1 << 2)
  390. #define CL_QUEUE_ON_DEVICE_DEFAULT (1 << 3)
  391. #endif
  392. /* cl_context_info */
  393. #define CL_CONTEXT_REFERENCE_COUNT 0x1080
  394. #define CL_CONTEXT_DEVICES 0x1081
  395. #define CL_CONTEXT_PROPERTIES 0x1082
  396. #ifdef CL_VERSION_1_1
  397. #define CL_CONTEXT_NUM_DEVICES 0x1083
  398. #endif
  399. /* cl_context_properties */
  400. #define CL_CONTEXT_PLATFORM 0x1084
  401. #ifdef CL_VERSION_1_2
  402. #define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
  403. #endif
  404. #ifdef CL_VERSION_1_2
  405. /* cl_device_partition_property */
  406. #define CL_DEVICE_PARTITION_EQUALLY 0x1086
  407. #define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
  408. #define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
  409. #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
  410. #endif
  411. #ifdef CL_VERSION_1_2
  412. /* cl_device_affinity_domain */
  413. #define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
  414. #define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
  415. #define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
  416. #define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
  417. #define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
  418. #define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
  419. #endif
  420. #ifdef CL_VERSION_2_0
  421. /* cl_device_svm_capabilities */
  422. #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0)
  423. #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1)
  424. #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2)
  425. #define CL_DEVICE_SVM_ATOMICS (1 << 3)
  426. #endif
  427. /* cl_command_queue_info */
  428. #define CL_QUEUE_CONTEXT 0x1090
  429. #define CL_QUEUE_DEVICE 0x1091
  430. #define CL_QUEUE_REFERENCE_COUNT 0x1092
  431. #define CL_QUEUE_PROPERTIES 0x1093
  432. #ifdef CL_VERSION_2_0
  433. #define CL_QUEUE_SIZE 0x1094
  434. #endif
  435. #ifdef CL_VERSION_2_1
  436. #define CL_QUEUE_DEVICE_DEFAULT 0x1095
  437. #endif
  438. /* cl_mem_flags and cl_svm_mem_flags - bitfield */
  439. #define CL_MEM_READ_WRITE (1 << 0)
  440. #define CL_MEM_WRITE_ONLY (1 << 1)
  441. #define CL_MEM_READ_ONLY (1 << 2)
  442. #define CL_MEM_USE_HOST_PTR (1 << 3)
  443. #define CL_MEM_ALLOC_HOST_PTR (1 << 4)
  444. #define CL_MEM_COPY_HOST_PTR (1 << 5)
  445. /* reserved (1 << 6) */
  446. #ifdef CL_VERSION_1_2
  447. #define CL_MEM_HOST_WRITE_ONLY (1 << 7)
  448. #define CL_MEM_HOST_READ_ONLY (1 << 8)
  449. #define CL_MEM_HOST_NO_ACCESS (1 << 9)
  450. #endif
  451. #ifdef CL_VERSION_2_0
  452. #define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) /* used by cl_svm_mem_flags only */
  453. #define CL_MEM_SVM_ATOMICS (1 << 11) /* used by cl_svm_mem_flags only */
  454. #define CL_MEM_KERNEL_READ_AND_WRITE (1 << 12)
  455. #endif
  456. #ifdef CL_VERSION_1_2
  457. /* cl_mem_migration_flags - bitfield */
  458. #define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
  459. #define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
  460. #endif
  461. /* cl_channel_order */
  462. #define CL_R 0x10B0
  463. #define CL_A 0x10B1
  464. #define CL_RG 0x10B2
  465. #define CL_RA 0x10B3
  466. #define CL_RGB 0x10B4
  467. #define CL_RGBA 0x10B5
  468. #define CL_BGRA 0x10B6
  469. #define CL_ARGB 0x10B7
  470. #define CL_INTENSITY 0x10B8
  471. #define CL_LUMINANCE 0x10B9
  472. #ifdef CL_VERSION_1_1
  473. #define CL_Rx 0x10BA
  474. #define CL_RGx 0x10BB
  475. #define CL_RGBx 0x10BC
  476. #endif
  477. #ifdef CL_VERSION_1_2
  478. #define CL_DEPTH 0x10BD
  479. #define CL_DEPTH_STENCIL 0x10BE
  480. #endif
  481. #ifdef CL_VERSION_2_0
  482. #define CL_sRGB 0x10BF
  483. #define CL_sRGBx 0x10C0
  484. #define CL_sRGBA 0x10C1
  485. #define CL_sBGRA 0x10C2
  486. #define CL_ABGR 0x10C3
  487. #endif
  488. /* cl_channel_type */
  489. #define CL_SNORM_INT8 0x10D0
  490. #define CL_SNORM_INT16 0x10D1
  491. #define CL_UNORM_INT8 0x10D2
  492. #define CL_UNORM_INT16 0x10D3
  493. #define CL_UNORM_SHORT_565 0x10D4
  494. #define CL_UNORM_SHORT_555 0x10D5
  495. #define CL_UNORM_INT_101010 0x10D6
  496. #define CL_SIGNED_INT8 0x10D7
  497. #define CL_SIGNED_INT16 0x10D8
  498. #define CL_SIGNED_INT32 0x10D9
  499. #define CL_UNSIGNED_INT8 0x10DA
  500. #define CL_UNSIGNED_INT16 0x10DB
  501. #define CL_UNSIGNED_INT32 0x10DC
  502. #define CL_HALF_FLOAT 0x10DD
  503. #define CL_FLOAT 0x10DE
  504. #ifdef CL_VERSION_1_2
  505. #define CL_UNORM_INT24 0x10DF
  506. #endif
  507. #ifdef CL_VERSION_2_1
  508. #define CL_UNORM_INT_101010_2 0x10E0
  509. #endif
  510. /* cl_mem_object_type */
  511. #define CL_MEM_OBJECT_BUFFER 0x10F0
  512. #define CL_MEM_OBJECT_IMAGE2D 0x10F1
  513. #define CL_MEM_OBJECT_IMAGE3D 0x10F2
  514. #ifdef CL_VERSION_1_2
  515. #define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
  516. #define CL_MEM_OBJECT_IMAGE1D 0x10F4
  517. #define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
  518. #define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
  519. #endif
  520. #ifdef CL_VERSION_2_0
  521. #define CL_MEM_OBJECT_PIPE 0x10F7
  522. #endif
  523. /* cl_mem_info */
  524. #define CL_MEM_TYPE 0x1100
  525. #define CL_MEM_FLAGS 0x1101
  526. #define CL_MEM_SIZE 0x1102
  527. #define CL_MEM_HOST_PTR 0x1103
  528. #define CL_MEM_MAP_COUNT 0x1104
  529. #define CL_MEM_REFERENCE_COUNT 0x1105
  530. #define CL_MEM_CONTEXT 0x1106
  531. #ifdef CL_VERSION_1_1
  532. #define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107
  533. #define CL_MEM_OFFSET 0x1108
  534. #endif
  535. #ifdef CL_VERSION_2_0
  536. #define CL_MEM_USES_SVM_POINTER 0x1109
  537. #endif
  538. /* cl_image_info */
  539. #define CL_IMAGE_FORMAT 0x1110
  540. #define CL_IMAGE_ELEMENT_SIZE 0x1111
  541. #define CL_IMAGE_ROW_PITCH 0x1112
  542. #define CL_IMAGE_SLICE_PITCH 0x1113
  543. #define CL_IMAGE_WIDTH 0x1114
  544. #define CL_IMAGE_HEIGHT 0x1115
  545. #define CL_IMAGE_DEPTH 0x1116
  546. #ifdef CL_VERSION_1_2
  547. #define CL_IMAGE_ARRAY_SIZE 0x1117
  548. #define CL_IMAGE_BUFFER 0x1118
  549. #define CL_IMAGE_NUM_MIP_LEVELS 0x1119
  550. #define CL_IMAGE_NUM_SAMPLES 0x111A
  551. #endif
  552. #ifdef CL_VERSION_2_0
  553. /* cl_pipe_info */
  554. #define CL_PIPE_PACKET_SIZE 0x1120
  555. #define CL_PIPE_MAX_PACKETS 0x1121
  556. #endif
  557. /* cl_addressing_mode */
  558. #define CL_ADDRESS_NONE 0x1130
  559. #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
  560. #define CL_ADDRESS_CLAMP 0x1132
  561. #define CL_ADDRESS_REPEAT 0x1133
  562. #ifdef CL_VERSION_1_1
  563. #define CL_ADDRESS_MIRRORED_REPEAT 0x1134
  564. #endif
  565. /* cl_filter_mode */
  566. #define CL_FILTER_NEAREST 0x1140
  567. #define CL_FILTER_LINEAR 0x1141
  568. /* cl_sampler_info */
  569. #define CL_SAMPLER_REFERENCE_COUNT 0x1150
  570. #define CL_SAMPLER_CONTEXT 0x1151
  571. #define CL_SAMPLER_NORMALIZED_COORDS 0x1152
  572. #define CL_SAMPLER_ADDRESSING_MODE 0x1153
  573. #define CL_SAMPLER_FILTER_MODE 0x1154
  574. #ifdef CL_VERSION_2_0
  575. /* These enumerants are for the cl_khr_mipmap_image extension.
  576. They have since been added to cl_ext.h with an appropriate
  577. KHR suffix, but are left here for backwards compatibility. */
  578. #define CL_SAMPLER_MIP_FILTER_MODE 0x1155
  579. #define CL_SAMPLER_LOD_MIN 0x1156
  580. #define CL_SAMPLER_LOD_MAX 0x1157
  581. #endif
  582. /* cl_map_flags - bitfield */
  583. #define CL_MAP_READ (1 << 0)
  584. #define CL_MAP_WRITE (1 << 1)
  585. #ifdef CL_VERSION_1_2
  586. #define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
  587. #endif
  588. /* cl_program_info */
  589. #define CL_PROGRAM_REFERENCE_COUNT 0x1160
  590. #define CL_PROGRAM_CONTEXT 0x1161
  591. #define CL_PROGRAM_NUM_DEVICES 0x1162
  592. #define CL_PROGRAM_DEVICES 0x1163
  593. #define CL_PROGRAM_SOURCE 0x1164
  594. #define CL_PROGRAM_BINARY_SIZES 0x1165
  595. #define CL_PROGRAM_BINARIES 0x1166
  596. #ifdef CL_VERSION_1_2
  597. #define CL_PROGRAM_NUM_KERNELS 0x1167
  598. #define CL_PROGRAM_KERNEL_NAMES 0x1168
  599. #endif
  600. #ifdef CL_VERSION_2_1
  601. #define CL_PROGRAM_IL 0x1169
  602. #endif
  603. #ifdef CL_VERSION_2_2
  604. #define CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT 0x116A
  605. #define CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT 0x116B
  606. #endif
  607. /* cl_program_build_info */
  608. #define CL_PROGRAM_BUILD_STATUS 0x1181
  609. #define CL_PROGRAM_BUILD_OPTIONS 0x1182
  610. #define CL_PROGRAM_BUILD_LOG 0x1183
  611. #ifdef CL_VERSION_1_2
  612. #define CL_PROGRAM_BINARY_TYPE 0x1184
  613. #endif
  614. #ifdef CL_VERSION_2_0
  615. #define CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE 0x1185
  616. #endif
  617. #ifdef CL_VERSION_1_2
  618. /* cl_program_binary_type */
  619. #define CL_PROGRAM_BINARY_TYPE_NONE 0x0
  620. #define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
  621. #define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
  622. #define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
  623. #endif
  624. /* cl_build_status */
  625. #define CL_BUILD_SUCCESS 0
  626. #define CL_BUILD_NONE -1
  627. #define CL_BUILD_ERROR -2
  628. #define CL_BUILD_IN_PROGRESS -3
  629. /* cl_kernel_info */
  630. #define CL_KERNEL_FUNCTION_NAME 0x1190
  631. #define CL_KERNEL_NUM_ARGS 0x1191
  632. #define CL_KERNEL_REFERENCE_COUNT 0x1192
  633. #define CL_KERNEL_CONTEXT 0x1193
  634. #define CL_KERNEL_PROGRAM 0x1194
  635. #ifdef CL_VERSION_1_2
  636. #define CL_KERNEL_ATTRIBUTES 0x1195
  637. #endif
  638. #ifdef CL_VERSION_2_1
  639. #define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9
  640. #define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA
  641. #endif
  642. #ifdef CL_VERSION_1_2
  643. /* cl_kernel_arg_info */
  644. #define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
  645. #define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
  646. #define CL_KERNEL_ARG_TYPE_NAME 0x1198
  647. #define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
  648. #define CL_KERNEL_ARG_NAME 0x119A
  649. #endif
  650. #ifdef CL_VERSION_1_2
  651. /* cl_kernel_arg_address_qualifier */
  652. #define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
  653. #define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
  654. #define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
  655. #define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
  656. #endif
  657. #ifdef CL_VERSION_1_2
  658. /* cl_kernel_arg_access_qualifier */
  659. #define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
  660. #define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
  661. #define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
  662. #define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
  663. #endif
  664. #ifdef CL_VERSION_1_2
  665. /* cl_kernel_arg_type_qualifier */
  666. #define CL_KERNEL_ARG_TYPE_NONE 0
  667. #define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
  668. #define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
  669. #define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
  670. #ifdef CL_VERSION_2_0
  671. #define CL_KERNEL_ARG_TYPE_PIPE (1 << 3)
  672. #endif
  673. #endif
  674. /* cl_kernel_work_group_info */
  675. #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
  676. #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
  677. #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
  678. #define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
  679. #define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
  680. #ifdef CL_VERSION_1_2
  681. #define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
  682. #endif
  683. #ifdef CL_VERSION_2_1
  684. /* cl_kernel_sub_group_info */
  685. #define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2033
  686. #define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2034
  687. #define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT 0x11B8
  688. #endif
  689. #ifdef CL_VERSION_2_0
  690. /* cl_kernel_exec_info */
  691. #define CL_KERNEL_EXEC_INFO_SVM_PTRS 0x11B6
  692. #define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM 0x11B7
  693. #endif
  694. /* cl_event_info */
  695. #define CL_EVENT_COMMAND_QUEUE 0x11D0
  696. #define CL_EVENT_COMMAND_TYPE 0x11D1
  697. #define CL_EVENT_REFERENCE_COUNT 0x11D2
  698. #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
  699. #ifdef CL_VERSION_1_1
  700. #define CL_EVENT_CONTEXT 0x11D4
  701. #endif
  702. /* cl_command_type */
  703. #define CL_COMMAND_NDRANGE_KERNEL 0x11F0
  704. #define CL_COMMAND_TASK 0x11F1
  705. #define CL_COMMAND_NATIVE_KERNEL 0x11F2
  706. #define CL_COMMAND_READ_BUFFER 0x11F3
  707. #define CL_COMMAND_WRITE_BUFFER 0x11F4
  708. #define CL_COMMAND_COPY_BUFFER 0x11F5
  709. #define CL_COMMAND_READ_IMAGE 0x11F6
  710. #define CL_COMMAND_WRITE_IMAGE 0x11F7
  711. #define CL_COMMAND_COPY_IMAGE 0x11F8
  712. #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
  713. #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
  714. #define CL_COMMAND_MAP_BUFFER 0x11FB
  715. #define CL_COMMAND_MAP_IMAGE 0x11FC
  716. #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
  717. #define CL_COMMAND_MARKER 0x11FE
  718. #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
  719. #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
  720. #ifdef CL_VERSION_1_1
  721. #define CL_COMMAND_READ_BUFFER_RECT 0x1201
  722. #define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
  723. #define CL_COMMAND_COPY_BUFFER_RECT 0x1203
  724. #define CL_COMMAND_USER 0x1204
  725. #endif
  726. #ifdef CL_VERSION_1_2
  727. #define CL_COMMAND_BARRIER 0x1205
  728. #define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
  729. #define CL_COMMAND_FILL_BUFFER 0x1207
  730. #define CL_COMMAND_FILL_IMAGE 0x1208
  731. #endif
  732. #ifdef CL_VERSION_2_0
  733. #define CL_COMMAND_SVM_FREE 0x1209
  734. #define CL_COMMAND_SVM_MEMCPY 0x120A
  735. #define CL_COMMAND_SVM_MEMFILL 0x120B
  736. #define CL_COMMAND_SVM_MAP 0x120C
  737. #define CL_COMMAND_SVM_UNMAP 0x120D
  738. #endif
  739. /* command execution status */
  740. #define CL_COMPLETE 0x0
  741. #define CL_RUNNING 0x1
  742. #define CL_SUBMITTED 0x2
  743. #define CL_QUEUED 0x3
  744. #ifdef CL_VERSION_1_1
  745. /* cl_buffer_create_type */
  746. #define CL_BUFFER_CREATE_TYPE_REGION 0x1220
  747. #endif
  748. /* cl_profiling_info */
  749. #define CL_PROFILING_COMMAND_QUEUED 0x1280
  750. #define CL_PROFILING_COMMAND_SUBMIT 0x1281
  751. #define CL_PROFILING_COMMAND_START 0x1282
  752. #define CL_PROFILING_COMMAND_END 0x1283
  753. #ifdef CL_VERSION_2_0
  754. #define CL_PROFILING_COMMAND_COMPLETE 0x1284
  755. #endif
  756. /********************************************************************************************************/
  757. /* Platform API */
  758. extern CL_API_ENTRY cl_int CL_API_CALL
  759. clGetPlatformIDs(cl_uint num_entries,
  760. cl_platform_id * platforms,
  761. cl_uint * num_platforms) CL_API_SUFFIX__VERSION_1_0;
  762. extern CL_API_ENTRY cl_int CL_API_CALL
  763. clGetPlatformInfo(cl_platform_id platform,
  764. cl_platform_info param_name,
  765. size_t param_value_size,
  766. void * param_value,
  767. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  768. /* Device APIs */
  769. extern CL_API_ENTRY cl_int CL_API_CALL
  770. clGetDeviceIDs(cl_platform_id platform,
  771. cl_device_type device_type,
  772. cl_uint num_entries,
  773. cl_device_id * devices,
  774. cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
  775. extern CL_API_ENTRY cl_int CL_API_CALL
  776. clGetDeviceInfo(cl_device_id device,
  777. cl_device_info param_name,
  778. size_t param_value_size,
  779. void * param_value,
  780. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  781. #ifdef CL_VERSION_1_2
  782. extern CL_API_ENTRY cl_int CL_API_CALL
  783. clCreateSubDevices(cl_device_id in_device,
  784. const cl_device_partition_property * properties,
  785. cl_uint num_devices,
  786. cl_device_id * out_devices,
  787. cl_uint * num_devices_ret) CL_API_SUFFIX__VERSION_1_2;
  788. extern CL_API_ENTRY cl_int CL_API_CALL
  789. clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
  790. extern CL_API_ENTRY cl_int CL_API_CALL
  791. clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2;
  792. #endif
  793. #ifdef CL_VERSION_2_1
  794. extern CL_API_ENTRY cl_int CL_API_CALL
  795. clSetDefaultDeviceCommandQueue(cl_context context,
  796. cl_device_id device,
  797. cl_command_queue command_queue) CL_API_SUFFIX__VERSION_2_1;
  798. extern CL_API_ENTRY cl_int CL_API_CALL
  799. clGetDeviceAndHostTimer(cl_device_id device,
  800. cl_ulong* device_timestamp,
  801. cl_ulong* host_timestamp) CL_API_SUFFIX__VERSION_2_1;
  802. extern CL_API_ENTRY cl_int CL_API_CALL
  803. clGetHostTimer(cl_device_id device,
  804. cl_ulong * host_timestamp) CL_API_SUFFIX__VERSION_2_1;
  805. #endif
  806. /* Context APIs */
  807. extern CL_API_ENTRY cl_context CL_API_CALL
  808. clCreateContext(const cl_context_properties * properties,
  809. cl_uint num_devices,
  810. const cl_device_id * devices,
  811. void (CL_CALLBACK * pfn_notify)(const char * errinfo,
  812. const void * private_info,
  813. size_t cb,
  814. void * user_data),
  815. void * user_data,
  816. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  817. extern CL_API_ENTRY cl_context CL_API_CALL
  818. clCreateContextFromType(const cl_context_properties * properties,
  819. cl_device_type device_type,
  820. void (CL_CALLBACK * pfn_notify)(const char * errinfo,
  821. const void * private_info,
  822. size_t cb,
  823. void * user_data),
  824. void * user_data,
  825. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  826. extern CL_API_ENTRY cl_int CL_API_CALL
  827. clRetainContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
  828. extern CL_API_ENTRY cl_int CL_API_CALL
  829. clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0;
  830. extern CL_API_ENTRY cl_int CL_API_CALL
  831. clGetContextInfo(cl_context context,
  832. cl_context_info param_name,
  833. size_t param_value_size,
  834. void * param_value,
  835. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  836. /* Command Queue APIs */
  837. #ifdef CL_VERSION_2_0
  838. extern CL_API_ENTRY cl_command_queue CL_API_CALL
  839. clCreateCommandQueueWithProperties(cl_context context,
  840. cl_device_id device,
  841. const cl_queue_properties * properties,
  842. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
  843. #endif
  844. extern CL_API_ENTRY cl_int CL_API_CALL
  845. clRetainCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
  846. extern CL_API_ENTRY cl_int CL_API_CALL
  847. clReleaseCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
  848. extern CL_API_ENTRY cl_int CL_API_CALL
  849. clGetCommandQueueInfo(cl_command_queue command_queue,
  850. cl_command_queue_info param_name,
  851. size_t param_value_size,
  852. void * param_value,
  853. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  854. /* Memory Object APIs */
  855. extern CL_API_ENTRY cl_mem CL_API_CALL
  856. clCreateBuffer(cl_context context,
  857. cl_mem_flags flags,
  858. size_t size,
  859. void * host_ptr,
  860. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  861. #ifdef CL_VERSION_1_1
  862. extern CL_API_ENTRY cl_mem CL_API_CALL
  863. clCreateSubBuffer(cl_mem buffer,
  864. cl_mem_flags flags,
  865. cl_buffer_create_type buffer_create_type,
  866. const void * buffer_create_info,
  867. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1;
  868. #endif
  869. #ifdef CL_VERSION_1_2
  870. extern CL_API_ENTRY cl_mem CL_API_CALL
  871. clCreateImage(cl_context context,
  872. cl_mem_flags flags,
  873. const cl_image_format * image_format,
  874. const cl_image_desc * image_desc,
  875. void * host_ptr,
  876. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
  877. #endif
  878. #ifdef CL_VERSION_2_0
  879. extern CL_API_ENTRY cl_mem CL_API_CALL
  880. clCreatePipe(cl_context context,
  881. cl_mem_flags flags,
  882. cl_uint pipe_packet_size,
  883. cl_uint pipe_max_packets,
  884. const cl_pipe_properties * properties,
  885. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
  886. #endif
  887. extern CL_API_ENTRY cl_int CL_API_CALL
  888. clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
  889. extern CL_API_ENTRY cl_int CL_API_CALL
  890. clReleaseMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
  891. extern CL_API_ENTRY cl_int CL_API_CALL
  892. clGetSupportedImageFormats(cl_context context,
  893. cl_mem_flags flags,
  894. cl_mem_object_type image_type,
  895. cl_uint num_entries,
  896. cl_image_format * image_formats,
  897. cl_uint * num_image_formats) CL_API_SUFFIX__VERSION_1_0;
  898. extern CL_API_ENTRY cl_int CL_API_CALL
  899. clGetMemObjectInfo(cl_mem memobj,
  900. cl_mem_info param_name,
  901. size_t param_value_size,
  902. void * param_value,
  903. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  904. extern CL_API_ENTRY cl_int CL_API_CALL
  905. clGetImageInfo(cl_mem image,
  906. cl_image_info param_name,
  907. size_t param_value_size,
  908. void * param_value,
  909. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  910. #ifdef CL_VERSION_2_0
  911. extern CL_API_ENTRY cl_int CL_API_CALL
  912. clGetPipeInfo(cl_mem pipe,
  913. cl_pipe_info param_name,
  914. size_t param_value_size,
  915. void * param_value,
  916. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_2_0;
  917. #endif
  918. #ifdef CL_VERSION_1_1
  919. extern CL_API_ENTRY cl_int CL_API_CALL
  920. clSetMemObjectDestructorCallback(cl_mem memobj,
  921. void (CL_CALLBACK * pfn_notify)(cl_mem memobj,
  922. void * user_data),
  923. void * user_data) CL_API_SUFFIX__VERSION_1_1;
  924. #endif
  925. /* SVM Allocation APIs */
  926. #ifdef CL_VERSION_2_0
  927. extern CL_API_ENTRY void * CL_API_CALL
  928. clSVMAlloc(cl_context context,
  929. cl_svm_mem_flags flags,
  930. size_t size,
  931. cl_uint alignment) CL_API_SUFFIX__VERSION_2_0;
  932. extern CL_API_ENTRY void CL_API_CALL
  933. clSVMFree(cl_context context,
  934. void * svm_pointer) CL_API_SUFFIX__VERSION_2_0;
  935. #endif
  936. /* Sampler APIs */
  937. #ifdef CL_VERSION_2_0
  938. extern CL_API_ENTRY cl_sampler CL_API_CALL
  939. clCreateSamplerWithProperties(cl_context context,
  940. const cl_sampler_properties * sampler_properties,
  941. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
  942. #endif
  943. extern CL_API_ENTRY cl_int CL_API_CALL
  944. clRetainSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
  945. extern CL_API_ENTRY cl_int CL_API_CALL
  946. clReleaseSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0;
  947. extern CL_API_ENTRY cl_int CL_API_CALL
  948. clGetSamplerInfo(cl_sampler sampler,
  949. cl_sampler_info param_name,
  950. size_t param_value_size,
  951. void * param_value,
  952. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  953. /* Program Object APIs */
  954. extern CL_API_ENTRY cl_program CL_API_CALL
  955. clCreateProgramWithSource(cl_context context,
  956. cl_uint count,
  957. const char ** strings,
  958. const size_t * lengths,
  959. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  960. extern CL_API_ENTRY cl_program CL_API_CALL
  961. clCreateProgramWithBinary(cl_context context,
  962. cl_uint num_devices,
  963. const cl_device_id * device_list,
  964. const size_t * lengths,
  965. const unsigned char ** binaries,
  966. cl_int * binary_status,
  967. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  968. #ifdef CL_VERSION_1_2
  969. extern CL_API_ENTRY cl_program CL_API_CALL
  970. clCreateProgramWithBuiltInKernels(cl_context context,
  971. cl_uint num_devices,
  972. const cl_device_id * device_list,
  973. const char * kernel_names,
  974. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
  975. #endif
  976. #ifdef CL_VERSION_2_1
  977. extern CL_API_ENTRY cl_program CL_API_CALL
  978. clCreateProgramWithIL(cl_context context,
  979. const void* il,
  980. size_t length,
  981. cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1;
  982. #endif
  983. extern CL_API_ENTRY cl_int CL_API_CALL
  984. clRetainProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
  985. extern CL_API_ENTRY cl_int CL_API_CALL
  986. clReleaseProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0;
  987. extern CL_API_ENTRY cl_int CL_API_CALL
  988. clBuildProgram(cl_program program,
  989. cl_uint num_devices,
  990. const cl_device_id * device_list,
  991. const char * options,
  992. void (CL_CALLBACK * pfn_notify)(cl_program program,
  993. void * user_data),
  994. void * user_data) CL_API_SUFFIX__VERSION_1_0;
  995. #ifdef CL_VERSION_1_2
  996. extern CL_API_ENTRY cl_int CL_API_CALL
  997. clCompileProgram(cl_program program,
  998. cl_uint num_devices,
  999. const cl_device_id * device_list,
  1000. const char * options,
  1001. cl_uint num_input_headers,
  1002. const cl_program * input_headers,
  1003. const char ** header_include_names,
  1004. void (CL_CALLBACK * pfn_notify)(cl_program program,
  1005. void * user_data),
  1006. void * user_data) CL_API_SUFFIX__VERSION_1_2;
  1007. extern CL_API_ENTRY cl_program CL_API_CALL
  1008. clLinkProgram(cl_context context,
  1009. cl_uint num_devices,
  1010. const cl_device_id * device_list,
  1011. const char * options,
  1012. cl_uint num_input_programs,
  1013. const cl_program * input_programs,
  1014. void (CL_CALLBACK * pfn_notify)(cl_program program,
  1015. void * user_data),
  1016. void * user_data,
  1017. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
  1018. #endif
  1019. #ifdef CL_VERSION_2_2
  1020. extern CL_API_ENTRY cl_int CL_API_CALL
  1021. clSetProgramReleaseCallback(cl_program program,
  1022. void (CL_CALLBACK * pfn_notify)(cl_program program,
  1023. void * user_data),
  1024. void * user_data) CL_API_SUFFIX__VERSION_2_2;
  1025. extern CL_API_ENTRY cl_int CL_API_CALL
  1026. clSetProgramSpecializationConstant(cl_program program,
  1027. cl_uint spec_id,
  1028. size_t spec_size,
  1029. const void* spec_value) CL_API_SUFFIX__VERSION_2_2;
  1030. #endif
  1031. #ifdef CL_VERSION_1_2
  1032. extern CL_API_ENTRY cl_int CL_API_CALL
  1033. clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2;
  1034. #endif
  1035. extern CL_API_ENTRY cl_int CL_API_CALL
  1036. clGetProgramInfo(cl_program program,
  1037. cl_program_info param_name,
  1038. size_t param_value_size,
  1039. void * param_value,
  1040. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1041. extern CL_API_ENTRY cl_int CL_API_CALL
  1042. clGetProgramBuildInfo(cl_program program,
  1043. cl_device_id device,
  1044. cl_program_build_info param_name,
  1045. size_t param_value_size,
  1046. void * param_value,
  1047. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1048. /* Kernel Object APIs */
  1049. extern CL_API_ENTRY cl_kernel CL_API_CALL
  1050. clCreateKernel(cl_program program,
  1051. const char * kernel_name,
  1052. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  1053. extern CL_API_ENTRY cl_int CL_API_CALL
  1054. clCreateKernelsInProgram(cl_program program,
  1055. cl_uint num_kernels,
  1056. cl_kernel * kernels,
  1057. cl_uint * num_kernels_ret) CL_API_SUFFIX__VERSION_1_0;
  1058. #ifdef CL_VERSION_2_1
  1059. extern CL_API_ENTRY cl_kernel CL_API_CALL
  1060. clCloneKernel(cl_kernel source_kernel,
  1061. cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1;
  1062. #endif
  1063. extern CL_API_ENTRY cl_int CL_API_CALL
  1064. clRetainKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0;
  1065. extern CL_API_ENTRY cl_int CL_API_CALL
  1066. clReleaseKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0;
  1067. extern CL_API_ENTRY cl_int CL_API_CALL
  1068. clSetKernelArg(cl_kernel kernel,
  1069. cl_uint arg_index,
  1070. size_t arg_size,
  1071. const void * arg_value) CL_API_SUFFIX__VERSION_1_0;
  1072. #ifdef CL_VERSION_2_0
  1073. extern CL_API_ENTRY cl_int CL_API_CALL
  1074. clSetKernelArgSVMPointer(cl_kernel kernel,
  1075. cl_uint arg_index,
  1076. const void * arg_value) CL_API_SUFFIX__VERSION_2_0;
  1077. extern CL_API_ENTRY cl_int CL_API_CALL
  1078. clSetKernelExecInfo(cl_kernel kernel,
  1079. cl_kernel_exec_info param_name,
  1080. size_t param_value_size,
  1081. const void * param_value) CL_API_SUFFIX__VERSION_2_0;
  1082. #endif
  1083. extern CL_API_ENTRY cl_int CL_API_CALL
  1084. clGetKernelInfo(cl_kernel kernel,
  1085. cl_kernel_info param_name,
  1086. size_t param_value_size,
  1087. void * param_value,
  1088. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1089. #ifdef CL_VERSION_1_2
  1090. extern CL_API_ENTRY cl_int CL_API_CALL
  1091. clGetKernelArgInfo(cl_kernel kernel,
  1092. cl_uint arg_indx,
  1093. cl_kernel_arg_info param_name,
  1094. size_t param_value_size,
  1095. void * param_value,
  1096. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_2;
  1097. #endif
  1098. extern CL_API_ENTRY cl_int CL_API_CALL
  1099. clGetKernelWorkGroupInfo(cl_kernel kernel,
  1100. cl_device_id device,
  1101. cl_kernel_work_group_info param_name,
  1102. size_t param_value_size,
  1103. void * param_value,
  1104. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1105. #ifdef CL_VERSION_2_1
  1106. extern CL_API_ENTRY cl_int CL_API_CALL
  1107. clGetKernelSubGroupInfo(cl_kernel kernel,
  1108. cl_device_id device,
  1109. cl_kernel_sub_group_info param_name,
  1110. size_t input_value_size,
  1111. const void* input_value,
  1112. size_t param_value_size,
  1113. void* param_value,
  1114. size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_2_1;
  1115. #endif
  1116. /* Event Object APIs */
  1117. extern CL_API_ENTRY cl_int CL_API_CALL
  1118. clWaitForEvents(cl_uint num_events,
  1119. const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0;
  1120. extern CL_API_ENTRY cl_int CL_API_CALL
  1121. clGetEventInfo(cl_event event,
  1122. cl_event_info param_name,
  1123. size_t param_value_size,
  1124. void * param_value,
  1125. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1126. #ifdef CL_VERSION_1_1
  1127. extern CL_API_ENTRY cl_event CL_API_CALL
  1128. clCreateUserEvent(cl_context context,
  1129. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1;
  1130. #endif
  1131. extern CL_API_ENTRY cl_int CL_API_CALL
  1132. clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
  1133. extern CL_API_ENTRY cl_int CL_API_CALL
  1134. clReleaseEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0;
  1135. #ifdef CL_VERSION_1_1
  1136. extern CL_API_ENTRY cl_int CL_API_CALL
  1137. clSetUserEventStatus(cl_event event,
  1138. cl_int execution_status) CL_API_SUFFIX__VERSION_1_1;
  1139. extern CL_API_ENTRY cl_int CL_API_CALL
  1140. clSetEventCallback(cl_event event,
  1141. cl_int command_exec_callback_type,
  1142. void (CL_CALLBACK * pfn_notify)(cl_event event,
  1143. cl_int event_command_status,
  1144. void * user_data),
  1145. void * user_data) CL_API_SUFFIX__VERSION_1_1;
  1146. #endif
  1147. /* Profiling APIs */
  1148. extern CL_API_ENTRY cl_int CL_API_CALL
  1149. clGetEventProfilingInfo(cl_event event,
  1150. cl_profiling_info param_name,
  1151. size_t param_value_size,
  1152. void * param_value,
  1153. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  1154. /* Flush and Finish APIs */
  1155. extern CL_API_ENTRY cl_int CL_API_CALL
  1156. clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
  1157. extern CL_API_ENTRY cl_int CL_API_CALL
  1158. clFinish(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0;
  1159. /* Enqueued Commands APIs */
  1160. extern CL_API_ENTRY cl_int CL_API_CALL
  1161. clEnqueueReadBuffer(cl_command_queue command_queue,
  1162. cl_mem buffer,
  1163. cl_bool blocking_read,
  1164. size_t offset,
  1165. size_t size,
  1166. void * ptr,
  1167. cl_uint num_events_in_wait_list,
  1168. const cl_event * event_wait_list,
  1169. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1170. #ifdef CL_VERSION_1_1
  1171. extern CL_API_ENTRY cl_int CL_API_CALL
  1172. clEnqueueReadBufferRect(cl_command_queue command_queue,
  1173. cl_mem buffer,
  1174. cl_bool blocking_read,
  1175. const size_t * buffer_offset,
  1176. const size_t * host_offset,
  1177. const size_t * region,
  1178. size_t buffer_row_pitch,
  1179. size_t buffer_slice_pitch,
  1180. size_t host_row_pitch,
  1181. size_t host_slice_pitch,
  1182. void * ptr,
  1183. cl_uint num_events_in_wait_list,
  1184. const cl_event * event_wait_list,
  1185. cl_event * event) CL_API_SUFFIX__VERSION_1_1;
  1186. #endif
  1187. extern CL_API_ENTRY cl_int CL_API_CALL
  1188. clEnqueueWriteBuffer(cl_command_queue command_queue,
  1189. cl_mem buffer,
  1190. cl_bool blocking_write,
  1191. size_t offset,
  1192. size_t size,
  1193. const void * ptr,
  1194. cl_uint num_events_in_wait_list,
  1195. const cl_event * event_wait_list,
  1196. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1197. #ifdef CL_VERSION_1_1
  1198. extern CL_API_ENTRY cl_int CL_API_CALL
  1199. clEnqueueWriteBufferRect(cl_command_queue command_queue,
  1200. cl_mem buffer,
  1201. cl_bool blocking_write,
  1202. const size_t * buffer_offset,
  1203. const size_t * host_offset,
  1204. const size_t * region,
  1205. size_t buffer_row_pitch,
  1206. size_t buffer_slice_pitch,
  1207. size_t host_row_pitch,
  1208. size_t host_slice_pitch,
  1209. const void * ptr,
  1210. cl_uint num_events_in_wait_list,
  1211. const cl_event * event_wait_list,
  1212. cl_event * event) CL_API_SUFFIX__VERSION_1_1;
  1213. #endif
  1214. #ifdef CL_VERSION_1_2
  1215. extern CL_API_ENTRY cl_int CL_API_CALL
  1216. clEnqueueFillBuffer(cl_command_queue command_queue,
  1217. cl_mem buffer,
  1218. const void * pattern,
  1219. size_t pattern_size,
  1220. size_t offset,
  1221. size_t size,
  1222. cl_uint num_events_in_wait_list,
  1223. const cl_event * event_wait_list,
  1224. cl_event * event) CL_API_SUFFIX__VERSION_1_2;
  1225. #endif
  1226. extern CL_API_ENTRY cl_int CL_API_CALL
  1227. clEnqueueCopyBuffer(cl_command_queue command_queue,
  1228. cl_mem src_buffer,
  1229. cl_mem dst_buffer,
  1230. size_t src_offset,
  1231. size_t dst_offset,
  1232. size_t size,
  1233. cl_uint num_events_in_wait_list,
  1234. const cl_event * event_wait_list,
  1235. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1236. #ifdef CL_VERSION_1_1
  1237. extern CL_API_ENTRY cl_int CL_API_CALL
  1238. clEnqueueCopyBufferRect(cl_command_queue command_queue,
  1239. cl_mem src_buffer,
  1240. cl_mem dst_buffer,
  1241. const size_t * src_origin,
  1242. const size_t * dst_origin,
  1243. const size_t * region,
  1244. size_t src_row_pitch,
  1245. size_t src_slice_pitch,
  1246. size_t dst_row_pitch,
  1247. size_t dst_slice_pitch,
  1248. cl_uint num_events_in_wait_list,
  1249. const cl_event * event_wait_list,
  1250. cl_event * event) CL_API_SUFFIX__VERSION_1_1;
  1251. #endif
  1252. extern CL_API_ENTRY cl_int CL_API_CALL
  1253. clEnqueueReadImage(cl_command_queue command_queue,
  1254. cl_mem image,
  1255. cl_bool blocking_read,
  1256. const size_t * origin,
  1257. const size_t * region,
  1258. size_t row_pitch,
  1259. size_t slice_pitch,
  1260. void * ptr,
  1261. cl_uint num_events_in_wait_list,
  1262. const cl_event * event_wait_list,
  1263. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1264. extern CL_API_ENTRY cl_int CL_API_CALL
  1265. clEnqueueWriteImage(cl_command_queue command_queue,
  1266. cl_mem image,
  1267. cl_bool blocking_write,
  1268. const size_t * origin,
  1269. const size_t * region,
  1270. size_t input_row_pitch,
  1271. size_t input_slice_pitch,
  1272. const void * ptr,
  1273. cl_uint num_events_in_wait_list,
  1274. const cl_event * event_wait_list,
  1275. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1276. #ifdef CL_VERSION_1_2
  1277. extern CL_API_ENTRY cl_int CL_API_CALL
  1278. clEnqueueFillImage(cl_command_queue command_queue,
  1279. cl_mem image,
  1280. const void * fill_color,
  1281. const size_t * origin,
  1282. const size_t * region,
  1283. cl_uint num_events_in_wait_list,
  1284. const cl_event * event_wait_list,
  1285. cl_event * event) CL_API_SUFFIX__VERSION_1_2;
  1286. #endif
  1287. extern CL_API_ENTRY cl_int CL_API_CALL
  1288. clEnqueueCopyImage(cl_command_queue command_queue,
  1289. cl_mem src_image,
  1290. cl_mem dst_image,
  1291. const size_t * src_origin,
  1292. const size_t * dst_origin,
  1293. const size_t * region,
  1294. cl_uint num_events_in_wait_list,
  1295. const cl_event * event_wait_list,
  1296. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1297. extern CL_API_ENTRY cl_int CL_API_CALL
  1298. clEnqueueCopyImageToBuffer(cl_command_queue command_queue,
  1299. cl_mem src_image,
  1300. cl_mem dst_buffer,
  1301. const size_t * src_origin,
  1302. const size_t * region,
  1303. size_t dst_offset,
  1304. cl_uint num_events_in_wait_list,
  1305. const cl_event * event_wait_list,
  1306. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1307. extern CL_API_ENTRY cl_int CL_API_CALL
  1308. clEnqueueCopyBufferToImage(cl_command_queue command_queue,
  1309. cl_mem src_buffer,
  1310. cl_mem dst_image,
  1311. size_t src_offset,
  1312. const size_t * dst_origin,
  1313. const size_t * region,
  1314. cl_uint num_events_in_wait_list,
  1315. const cl_event * event_wait_list,
  1316. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1317. extern CL_API_ENTRY void * CL_API_CALL
  1318. clEnqueueMapBuffer(cl_command_queue command_queue,
  1319. cl_mem buffer,
  1320. cl_bool blocking_map,
  1321. cl_map_flags map_flags,
  1322. size_t offset,
  1323. size_t size,
  1324. cl_uint num_events_in_wait_list,
  1325. const cl_event * event_wait_list,
  1326. cl_event * event,
  1327. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  1328. extern CL_API_ENTRY void * CL_API_CALL
  1329. clEnqueueMapImage(cl_command_queue command_queue,
  1330. cl_mem image,
  1331. cl_bool blocking_map,
  1332. cl_map_flags map_flags,
  1333. const size_t * origin,
  1334. const size_t * region,
  1335. size_t * image_row_pitch,
  1336. size_t * image_slice_pitch,
  1337. cl_uint num_events_in_wait_list,
  1338. const cl_event * event_wait_list,
  1339. cl_event * event,
  1340. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  1341. extern CL_API_ENTRY cl_int CL_API_CALL
  1342. clEnqueueUnmapMemObject(cl_command_queue command_queue,
  1343. cl_mem memobj,
  1344. void * mapped_ptr,
  1345. cl_uint num_events_in_wait_list,
  1346. const cl_event * event_wait_list,
  1347. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1348. #ifdef CL_VERSION_1_2
  1349. extern CL_API_ENTRY cl_int CL_API_CALL
  1350. clEnqueueMigrateMemObjects(cl_command_queue command_queue,
  1351. cl_uint num_mem_objects,
  1352. const cl_mem * mem_objects,
  1353. cl_mem_migration_flags flags,
  1354. cl_uint num_events_in_wait_list,
  1355. const cl_event * event_wait_list,
  1356. cl_event * event) CL_API_SUFFIX__VERSION_1_2;
  1357. #endif
  1358. extern CL_API_ENTRY cl_int CL_API_CALL
  1359. clEnqueueNDRangeKernel(cl_command_queue command_queue,
  1360. cl_kernel kernel,
  1361. cl_uint work_dim,
  1362. const size_t * global_work_offset,
  1363. const size_t * global_work_size,
  1364. const size_t * local_work_size,
  1365. cl_uint num_events_in_wait_list,
  1366. const cl_event * event_wait_list,
  1367. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1368. extern CL_API_ENTRY cl_int CL_API_CALL
  1369. clEnqueueNativeKernel(cl_command_queue command_queue,
  1370. void (CL_CALLBACK * user_func)(void *),
  1371. void * args,
  1372. size_t cb_args,
  1373. cl_uint num_mem_objects,
  1374. const cl_mem * mem_list,
  1375. const void ** args_mem_loc,
  1376. cl_uint num_events_in_wait_list,
  1377. const cl_event * event_wait_list,
  1378. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  1379. #ifdef CL_VERSION_1_2
  1380. extern CL_API_ENTRY cl_int CL_API_CALL
  1381. clEnqueueMarkerWithWaitList(cl_command_queue command_queue,
  1382. cl_uint num_events_in_wait_list,
  1383. const cl_event * event_wait_list,
  1384. cl_event * event) CL_API_SUFFIX__VERSION_1_2;
  1385. extern CL_API_ENTRY cl_int CL_API_CALL
  1386. clEnqueueBarrierWithWaitList(cl_command_queue command_queue,
  1387. cl_uint num_events_in_wait_list,
  1388. const cl_event * event_wait_list,
  1389. cl_event * event) CL_API_SUFFIX__VERSION_1_2;
  1390. #endif
  1391. #ifdef CL_VERSION_2_0
  1392. extern CL_API_ENTRY cl_int CL_API_CALL
  1393. clEnqueueSVMFree(cl_command_queue command_queue,
  1394. cl_uint num_svm_pointers,
  1395. void * svm_pointers[],
  1396. void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue,
  1397. cl_uint num_svm_pointers,
  1398. void * svm_pointers[],
  1399. void * user_data),
  1400. void * user_data,
  1401. cl_uint num_events_in_wait_list,
  1402. const cl_event * event_wait_list,
  1403. cl_event * event) CL_API_SUFFIX__VERSION_2_0;
  1404. extern CL_API_ENTRY cl_int CL_API_CALL
  1405. clEnqueueSVMMemcpy(cl_command_queue command_queue,
  1406. cl_bool blocking_copy,
  1407. void * dst_ptr,
  1408. const void * src_ptr,
  1409. size_t size,
  1410. cl_uint num_events_in_wait_list,
  1411. const cl_event * event_wait_list,
  1412. cl_event * event) CL_API_SUFFIX__VERSION_2_0;
  1413. extern CL_API_ENTRY cl_int CL_API_CALL
  1414. clEnqueueSVMMemFill(cl_command_queue command_queue,
  1415. void * svm_ptr,
  1416. const void * pattern,
  1417. size_t pattern_size,
  1418. size_t size,
  1419. cl_uint num_events_in_wait_list,
  1420. const cl_event * event_wait_list,
  1421. cl_event * event) CL_API_SUFFIX__VERSION_2_0;
  1422. extern CL_API_ENTRY cl_int CL_API_CALL
  1423. clEnqueueSVMMap(cl_command_queue command_queue,
  1424. cl_bool blocking_map,
  1425. cl_map_flags flags,
  1426. void * svm_ptr,
  1427. size_t size,
  1428. cl_uint num_events_in_wait_list,
  1429. const cl_event * event_wait_list,
  1430. cl_event * event) CL_API_SUFFIX__VERSION_2_0;
  1431. extern CL_API_ENTRY cl_int CL_API_CALL
  1432. clEnqueueSVMUnmap(cl_command_queue command_queue,
  1433. void * svm_ptr,
  1434. cl_uint num_events_in_wait_list,
  1435. const cl_event * event_wait_list,
  1436. cl_event * event) CL_API_SUFFIX__VERSION_2_0;
  1437. #endif
  1438. #ifdef CL_VERSION_2_1
  1439. extern CL_API_ENTRY cl_int CL_API_CALL
  1440. clEnqueueSVMMigrateMem(cl_command_queue command_queue,
  1441. cl_uint num_svm_pointers,
  1442. const void ** svm_pointers,
  1443. const size_t * sizes,
  1444. cl_mem_migration_flags flags,
  1445. cl_uint num_events_in_wait_list,
  1446. const cl_event * event_wait_list,
  1447. cl_event * event) CL_API_SUFFIX__VERSION_2_1;
  1448. #endif
  1449. #ifdef CL_VERSION_1_2
  1450. /* Extension function access
  1451. *
  1452. * Returns the extension function address for the given function name,
  1453. * or NULL if a valid function can not be found. The client must
  1454. * check to make sure the address is not NULL, before using or
  1455. * calling the returned function address.
  1456. */
  1457. extern CL_API_ENTRY void * CL_API_CALL
  1458. clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
  1459. const char * func_name) CL_API_SUFFIX__VERSION_1_2;
  1460. #endif
  1461. #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
  1462. /*
  1463. * WARNING:
  1464. * This API introduces mutable state into the OpenCL implementation. It has been REMOVED
  1465. * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
  1466. * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
  1467. * It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
  1468. *
  1469. * Software developers previously relying on this API are instructed to set the command queue
  1470. * properties when creating the queue, instead.
  1471. */
  1472. extern CL_API_ENTRY cl_int CL_API_CALL
  1473. clSetCommandQueueProperty(cl_command_queue command_queue,
  1474. cl_command_queue_properties properties,
  1475. cl_bool enable,
  1476. cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
  1477. #endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
  1478. /* Deprecated OpenCL 1.1 APIs */
  1479. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  1480. clCreateImage2D(cl_context context,
  1481. cl_mem_flags flags,
  1482. const cl_image_format * image_format,
  1483. size_t image_width,
  1484. size_t image_height,
  1485. size_t image_row_pitch,
  1486. void * host_ptr,
  1487. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1488. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  1489. clCreateImage3D(cl_context context,
  1490. cl_mem_flags flags,
  1491. const cl_image_format * image_format,
  1492. size_t image_width,
  1493. size_t image_height,
  1494. size_t image_depth,
  1495. size_t image_row_pitch,
  1496. size_t image_slice_pitch,
  1497. void * host_ptr,
  1498. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1499. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1500. clEnqueueMarker(cl_command_queue command_queue,
  1501. cl_event * event) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1502. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1503. clEnqueueWaitForEvents(cl_command_queue command_queue,
  1504. cl_uint num_events,
  1505. const cl_event * event_list) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1506. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1507. clEnqueueBarrier(cl_command_queue command_queue) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1508. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
  1509. clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1510. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
  1511. clGetExtensionFunctionAddress(const char * func_name) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  1512. /* Deprecated OpenCL 2.0 APIs */
  1513. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
  1514. clCreateCommandQueue(cl_context context,
  1515. cl_device_id device,
  1516. cl_command_queue_properties properties,
  1517. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
  1518. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
  1519. clCreateSampler(cl_context context,
  1520. cl_bool normalized_coords,
  1521. cl_addressing_mode addressing_mode,
  1522. cl_filter_mode filter_mode,
  1523. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
  1524. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
  1525. clEnqueueTask(cl_command_queue command_queue,
  1526. cl_kernel kernel,
  1527. cl_uint num_events_in_wait_list,
  1528. const cl_event * event_wait_list,
  1529. cl_event * event) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
  1530. #ifdef __cplusplus
  1531. }
  1532. #endif
  1533. #endif /* __OPENCL_CL_H */