cl.h 42 KB

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