OpenCLExtensions.def 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //===--- OpenCLExtensions.def - OpenCL extension list -----------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the list of supported OpenCL extensions.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // Macro OPENCLEXTNAME or OPENCL_GENERIC_EXTENSION can be defined to enumerate all
  13. // OpenCL extensions listed in this file.
  14. //
  15. // If extensions are to be enumerated with information about whether
  16. // an extension is core or optional core and minimum OpenCL version
  17. // when an extension becomes available,
  18. // define OPENCL_GENERIC_EXTENSION(ext, pragma, avail, core, opt) where
  19. // ext - name of the extension or optional core feature.
  20. // pragma - true if extension needs pragmas or false otherwise.
  21. // NOTE: extension pragma without any documentation detailing
  22. // its behavior explicitly is deprecated. Therefore the default
  23. // value is false.
  24. // avail - minimum OpenCL version supporting it.
  25. // core - OpenCL versions mask when the extension becomes core feature.
  26. // 0U indicates not a core feature.
  27. // opt - OpenCL versions mask when the extension becomes optional core
  28. // feature. 0U indicates not a optional core feature.
  29. //
  30. // If extensions are to be enumerated without any information,
  31. // define OPENCLEXTNAME(ext) where ext is the name of the extension.
  32. //
  33. // Difference between optional core feature and core feature is that the
  34. // later is unconditionally supported in specific OpenCL version.
  35. //
  36. // As per The OpenCL Extension Specification, Section 1.2, in this file, an
  37. // extension is defined if and only it either:
  38. // * affects the OpenCL language semantics or its syntax,
  39. // * adds built-in functions to the language.
  40. //
  41. // For such an extension, a preprocessor #define that matches the extension
  42. // name must be created and a #pragma is required if and only if the
  43. // compilation flow is impacted, e.g. due to a difference of syntax or
  44. // semantics in the language compared to the core standard. #pragma directive
  45. // has no effect for optional core and core features.
  46. #ifndef OPENCL_GENERIC_EXTENSION
  47. #ifndef OPENCLEXTNAME
  48. #pragma error "macro OPENCLEXTNAME or OPENCL_GENERIC_EXTENSION is required"
  49. #else
  50. #define OPENCL_GENERIC_EXTENSION(ext, ...) OPENCLEXTNAME(ext)
  51. #endif // OPENCLEXTNAME
  52. #endif // OPENCL_GENERIC_EXTENSION
  53. // Declaration helpers
  54. #define OPENCL_EXTENSION(ext, pragma, avail) OPENCL_GENERIC_EXTENSION(ext, pragma, avail, 0U, 0U)
  55. #define OPENCL_COREFEATURE(ext, pragma, avail, core) OPENCL_GENERIC_EXTENSION(ext, pragma, avail, core, 0U)
  56. #define OPENCL_OPTIONALCOREFEATURE(ext, pragma, avail, opt) OPENCL_GENERIC_EXTENSION(ext, pragma, avail, 0U, opt)
  57. // OpenCL 1.0.
  58. OPENCL_COREFEATURE(cl_khr_byte_addressable_store, true, 100, OCL_C_11P)
  59. OPENCL_COREFEATURE(cl_khr_global_int32_base_atomics, true, 100, OCL_C_11P)
  60. OPENCL_COREFEATURE(cl_khr_global_int32_extended_atomics, true, 100, OCL_C_11P)
  61. OPENCL_COREFEATURE(cl_khr_local_int32_base_atomics, true, 100, OCL_C_11P)
  62. OPENCL_COREFEATURE(cl_khr_local_int32_extended_atomics, true, 100, OCL_C_11P)
  63. OPENCL_OPTIONALCOREFEATURE(cl_khr_fp64, true, 100, OCL_C_12P)
  64. OPENCL_EXTENSION(cl_khr_fp16, true, 100)
  65. OPENCL_EXTENSION(cl_khr_int64_base_atomics, true, 100)
  66. OPENCL_EXTENSION(cl_khr_int64_extended_atomics, true, 100)
  67. OPENCL_GENERIC_EXTENSION(cl_khr_3d_image_writes, true, 100, OCL_C_20, OCL_C_30)
  68. // EMBEDDED_PROFILE
  69. OPENCL_EXTENSION(cles_khr_int64, true, 110)
  70. // OpenCL 1.2.
  71. OPENCL_EXTENSION(cl_khr_depth_images, true, 120)
  72. OPENCL_EXTENSION(cl_khr_gl_msaa_sharing,true, 120)
  73. // OpenCL 2.0.
  74. OPENCL_EXTENSION(cl_khr_mipmap_image, true, 200)
  75. OPENCL_EXTENSION(cl_khr_mipmap_image_writes, true, 200)
  76. OPENCL_EXTENSION(cl_khr_srgb_image_writes, true, 200)
  77. OPENCL_EXTENSION(cl_khr_subgroups, true, 200)
  78. // Clang Extensions.
  79. OPENCL_EXTENSION(cl_clang_storage_class_specifiers, true, 100)
  80. OPENCL_EXTENSION(__cl_clang_function_pointers, true, 100)
  81. OPENCL_EXTENSION(__cl_clang_variadic_functions, true, 100)
  82. OPENCL_EXTENSION(__cl_clang_non_portable_kernel_param_types, true, 100)
  83. OPENCL_EXTENSION(__cl_clang_bitfields, true, 100)
  84. // AMD OpenCL extensions
  85. OPENCL_EXTENSION(cl_amd_media_ops, true, 100)
  86. OPENCL_EXTENSION(cl_amd_media_ops2, true, 100)
  87. // ARM OpenCL extensions
  88. OPENCL_EXTENSION(cl_arm_integer_dot_product_int8, true, 120)
  89. OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int8, true, 120)
  90. OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int16, true, 120)
  91. OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_saturate_int8, true, 120)
  92. // Intel OpenCL extensions
  93. OPENCL_EXTENSION(cl_intel_subgroups, true, 120)
  94. OPENCL_EXTENSION(cl_intel_subgroups_short, true, 120)
  95. OPENCL_EXTENSION(cl_intel_device_side_avc_motion_estimation, true, 120)
  96. // OpenCL C 3.0 features (6.2.1. Features)
  97. OPENCL_OPTIONALCOREFEATURE(__opencl_c_pipes, false, 300, OCL_C_30)
  98. OPENCL_OPTIONALCOREFEATURE(__opencl_c_generic_address_space, false, 300, OCL_C_30)
  99. OPENCL_OPTIONALCOREFEATURE(__opencl_c_atomic_order_acq_rel, false, 300, OCL_C_30)
  100. OPENCL_OPTIONALCOREFEATURE(__opencl_c_atomic_order_seq_cst, false, 300, OCL_C_30)
  101. OPENCL_OPTIONALCOREFEATURE(__opencl_c_subgroups, false, 300, OCL_C_30)
  102. OPENCL_OPTIONALCOREFEATURE(__opencl_c_3d_image_writes, false, 300, OCL_C_30)
  103. OPENCL_OPTIONALCOREFEATURE(__opencl_c_device_enqueue, false, 300, OCL_C_30)
  104. OPENCL_OPTIONALCOREFEATURE(__opencl_c_read_write_images, false, 300, OCL_C_30)
  105. OPENCL_OPTIONALCOREFEATURE(__opencl_c_program_scope_global_variables, false, 300, OCL_C_30)
  106. OPENCL_OPTIONALCOREFEATURE(__opencl_c_fp64, false, 300, OCL_C_30)
  107. OPENCL_OPTIONALCOREFEATURE(__opencl_c_images, false, 300, OCL_C_30)
  108. #undef OPENCL_OPTIONALCOREFEATURE
  109. #undef OPENCL_COREFEATURE
  110. #undef OPENCL_GENERIC_EXTENSION
  111. #ifdef OPENCLEXTNAME
  112. #undef OPENCLEXTNAME
  113. #endif