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