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