OpenCL.std.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. /*
  2. ** Copyright (c) 2015-2019 The Khronos Group Inc.
  3. **
  4. ** Permission is hereby granted, free of charge, to any person obtaining a copy
  5. ** of this software and/or associated documentation files (the "Materials"),
  6. ** to deal in the Materials without restriction, including without limitation
  7. ** the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. ** and/or sell copies of the Materials, and to permit persons to whom the
  9. ** Materials are furnished to do so, subject to the following conditions:
  10. **
  11. ** The above copyright notice and this permission notice shall be included in
  12. ** all copies or substantial portions of the Materials.
  13. **
  14. ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
  15. ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
  16. ** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
  17. **
  18. ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19. ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  21. ** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  23. ** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
  24. ** IN THE MATERIALS.
  25. */
  26. #ifndef OPENCLstd_H
  27. #define OPENCLstd_H
  28. #ifdef __cplusplus
  29. namespace OpenCLLIB {
  30. enum Entrypoints {
  31. // Section 2.1: Math extended instructions
  32. Acos = 0,
  33. Acosh = 1,
  34. Acospi = 2,
  35. Asin = 3,
  36. Asinh = 4,
  37. Asinpi = 5,
  38. Atan = 6,
  39. Atan2 = 7,
  40. Atanh = 8,
  41. Atanpi = 9,
  42. Atan2pi = 10,
  43. Cbrt = 11,
  44. Ceil = 12,
  45. Copysign = 13,
  46. Cos = 14,
  47. Cosh = 15,
  48. Cospi = 16,
  49. Erfc = 17,
  50. Erf = 18,
  51. Exp = 19,
  52. Exp2 = 20,
  53. Exp10 = 21,
  54. Expm1 = 22,
  55. Fabs = 23,
  56. Fdim = 24,
  57. Floor = 25,
  58. Fma = 26,
  59. Fmax = 27,
  60. Fmin = 28,
  61. Fmod = 29,
  62. Fract = 30,
  63. Frexp = 31,
  64. Hypot = 32,
  65. Ilogb = 33,
  66. Ldexp = 34,
  67. Lgamma = 35,
  68. Lgamma_r = 36,
  69. Log = 37,
  70. Log2 = 38,
  71. Log10 = 39,
  72. Log1p = 40,
  73. Logb = 41,
  74. Mad = 42,
  75. Maxmag = 43,
  76. Minmag = 44,
  77. Modf = 45,
  78. Nan = 46,
  79. Nextafter = 47,
  80. Pow = 48,
  81. Pown = 49,
  82. Powr = 50,
  83. Remainder = 51,
  84. Remquo = 52,
  85. Rint = 53,
  86. Rootn = 54,
  87. Round = 55,
  88. Rsqrt = 56,
  89. Sin = 57,
  90. Sincos = 58,
  91. Sinh = 59,
  92. Sinpi = 60,
  93. Sqrt = 61,
  94. Tan = 62,
  95. Tanh = 63,
  96. Tanpi = 64,
  97. Tgamma = 65,
  98. Trunc = 66,
  99. Half_cos = 67,
  100. Half_divide = 68,
  101. Half_exp = 69,
  102. Half_exp2 = 70,
  103. Half_exp10 = 71,
  104. Half_log = 72,
  105. Half_log2 = 73,
  106. Half_log10 = 74,
  107. Half_powr = 75,
  108. Half_recip = 76,
  109. Half_rsqrt = 77,
  110. Half_sin = 78,
  111. Half_sqrt = 79,
  112. Half_tan = 80,
  113. Native_cos = 81,
  114. Native_divide = 82,
  115. Native_exp = 83,
  116. Native_exp2 = 84,
  117. Native_exp10 = 85,
  118. Native_log = 86,
  119. Native_log2 = 87,
  120. Native_log10 = 88,
  121. Native_powr = 89,
  122. Native_recip = 90,
  123. Native_rsqrt = 91,
  124. Native_sin = 92,
  125. Native_sqrt = 93,
  126. Native_tan = 94,
  127. // Section 2.2: Integer instructions
  128. SAbs = 141,
  129. SAbs_diff = 142,
  130. SAdd_sat = 143,
  131. UAdd_sat = 144,
  132. SHadd = 145,
  133. UHadd = 146,
  134. SRhadd = 147,
  135. URhadd = 148,
  136. SClamp = 149,
  137. UClamp = 150,
  138. Clz = 151,
  139. Ctz = 152,
  140. SMad_hi = 153,
  141. UMad_sat = 154,
  142. SMad_sat = 155,
  143. SMax = 156,
  144. UMax = 157,
  145. SMin = 158,
  146. UMin = 159,
  147. SMul_hi = 160,
  148. Rotate = 161,
  149. SSub_sat = 162,
  150. USub_sat = 163,
  151. U_Upsample = 164,
  152. S_Upsample = 165,
  153. Popcount = 166,
  154. SMad24 = 167,
  155. UMad24 = 168,
  156. SMul24 = 169,
  157. UMul24 = 170,
  158. UAbs = 201,
  159. UAbs_diff = 202,
  160. UMul_hi = 203,
  161. UMad_hi = 204,
  162. // Section 2.3: Common instructions
  163. FClamp = 95,
  164. Degrees = 96,
  165. FMax_common = 97,
  166. FMin_common = 98,
  167. Mix = 99,
  168. Radians = 100,
  169. Step = 101,
  170. Smoothstep = 102,
  171. Sign = 103,
  172. // Section 2.4: Geometric instructions
  173. Cross = 104,
  174. Distance = 105,
  175. Length = 106,
  176. Normalize = 107,
  177. Fast_distance = 108,
  178. Fast_length = 109,
  179. Fast_normalize = 110,
  180. // Section 2.5: Relational instructions
  181. Bitselect = 186,
  182. Select = 187,
  183. // Section 2.6: Vector Data Load and Store instructions
  184. Vloadn = 171,
  185. Vstoren = 172,
  186. Vload_half = 173,
  187. Vload_halfn = 174,
  188. Vstore_half = 175,
  189. Vstore_half_r = 176,
  190. Vstore_halfn = 177,
  191. Vstore_halfn_r = 178,
  192. Vloada_halfn = 179,
  193. Vstorea_halfn = 180,
  194. Vstorea_halfn_r = 181,
  195. // Section 2.7: Miscellaneous Vector instructions
  196. Shuffle = 182,
  197. Shuffle2 = 183,
  198. // Section 2.8: Misc instructions
  199. Printf = 184,
  200. Prefetch = 185,
  201. };
  202. } // end namespace OpenCLLIB
  203. #else
  204. enum OpenCLstd_Entrypoints {
  205. // Section 2.1: Math extended instructions
  206. OpenCLstd_Acos = 0,
  207. OpenCLstd_Acosh = 1,
  208. OpenCLstd_Acospi = 2,
  209. OpenCLstd_Asin = 3,
  210. OpenCLstd_Asinh = 4,
  211. OpenCLstd_Asinpi = 5,
  212. OpenCLstd_Atan = 6,
  213. OpenCLstd_Atan2 = 7,
  214. OpenCLstd_Atanh = 8,
  215. OpenCLstd_Atanpi = 9,
  216. OpenCLstd_Atan2pi = 10,
  217. OpenCLstd_Cbrt = 11,
  218. OpenCLstd_Ceil = 12,
  219. OpenCLstd_Copysign = 13,
  220. OpenCLstd_Cos = 14,
  221. OpenCLstd_Cosh = 15,
  222. OpenCLstd_Cospi = 16,
  223. OpenCLstd_Erfc = 17,
  224. OpenCLstd_Erf = 18,
  225. OpenCLstd_Exp = 19,
  226. OpenCLstd_Exp2 = 20,
  227. OpenCLstd_Exp10 = 21,
  228. OpenCLstd_Expm1 = 22,
  229. OpenCLstd_Fabs = 23,
  230. OpenCLstd_Fdim = 24,
  231. OpenCLstd_Floor = 25,
  232. OpenCLstd_Fma = 26,
  233. OpenCLstd_Fmax = 27,
  234. OpenCLstd_Fmin = 28,
  235. OpenCLstd_Fmod = 29,
  236. OpenCLstd_Fract = 30,
  237. OpenCLstd_Frexp = 31,
  238. OpenCLstd_Hypot = 32,
  239. OpenCLstd_Ilogb = 33,
  240. OpenCLstd_Ldexp = 34,
  241. OpenCLstd_Lgamma = 35,
  242. OpenCLstd_Lgamma_r = 36,
  243. OpenCLstd_Log = 37,
  244. OpenCLstd_Log2 = 38,
  245. OpenCLstd_Log10 = 39,
  246. OpenCLstd_Log1p = 40,
  247. OpenCLstd_Logb = 41,
  248. OpenCLstd_Mad = 42,
  249. OpenCLstd_Maxmag = 43,
  250. OpenCLstd_Minmag = 44,
  251. OpenCLstd_Modf = 45,
  252. OpenCLstd_Nan = 46,
  253. OpenCLstd_Nextafter = 47,
  254. OpenCLstd_Pow = 48,
  255. OpenCLstd_Pown = 49,
  256. OpenCLstd_Powr = 50,
  257. OpenCLstd_Remainder = 51,
  258. OpenCLstd_Remquo = 52,
  259. OpenCLstd_Rint = 53,
  260. OpenCLstd_Rootn = 54,
  261. OpenCLstd_Round = 55,
  262. OpenCLstd_Rsqrt = 56,
  263. OpenCLstd_Sin = 57,
  264. OpenCLstd_Sincos = 58,
  265. OpenCLstd_Sinh = 59,
  266. OpenCLstd_Sinpi = 60,
  267. OpenCLstd_Sqrt = 61,
  268. OpenCLstd_Tan = 62,
  269. OpenCLstd_Tanh = 63,
  270. OpenCLstd_Tanpi = 64,
  271. OpenCLstd_Tgamma = 65,
  272. OpenCLstd_Trunc = 66,
  273. OpenCLstd_Half_cos = 67,
  274. OpenCLstd_Half_divide = 68,
  275. OpenCLstd_Half_exp = 69,
  276. OpenCLstd_Half_exp2 = 70,
  277. OpenCLstd_Half_exp10 = 71,
  278. OpenCLstd_Half_log = 72,
  279. OpenCLstd_Half_log2 = 73,
  280. OpenCLstd_Half_log10 = 74,
  281. OpenCLstd_Half_powr = 75,
  282. OpenCLstd_Half_recip = 76,
  283. OpenCLstd_Half_rsqrt = 77,
  284. OpenCLstd_Half_sin = 78,
  285. OpenCLstd_Half_sqrt = 79,
  286. OpenCLstd_Half_tan = 80,
  287. OpenCLstd_Native_cos = 81,
  288. OpenCLstd_Native_divide = 82,
  289. OpenCLstd_Native_exp = 83,
  290. OpenCLstd_Native_exp2 = 84,
  291. OpenCLstd_Native_exp10 = 85,
  292. OpenCLstd_Native_log = 86,
  293. OpenCLstd_Native_log2 = 87,
  294. OpenCLstd_Native_log10 = 88,
  295. OpenCLstd_Native_powr = 89,
  296. OpenCLstd_Native_recip = 90,
  297. OpenCLstd_Native_rsqrt = 91,
  298. OpenCLstd_Native_sin = 92,
  299. OpenCLstd_Native_sqrt = 93,
  300. OpenCLstd_Native_tan = 94,
  301. // Section 2.2: Integer instructions
  302. OpenCLstd_SAbs = 141,
  303. OpenCLstd_SAbs_diff = 142,
  304. OpenCLstd_SAdd_sat = 143,
  305. OpenCLstd_UAdd_sat = 144,
  306. OpenCLstd_SHadd = 145,
  307. OpenCLstd_UHadd = 146,
  308. OpenCLstd_SRhadd = 147,
  309. OpenCLstd_URhadd = 148,
  310. OpenCLstd_SClamp = 149,
  311. OpenCLstd_UClamp = 150,
  312. OpenCLstd_Clz = 151,
  313. OpenCLstd_Ctz = 152,
  314. OpenCLstd_SMad_hi = 153,
  315. OpenCLstd_UMad_sat = 154,
  316. OpenCLstd_SMad_sat = 155,
  317. OpenCLstd_SMax = 156,
  318. OpenCLstd_UMax = 157,
  319. OpenCLstd_SMin = 158,
  320. OpenCLstd_UMin = 159,
  321. OpenCLstd_SMul_hi = 160,
  322. OpenCLstd_Rotate = 161,
  323. OpenCLstd_SSub_sat = 162,
  324. OpenCLstd_USub_sat = 163,
  325. OpenCLstd_U_Upsample = 164,
  326. OpenCLstd_S_Upsample = 165,
  327. OpenCLstd_Popcount = 166,
  328. OpenCLstd_SMad24 = 167,
  329. OpenCLstd_UMad24 = 168,
  330. OpenCLstd_SMul24 = 169,
  331. OpenCLstd_UMul24 = 170,
  332. OpenCLstd_UAbs = 201,
  333. OpenCLstd_UAbs_diff = 202,
  334. OpenCLstd_UMul_hi = 203,
  335. OpenCLstd_UMad_hi = 204,
  336. // Section 2.3: Common instructions
  337. OpenCLstd_FClamp = 95,
  338. OpenCLstd_Degrees = 96,
  339. OpenCLstd_FMax_common = 97,
  340. OpenCLstd_FMin_common = 98,
  341. OpenCLstd_Mix = 99,
  342. OpenCLstd_Radians = 100,
  343. OpenCLstd_Step = 101,
  344. OpenCLstd_Smoothstep = 102,
  345. OpenCLstd_Sign = 103,
  346. // Section 2.4: Geometric instructions
  347. OpenCLstd_Cross = 104,
  348. OpenCLstd_Distance = 105,
  349. OpenCLstd_Length = 106,
  350. OpenCLstd_Normalize = 107,
  351. OpenCLstd_Fast_distance = 108,
  352. OpenCLstd_Fast_length = 109,
  353. OpenCLstd_Fast_normalize = 110,
  354. // Section 2.5: Relational instructions
  355. OpenCLstd_Bitselect = 186,
  356. OpenCLstd_Select = 187,
  357. // Section 2.6: Vector Data Load and Store instructions
  358. OpenCLstd_Vloadn = 171,
  359. OpenCLstd_Vstoren = 172,
  360. OpenCLstd_Vload_half = 173,
  361. OpenCLstd_Vload_halfn = 174,
  362. OpenCLstd_Vstore_half = 175,
  363. OpenCLstd_Vstore_half_r = 176,
  364. OpenCLstd_Vstore_halfn = 177,
  365. OpenCLstd_Vstore_halfn_r = 178,
  366. OpenCLstd_Vloada_halfn = 179,
  367. OpenCLstd_Vstorea_halfn = 180,
  368. OpenCLstd_Vstorea_halfn_r = 181,
  369. // Section 2.7: Miscellaneous Vector instructions
  370. OpenCLstd_Shuffle = 182,
  371. OpenCLstd_Shuffle2 = 183,
  372. // Section 2.8: Misc instructions
  373. OpenCLstd_Printf = 184,
  374. OpenCLstd_Prefetch = 185,
  375. };
  376. #endif
  377. #endif // #ifndef OPENCLstd_H