cl.h 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. /*******************************************************************************
  2. * Copyright (c) 2008-2010 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. /* $Revision: 11707 $ on $Date: 2010-06-13 23:30:16 -0700 (Sun, 13 Jun 2010) $ */
  24. #ifndef __OPENCL_CL_H
  25. #define __OPENCL_CL_H
  26. #ifdef __APPLE__
  27. #include <OpenCL/cl_platform.h>
  28. #else
  29. #include <CL/cl_platform.h>
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /******************************************************************************/
  35. typedef struct _cl_platform_id * cl_platform_id;
  36. typedef struct _cl_device_id * cl_device_id;
  37. typedef struct _cl_context * cl_context;
  38. typedef struct _cl_command_queue * cl_command_queue;
  39. typedef struct _cl_mem * cl_mem;
  40. typedef struct _cl_program * cl_program;
  41. typedef struct _cl_kernel * cl_kernel;
  42. typedef struct _cl_event * cl_event;
  43. typedef struct _cl_sampler * cl_sampler;
  44. 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. */
  45. typedef cl_ulong cl_bitfield;
  46. typedef cl_bitfield cl_device_type;
  47. typedef cl_uint cl_platform_info;
  48. typedef cl_uint cl_device_info;
  49. typedef cl_bitfield cl_device_address_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. typedef cl_bitfield cl_command_queue_properties;
  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_uint cl_image_info;
  64. typedef cl_uint cl_addressing_mode;
  65. typedef cl_uint cl_filter_mode;
  66. typedef cl_uint cl_sampler_info;
  67. typedef cl_bitfield cl_map_flags;
  68. typedef cl_uint cl_program_info;
  69. typedef cl_uint cl_program_build_info;
  70. typedef cl_int cl_build_status;
  71. typedef cl_uint cl_kernel_info;
  72. typedef cl_uint cl_kernel_work_group_info;
  73. typedef cl_uint cl_event_info;
  74. typedef cl_uint cl_command_type;
  75. typedef cl_uint cl_profiling_info;
  76. typedef struct _cl_image_format {
  77. cl_channel_order image_channel_order;
  78. cl_channel_type image_channel_data_type;
  79. } cl_image_format;
  80. /******************************************************************************/
  81. /* Error Codes */
  82. #define CL_SUCCESS 0
  83. #define CL_DEVICE_NOT_FOUND -1
  84. #define CL_DEVICE_NOT_AVAILABLE -2
  85. #define CL_COMPILER_NOT_AVAILABLE -3
  86. #define CL_MEM_OBJECT_ALLOCATION_FAILURE -4
  87. #define CL_OUT_OF_RESOURCES -5
  88. #define CL_OUT_OF_HOST_MEMORY -6
  89. #define CL_PROFILING_INFO_NOT_AVAILABLE -7
  90. #define CL_MEM_COPY_OVERLAP -8
  91. #define CL_IMAGE_FORMAT_MISMATCH -9
  92. #define CL_IMAGE_FORMAT_NOT_SUPPORTED -10
  93. #define CL_BUILD_PROGRAM_FAILURE -11
  94. #define CL_MAP_FAILURE -12
  95. #define CL_INVALID_VALUE -30
  96. #define CL_INVALID_DEVICE_TYPE -31
  97. #define CL_INVALID_PLATFORM -32
  98. #define CL_INVALID_DEVICE -33
  99. #define CL_INVALID_CONTEXT -34
  100. #define CL_INVALID_QUEUE_PROPERTIES -35
  101. #define CL_INVALID_COMMAND_QUEUE -36
  102. #define CL_INVALID_HOST_PTR -37
  103. #define CL_INVALID_MEM_OBJECT -38
  104. #define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39
  105. #define CL_INVALID_IMAGE_SIZE -40
  106. #define CL_INVALID_SAMPLER -41
  107. #define CL_INVALID_BINARY -42
  108. #define CL_INVALID_BUILD_OPTIONS -43
  109. #define CL_INVALID_PROGRAM -44
  110. #define CL_INVALID_PROGRAM_EXECUTABLE -45
  111. #define CL_INVALID_KERNEL_NAME -46
  112. #define CL_INVALID_KERNEL_DEFINITION -47
  113. #define CL_INVALID_KERNEL -48
  114. #define CL_INVALID_ARG_INDEX -49
  115. #define CL_INVALID_ARG_VALUE -50
  116. #define CL_INVALID_ARG_SIZE -51
  117. #define CL_INVALID_KERNEL_ARGS -52
  118. #define CL_INVALID_WORK_DIMENSION -53
  119. #define CL_INVALID_WORK_GROUP_SIZE -54
  120. #define CL_INVALID_WORK_ITEM_SIZE -55
  121. #define CL_INVALID_GLOBAL_OFFSET -56
  122. #define CL_INVALID_EVENT_WAIT_LIST -57
  123. #define CL_INVALID_EVENT -58
  124. #define CL_INVALID_OPERATION -59
  125. #define CL_INVALID_GL_OBJECT -60
  126. #define CL_INVALID_BUFFER_SIZE -61
  127. #define CL_INVALID_MIP_LEVEL -62
  128. #define CL_INVALID_GLOBAL_WORK_SIZE -63
  129. /* OpenCL Version */
  130. #define CL_VERSION_1_0 1
  131. /* cl_bool */
  132. #define CL_FALSE 0
  133. #define CL_TRUE 1
  134. /* cl_platform_info */
  135. #define CL_PLATFORM_PROFILE 0x0900
  136. #define CL_PLATFORM_VERSION 0x0901
  137. #define CL_PLATFORM_NAME 0x0902
  138. #define CL_PLATFORM_VENDOR 0x0903
  139. #define CL_PLATFORM_EXTENSIONS 0x0904
  140. /* cl_device_type - bitfield */
  141. #define CL_DEVICE_TYPE_DEFAULT (1 << 0)
  142. #define CL_DEVICE_TYPE_CPU (1 << 1)
  143. #define CL_DEVICE_TYPE_GPU (1 << 2)
  144. #define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
  145. #define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
  146. /* cl_device_info */
  147. #define CL_DEVICE_TYPE 0x1000
  148. #define CL_DEVICE_VENDOR_ID 0x1001
  149. #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
  150. #define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
  151. #define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
  152. #define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
  153. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
  154. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
  155. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
  156. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009
  157. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A
  158. #define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B
  159. #define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C
  160. #define CL_DEVICE_ADDRESS_BITS 0x100D
  161. #define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E
  162. #define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F
  163. #define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010
  164. #define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011
  165. #define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012
  166. #define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013
  167. #define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014
  168. #define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015
  169. #define CL_DEVICE_IMAGE_SUPPORT 0x1016
  170. #define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017
  171. #define CL_DEVICE_MAX_SAMPLERS 0x1018
  172. #define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019
  173. #define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A
  174. #define CL_DEVICE_SINGLE_FP_CONFIG 0x101B
  175. #define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C
  176. #define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D
  177. #define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E
  178. #define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F
  179. #define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020
  180. #define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021
  181. #define CL_DEVICE_LOCAL_MEM_TYPE 0x1022
  182. #define CL_DEVICE_LOCAL_MEM_SIZE 0x1023
  183. #define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024
  184. #define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025
  185. #define CL_DEVICE_ENDIAN_LITTLE 0x1026
  186. #define CL_DEVICE_AVAILABLE 0x1027
  187. #define CL_DEVICE_COMPILER_AVAILABLE 0x1028
  188. #define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029
  189. #define CL_DEVICE_QUEUE_PROPERTIES 0x102A
  190. #define CL_DEVICE_NAME 0x102B
  191. #define CL_DEVICE_VENDOR 0x102C
  192. #define CL_DRIVER_VERSION 0x102D
  193. #define CL_DEVICE_PROFILE 0x102E
  194. #define CL_DEVICE_VERSION 0x102F
  195. #define CL_DEVICE_EXTENSIONS 0x1030
  196. #define CL_DEVICE_PLATFORM 0x1031
  197. /* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
  198. /* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
  199. /* cl_device_fp_config - bitfield */
  200. #define CL_FP_DENORM (1 << 0)
  201. #define CL_FP_INF_NAN (1 << 1)
  202. #define CL_FP_ROUND_TO_NEAREST (1 << 2)
  203. #define CL_FP_ROUND_TO_ZERO (1 << 3)
  204. #define CL_FP_ROUND_TO_INF (1 << 4)
  205. #define CL_FP_FMA (1 << 5)
  206. /* cl_device_mem_cache_type */
  207. #define CL_NONE 0x0
  208. #define CL_READ_ONLY_CACHE 0x1
  209. #define CL_READ_WRITE_CACHE 0x2
  210. /* cl_device_local_mem_type */
  211. #define CL_LOCAL 0x1
  212. #define CL_GLOBAL 0x2
  213. /* cl_device_exec_capabilities - bitfield */
  214. #define CL_EXEC_KERNEL (1 << 0)
  215. #define CL_EXEC_NATIVE_KERNEL (1 << 1)
  216. /* cl_command_queue_properties - bitfield */
  217. #define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0)
  218. #define CL_QUEUE_PROFILING_ENABLE (1 << 1)
  219. /* cl_context_info */
  220. #define CL_CONTEXT_REFERENCE_COUNT 0x1080
  221. #define CL_CONTEXT_DEVICES 0x1081
  222. #define CL_CONTEXT_PROPERTIES 0x1082
  223. /* cl_context_info + cl_context_properties */
  224. #define CL_CONTEXT_PLATFORM 0x1084
  225. /* cl_command_queue_info */
  226. #define CL_QUEUE_CONTEXT 0x1090
  227. #define CL_QUEUE_DEVICE 0x1091
  228. #define CL_QUEUE_REFERENCE_COUNT 0x1092
  229. #define CL_QUEUE_PROPERTIES 0x1093
  230. /* cl_mem_flags - bitfield */
  231. #define CL_MEM_READ_WRITE (1 << 0)
  232. #define CL_MEM_WRITE_ONLY (1 << 1)
  233. #define CL_MEM_READ_ONLY (1 << 2)
  234. #define CL_MEM_USE_HOST_PTR (1 << 3)
  235. #define CL_MEM_ALLOC_HOST_PTR (1 << 4)
  236. #define CL_MEM_COPY_HOST_PTR (1 << 5)
  237. /* cl_channel_order */
  238. #define CL_R 0x10B0
  239. #define CL_A 0x10B1
  240. #define CL_RG 0x10B2
  241. #define CL_RA 0x10B3
  242. #define CL_RGB 0x10B4
  243. #define CL_RGBA 0x10B5
  244. #define CL_BGRA 0x10B6
  245. #define CL_ARGB 0x10B7
  246. #define CL_INTENSITY 0x10B8
  247. #define CL_LUMINANCE 0x10B9
  248. /* cl_channel_type */
  249. #define CL_SNORM_INT8 0x10D0
  250. #define CL_SNORM_INT16 0x10D1
  251. #define CL_UNORM_INT8 0x10D2
  252. #define CL_UNORM_INT16 0x10D3
  253. #define CL_UNORM_SHORT_565 0x10D4
  254. #define CL_UNORM_SHORT_555 0x10D5
  255. #define CL_UNORM_INT_101010 0x10D6
  256. #define CL_SIGNED_INT8 0x10D7
  257. #define CL_SIGNED_INT16 0x10D8
  258. #define CL_SIGNED_INT32 0x10D9
  259. #define CL_UNSIGNED_INT8 0x10DA
  260. #define CL_UNSIGNED_INT16 0x10DB
  261. #define CL_UNSIGNED_INT32 0x10DC
  262. #define CL_HALF_FLOAT 0x10DD
  263. #define CL_FLOAT 0x10DE
  264. /* cl_mem_object_type */
  265. #define CL_MEM_OBJECT_BUFFER 0x10F0
  266. #define CL_MEM_OBJECT_IMAGE2D 0x10F1
  267. #define CL_MEM_OBJECT_IMAGE3D 0x10F2
  268. /* cl_mem_info */
  269. #define CL_MEM_TYPE 0x1100
  270. #define CL_MEM_FLAGS 0x1101
  271. #define CL_MEM_SIZE 0x1102
  272. #define CL_MEM_HOST_PTR 0x1103
  273. #define CL_MEM_MAP_COUNT 0x1104
  274. #define CL_MEM_REFERENCE_COUNT 0x1105
  275. #define CL_MEM_CONTEXT 0x1106
  276. /* cl_image_info */
  277. #define CL_IMAGE_FORMAT 0x1110
  278. #define CL_IMAGE_ELEMENT_SIZE 0x1111
  279. #define CL_IMAGE_ROW_PITCH 0x1112
  280. #define CL_IMAGE_SLICE_PITCH 0x1113
  281. #define CL_IMAGE_WIDTH 0x1114
  282. #define CL_IMAGE_HEIGHT 0x1115
  283. #define CL_IMAGE_DEPTH 0x1116
  284. /* cl_addressing_mode */
  285. #define CL_ADDRESS_NONE 0x1130
  286. #define CL_ADDRESS_CLAMP_TO_EDGE 0x1131
  287. #define CL_ADDRESS_CLAMP 0x1132
  288. #define CL_ADDRESS_REPEAT 0x1133
  289. /* cl_filter_mode */
  290. #define CL_FILTER_NEAREST 0x1140
  291. #define CL_FILTER_LINEAR 0x1141
  292. /* cl_sampler_info */
  293. #define CL_SAMPLER_REFERENCE_COUNT 0x1150
  294. #define CL_SAMPLER_CONTEXT 0x1151
  295. #define CL_SAMPLER_NORMALIZED_COORDS 0x1152
  296. #define CL_SAMPLER_ADDRESSING_MODE 0x1153
  297. #define CL_SAMPLER_FILTER_MODE 0x1154
  298. /* cl_map_flags - bitfield */
  299. #define CL_MAP_READ (1 << 0)
  300. #define CL_MAP_WRITE (1 << 1)
  301. /* cl_program_info */
  302. #define CL_PROGRAM_REFERENCE_COUNT 0x1160
  303. #define CL_PROGRAM_CONTEXT 0x1161
  304. #define CL_PROGRAM_NUM_DEVICES 0x1162
  305. #define CL_PROGRAM_DEVICES 0x1163
  306. #define CL_PROGRAM_SOURCE 0x1164
  307. #define CL_PROGRAM_BINARY_SIZES 0x1165
  308. #define CL_PROGRAM_BINARIES 0x1166
  309. /* cl_program_build_info */
  310. #define CL_PROGRAM_BUILD_STATUS 0x1181
  311. #define CL_PROGRAM_BUILD_OPTIONS 0x1182
  312. #define CL_PROGRAM_BUILD_LOG 0x1183
  313. /* cl_build_status */
  314. #define CL_BUILD_SUCCESS 0
  315. #define CL_BUILD_NONE -1
  316. #define CL_BUILD_ERROR -2
  317. #define CL_BUILD_IN_PROGRESS -3
  318. /* cl_kernel_info */
  319. #define CL_KERNEL_FUNCTION_NAME 0x1190
  320. #define CL_KERNEL_NUM_ARGS 0x1191
  321. #define CL_KERNEL_REFERENCE_COUNT 0x1192
  322. #define CL_KERNEL_CONTEXT 0x1193
  323. #define CL_KERNEL_PROGRAM 0x1194
  324. /* cl_kernel_work_group_info */
  325. #define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
  326. #define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1
  327. #define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
  328. /* cl_event_info */
  329. #define CL_EVENT_COMMAND_QUEUE 0x11D0
  330. #define CL_EVENT_COMMAND_TYPE 0x11D1
  331. #define CL_EVENT_REFERENCE_COUNT 0x11D2
  332. #define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3
  333. /* cl_command_type */
  334. #define CL_COMMAND_NDRANGE_KERNEL 0x11F0
  335. #define CL_COMMAND_TASK 0x11F1
  336. #define CL_COMMAND_NATIVE_KERNEL 0x11F2
  337. #define CL_COMMAND_READ_BUFFER 0x11F3
  338. #define CL_COMMAND_WRITE_BUFFER 0x11F4
  339. #define CL_COMMAND_COPY_BUFFER 0x11F5
  340. #define CL_COMMAND_READ_IMAGE 0x11F6
  341. #define CL_COMMAND_WRITE_IMAGE 0x11F7
  342. #define CL_COMMAND_COPY_IMAGE 0x11F8
  343. #define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9
  344. #define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA
  345. #define CL_COMMAND_MAP_BUFFER 0x11FB
  346. #define CL_COMMAND_MAP_IMAGE 0x11FC
  347. #define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD
  348. #define CL_COMMAND_MARKER 0x11FE
  349. #define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF
  350. #define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200
  351. /* command execution status */
  352. #define CL_COMPLETE 0x0
  353. #define CL_RUNNING 0x1
  354. #define CL_SUBMITTED 0x2
  355. #define CL_QUEUED 0x3
  356. /* cl_profiling_info */
  357. #define CL_PROFILING_COMMAND_QUEUED 0x1280
  358. #define CL_PROFILING_COMMAND_SUBMIT 0x1281
  359. #define CL_PROFILING_COMMAND_START 0x1282
  360. #define CL_PROFILING_COMMAND_END 0x1283
  361. /********************************************************************************************************/
  362. /* Platform API */
  363. extern CL_API_ENTRY cl_int CL_API_CALL
  364. clGetPlatformIDs(cl_uint /* num_entries */,
  365. cl_platform_id * /* platforms */,
  366. cl_uint * /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
  367. extern CL_API_ENTRY cl_int CL_API_CALL
  368. clGetPlatformInfo(cl_platform_id /* platform */,
  369. cl_platform_info /* param_name */,
  370. size_t /* param_value_size */,
  371. void * /* param_value */,
  372. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  373. /* Device APIs */
  374. extern CL_API_ENTRY cl_int CL_API_CALL
  375. clGetDeviceIDs(cl_platform_id /* platform */,
  376. cl_device_type /* device_type */,
  377. cl_uint /* num_entries */,
  378. cl_device_id * /* devices */,
  379. cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
  380. extern CL_API_ENTRY cl_int CL_API_CALL
  381. clGetDeviceInfo(cl_device_id /* device */,
  382. cl_device_info /* param_name */,
  383. size_t /* param_value_size */,
  384. void * /* param_value */,
  385. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  386. /* Context APIs */
  387. extern CL_API_ENTRY cl_context CL_API_CALL
  388. clCreateContext(const cl_context_properties * /* properties */,
  389. cl_uint /* num_devices */,
  390. const cl_device_id * /* devices */,
  391. void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
  392. void * /* user_data */,
  393. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  394. extern CL_API_ENTRY cl_context CL_API_CALL
  395. clCreateContextFromType(const cl_context_properties * /* properties */,
  396. cl_device_type /* device_type */,
  397. void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
  398. void * /* user_data */,
  399. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  400. extern CL_API_ENTRY cl_int CL_API_CALL
  401. clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  402. extern CL_API_ENTRY cl_int CL_API_CALL
  403. clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
  404. extern CL_API_ENTRY cl_int CL_API_CALL
  405. clGetContextInfo(cl_context /* context */,
  406. cl_context_info /* param_name */,
  407. size_t /* param_value_size */,
  408. void * /* param_value */,
  409. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  410. /* Command Queue APIs */
  411. extern CL_API_ENTRY cl_command_queue CL_API_CALL
  412. clCreateCommandQueue(cl_context /* context */,
  413. cl_device_id /* device */,
  414. cl_command_queue_properties /* properties */,
  415. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  416. extern CL_API_ENTRY cl_int CL_API_CALL
  417. clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  418. extern CL_API_ENTRY cl_int CL_API_CALL
  419. clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  420. extern CL_API_ENTRY cl_int CL_API_CALL
  421. clGetCommandQueueInfo(cl_command_queue /* command_queue */,
  422. cl_command_queue_info /* param_name */,
  423. size_t /* param_value_size */,
  424. void * /* param_value */,
  425. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  426. extern CL_API_ENTRY cl_int CL_API_CALL
  427. clSetCommandQueueProperty(cl_command_queue /* command_queue */,
  428. cl_command_queue_properties /* properties */,
  429. cl_bool /* enable */,
  430. cl_command_queue_properties * /* old_properties */) CL_API_SUFFIX__VERSION_1_0;
  431. /* Memory Object APIs */
  432. extern CL_API_ENTRY cl_mem CL_API_CALL
  433. clCreateBuffer(cl_context /* context */,
  434. cl_mem_flags /* flags */,
  435. size_t /* size */,
  436. void * /* host_ptr */,
  437. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  438. extern CL_API_ENTRY cl_mem CL_API_CALL
  439. clCreateImage2D(cl_context /* context */,
  440. cl_mem_flags /* flags */,
  441. const cl_image_format * /* image_format */,
  442. size_t /* image_width */,
  443. size_t /* image_height */,
  444. size_t /* image_row_pitch */,
  445. void * /* host_ptr */,
  446. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  447. extern CL_API_ENTRY cl_mem CL_API_CALL
  448. clCreateImage3D(cl_context /* context */,
  449. cl_mem_flags /* flags */,
  450. const cl_image_format * /* image_format */,
  451. size_t /* image_width */,
  452. size_t /* image_height */,
  453. size_t /* image_depth */,
  454. size_t /* image_row_pitch */,
  455. size_t /* image_slice_pitch */,
  456. void * /* host_ptr */,
  457. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  458. extern CL_API_ENTRY cl_int CL_API_CALL
  459. clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  460. extern CL_API_ENTRY cl_int CL_API_CALL
  461. clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
  462. extern CL_API_ENTRY cl_int CL_API_CALL
  463. clGetSupportedImageFormats(cl_context /* context */,
  464. cl_mem_flags /* flags */,
  465. cl_mem_object_type /* image_type */,
  466. cl_uint /* num_entries */,
  467. cl_image_format * /* image_formats */,
  468. cl_uint * /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
  469. extern CL_API_ENTRY cl_int CL_API_CALL
  470. clGetMemObjectInfo(cl_mem /* memobj */,
  471. cl_mem_info /* param_name */,
  472. size_t /* param_value_size */,
  473. void * /* param_value */,
  474. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  475. extern CL_API_ENTRY cl_int CL_API_CALL
  476. clGetImageInfo(cl_mem /* image */,
  477. cl_image_info /* param_name */,
  478. size_t /* param_value_size */,
  479. void * /* param_value */,
  480. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  481. /* Sampler APIs */
  482. extern CL_API_ENTRY cl_sampler CL_API_CALL
  483. clCreateSampler(cl_context /* context */,
  484. cl_bool /* normalized_coords */,
  485. cl_addressing_mode /* addressing_mode */,
  486. cl_filter_mode /* filter_mode */,
  487. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  488. extern CL_API_ENTRY cl_int CL_API_CALL
  489. clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  490. extern CL_API_ENTRY cl_int CL_API_CALL
  491. clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
  492. extern CL_API_ENTRY cl_int CL_API_CALL
  493. clGetSamplerInfo(cl_sampler /* sampler */,
  494. cl_sampler_info /* param_name */,
  495. size_t /* param_value_size */,
  496. void * /* param_value */,
  497. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  498. /* Program Object APIs */
  499. extern CL_API_ENTRY cl_program CL_API_CALL
  500. clCreateProgramWithSource(cl_context /* context */,
  501. cl_uint /* count */,
  502. const char ** /* strings */,
  503. const size_t * /* lengths */,
  504. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  505. extern CL_API_ENTRY cl_program CL_API_CALL
  506. clCreateProgramWithBinary(cl_context /* context */,
  507. cl_uint /* num_devices */,
  508. const cl_device_id * /* device_list */,
  509. const size_t * /* lengths */,
  510. const unsigned char ** /* binaries */,
  511. cl_int * /* binary_status */,
  512. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  513. extern CL_API_ENTRY cl_int CL_API_CALL
  514. clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  515. extern CL_API_ENTRY cl_int CL_API_CALL
  516. clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
  517. extern CL_API_ENTRY cl_int CL_API_CALL
  518. clBuildProgram(cl_program /* program */,
  519. cl_uint /* num_devices */,
  520. const cl_device_id * /* device_list */,
  521. const char * /* options */,
  522. void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
  523. void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
  524. extern CL_API_ENTRY cl_int CL_API_CALL
  525. clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
  526. extern CL_API_ENTRY cl_int CL_API_CALL
  527. clGetProgramInfo(cl_program /* program */,
  528. cl_program_info /* param_name */,
  529. size_t /* param_value_size */,
  530. void * /* param_value */,
  531. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  532. extern CL_API_ENTRY cl_int CL_API_CALL
  533. clGetProgramBuildInfo(cl_program /* program */,
  534. cl_device_id /* device */,
  535. cl_program_build_info /* param_name */,
  536. size_t /* param_value_size */,
  537. void * /* param_value */,
  538. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  539. /* Kernel Object APIs */
  540. extern CL_API_ENTRY cl_kernel CL_API_CALL
  541. clCreateKernel(cl_program /* program */,
  542. const char * /* kernel_name */,
  543. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  544. extern CL_API_ENTRY cl_int CL_API_CALL
  545. clCreateKernelsInProgram(cl_program /* program */,
  546. cl_uint /* num_kernels */,
  547. cl_kernel * /* kernels */,
  548. cl_uint * /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
  549. extern CL_API_ENTRY cl_int CL_API_CALL
  550. clRetainKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  551. extern CL_API_ENTRY cl_int CL_API_CALL
  552. clReleaseKernel(cl_kernel /* kernel */) CL_API_SUFFIX__VERSION_1_0;
  553. extern CL_API_ENTRY cl_int CL_API_CALL
  554. clSetKernelArg(cl_kernel /* kernel */,
  555. cl_uint /* arg_index */,
  556. size_t /* arg_size */,
  557. const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
  558. extern CL_API_ENTRY cl_int CL_API_CALL
  559. clGetKernelInfo(cl_kernel /* kernel */,
  560. cl_kernel_info /* param_name */,
  561. size_t /* param_value_size */,
  562. void * /* param_value */,
  563. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  564. extern CL_API_ENTRY cl_int CL_API_CALL
  565. clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
  566. cl_device_id /* device */,
  567. cl_kernel_work_group_info /* param_name */,
  568. size_t /* param_value_size */,
  569. void * /* param_value */,
  570. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  571. /* Event Object APIs */
  572. extern CL_API_ENTRY cl_int CL_API_CALL
  573. clWaitForEvents(cl_uint /* num_events */,
  574. const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
  575. extern CL_API_ENTRY cl_int CL_API_CALL
  576. clGetEventInfo(cl_event /* event */,
  577. cl_event_info /* param_name */,
  578. size_t /* param_value_size */,
  579. void * /* param_value */,
  580. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  581. extern CL_API_ENTRY cl_int CL_API_CALL
  582. clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  583. extern CL_API_ENTRY cl_int CL_API_CALL
  584. clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
  585. /* Profiling APIs */
  586. extern CL_API_ENTRY cl_int CL_API_CALL
  587. clGetEventProfilingInfo(cl_event /* event */,
  588. cl_profiling_info /* param_name */,
  589. size_t /* param_value_size */,
  590. void * /* param_value */,
  591. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  592. /* Flush and Finish APIs */
  593. extern CL_API_ENTRY cl_int CL_API_CALL
  594. clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  595. extern CL_API_ENTRY cl_int CL_API_CALL
  596. clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  597. /* Enqueued Commands APIs */
  598. extern CL_API_ENTRY cl_int CL_API_CALL
  599. clEnqueueReadBuffer(cl_command_queue /* command_queue */,
  600. cl_mem /* buffer */,
  601. cl_bool /* blocking_read */,
  602. size_t /* offset */,
  603. size_t /* cb */,
  604. void * /* ptr */,
  605. cl_uint /* num_events_in_wait_list */,
  606. const cl_event * /* event_wait_list */,
  607. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  608. extern CL_API_ENTRY cl_int CL_API_CALL
  609. clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
  610. cl_mem /* buffer */,
  611. cl_bool /* blocking_write */,
  612. size_t /* offset */,
  613. size_t /* cb */,
  614. const void * /* ptr */,
  615. cl_uint /* num_events_in_wait_list */,
  616. const cl_event * /* event_wait_list */,
  617. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  618. extern CL_API_ENTRY cl_int CL_API_CALL
  619. clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
  620. cl_mem /* src_buffer */,
  621. cl_mem /* dst_buffer */,
  622. size_t /* src_offset */,
  623. size_t /* dst_offset */,
  624. size_t /* cb */,
  625. cl_uint /* num_events_in_wait_list */,
  626. const cl_event * /* event_wait_list */,
  627. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  628. extern CL_API_ENTRY cl_int CL_API_CALL
  629. clEnqueueReadImage(cl_command_queue /* command_queue */,
  630. cl_mem /* image */,
  631. cl_bool /* blocking_read */,
  632. const size_t * /* origin[3] */,
  633. const size_t * /* region[3] */,
  634. size_t /* row_pitch */,
  635. size_t /* slice_pitch */,
  636. void * /* ptr */,
  637. cl_uint /* num_events_in_wait_list */,
  638. const cl_event * /* event_wait_list */,
  639. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  640. extern CL_API_ENTRY cl_int CL_API_CALL
  641. clEnqueueWriteImage(cl_command_queue /* command_queue */,
  642. cl_mem /* image */,
  643. cl_bool /* blocking_write */,
  644. const size_t * /* origin[3] */,
  645. const size_t * /* region[3] */,
  646. size_t /* input_row_pitch */,
  647. size_t /* input_slice_pitch */,
  648. const void * /* ptr */,
  649. cl_uint /* num_events_in_wait_list */,
  650. const cl_event * /* event_wait_list */,
  651. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  652. extern CL_API_ENTRY cl_int CL_API_CALL
  653. clEnqueueCopyImage(cl_command_queue /* command_queue */,
  654. cl_mem /* src_image */,
  655. cl_mem /* dst_image */,
  656. const size_t * /* src_origin[3] */,
  657. const size_t * /* dst_origin[3] */,
  658. const size_t * /* region[3] */,
  659. cl_uint /* num_events_in_wait_list */,
  660. const cl_event * /* event_wait_list */,
  661. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  662. extern CL_API_ENTRY cl_int CL_API_CALL
  663. clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
  664. cl_mem /* src_image */,
  665. cl_mem /* dst_buffer */,
  666. const size_t * /* src_origin[3] */,
  667. const size_t * /* region[3] */,
  668. size_t /* dst_offset */,
  669. cl_uint /* num_events_in_wait_list */,
  670. const cl_event * /* event_wait_list */,
  671. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  672. extern CL_API_ENTRY cl_int CL_API_CALL
  673. clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
  674. cl_mem /* src_buffer */,
  675. cl_mem /* dst_image */,
  676. size_t /* src_offset */,
  677. const size_t * /* dst_origin[3] */,
  678. const size_t * /* region[3] */,
  679. cl_uint /* num_events_in_wait_list */,
  680. const cl_event * /* event_wait_list */,
  681. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  682. extern CL_API_ENTRY void * CL_API_CALL
  683. clEnqueueMapBuffer(cl_command_queue /* command_queue */,
  684. cl_mem /* buffer */,
  685. cl_bool /* blocking_map */,
  686. cl_map_flags /* map_flags */,
  687. size_t /* offset */,
  688. size_t /* cb */,
  689. cl_uint /* num_events_in_wait_list */,
  690. const cl_event * /* event_wait_list */,
  691. cl_event * /* event */,
  692. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  693. extern CL_API_ENTRY void * CL_API_CALL
  694. clEnqueueMapImage(cl_command_queue /* command_queue */,
  695. cl_mem /* image */,
  696. cl_bool /* blocking_map */,
  697. cl_map_flags /* map_flags */,
  698. const size_t * /* origin[3] */,
  699. const size_t * /* region[3] */,
  700. size_t * /* image_row_pitch */,
  701. size_t * /* image_slice_pitch */,
  702. cl_uint /* num_events_in_wait_list */,
  703. const cl_event * /* event_wait_list */,
  704. cl_event * /* event */,
  705. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  706. extern CL_API_ENTRY cl_int CL_API_CALL
  707. clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
  708. cl_mem /* memobj */,
  709. void * /* mapped_ptr */,
  710. cl_uint /* num_events_in_wait_list */,
  711. const cl_event * /* event_wait_list */,
  712. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  713. extern CL_API_ENTRY cl_int CL_API_CALL
  714. clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
  715. cl_kernel /* kernel */,
  716. cl_uint /* work_dim */,
  717. const size_t * /* global_work_offset */,
  718. const size_t * /* global_work_size */,
  719. const size_t * /* local_work_size */,
  720. cl_uint /* num_events_in_wait_list */,
  721. const cl_event * /* event_wait_list */,
  722. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  723. extern CL_API_ENTRY cl_int CL_API_CALL
  724. clEnqueueTask(cl_command_queue /* command_queue */,
  725. cl_kernel /* kernel */,
  726. cl_uint /* num_events_in_wait_list */,
  727. const cl_event * /* event_wait_list */,
  728. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  729. extern CL_API_ENTRY cl_int CL_API_CALL
  730. clEnqueueNativeKernel(cl_command_queue /* command_queue */,
  731. void (*user_func)(void *),
  732. void * /* args */,
  733. size_t /* cb_args */,
  734. cl_uint /* num_mem_objects */,
  735. const cl_mem * /* mem_list */,
  736. const void ** /* args_mem_loc */,
  737. cl_uint /* num_events_in_wait_list */,
  738. const cl_event * /* event_wait_list */,
  739. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  740. extern CL_API_ENTRY cl_int CL_API_CALL
  741. clEnqueueMarker(cl_command_queue /* command_queue */,
  742. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  743. extern CL_API_ENTRY cl_int CL_API_CALL
  744. clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
  745. cl_uint /* num_events */,
  746. const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
  747. extern CL_API_ENTRY cl_int CL_API_CALL
  748. clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
  749. /* Extension function access
  750. *
  751. * Returns the extension function address for the given function name,
  752. * or NULL if a valid function can not be found. The client must
  753. * check to make sure the address is not NULL, before using or
  754. * calling the returned function address.
  755. */
  756. extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
  757. #ifdef __cplusplus
  758. }
  759. #endif
  760. #endif /* __OPENCL_CL_H */