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, avail, core, opt) where 20// ext - name of the extension or optional core feature. 21// avail - minimum OpenCL version supporting it. 22// core - OpenCL versions mask when the extension becomes core feature. 23// 0U indicates not a core feature. 24// opt - OpenCL versions mask when the extension becomes optional core 25// feature. 0U indicates not a optional core feature. 26// 27// If extensions are to be enumerated without any information, 28// define OPENCLEXTNAME(ext) where ext is the name of the extension. 29// 30// Difference between optional core feature and core feature is that the 31// later is unconditionally supported in specific OpenCL version. 32// 33// As per The OpenCL Extension Specification, Section 1.2, in this file, an 34// extension is defined if and only it either: 35// * affects the OpenCL language semantics or its syntax, 36// * adds built-in functions to the language. 37// 38// For such an extension, a preprocessor #define that matches the extension 39// name must be created and a #pragma is required if and only if the 40// compilation flow is impacted, e.g. due to a difference of syntax or 41// semantics in the language compared to the core standard. #pragma directive 42// has no effect for optional core and core features. 43 44#ifndef OPENCL_GENERIC_EXTENSION 45#ifndef OPENCLEXTNAME 46#pragma error "macro OPENCLEXTNAME or OPENCL_GENERIC_EXTENSION is required" 47#else 48#define OPENCL_GENERIC_EXTENSION(ext, ...) OPENCLEXTNAME(ext) 49#endif // OPENCLEXTNAME 50#endif // OPENCL_GENERIC_EXTENSION 51 52// Declaration helpers 53#define OPENCL_EXTENSION(ext, avail) OPENCL_GENERIC_EXTENSION(ext, avail, 0U, 0U) 54#define OPENCL_COREFEATURE(ext, avail, core) OPENCL_GENERIC_EXTENSION(ext, avail, core, 0U) 55#define OPENCL_OPTIONALCOREFEATURE(ext, avail, opt) OPENCL_GENERIC_EXTENSION(ext, avail, 0U, opt) 56 57// OpenCL 1.0. 58OPENCL_COREFEATURE(cl_khr_byte_addressable_store, 100, OCL_C_11P) 59OPENCL_COREFEATURE(cl_khr_global_int32_base_atomics, 100, OCL_C_11P) 60OPENCL_COREFEATURE(cl_khr_global_int32_extended_atomics, 100, OCL_C_11P) 61OPENCL_COREFEATURE(cl_khr_local_int32_base_atomics, 100, OCL_C_11P) 62OPENCL_COREFEATURE(cl_khr_local_int32_extended_atomics, 100, OCL_C_11P) 63OPENCL_OPTIONALCOREFEATURE(cl_khr_fp64, 100, OCL_C_12P) 64OPENCL_EXTENSION(cl_khr_fp16, 100) 65OPENCL_EXTENSION(cl_khr_int64_base_atomics, 100) 66OPENCL_EXTENSION(cl_khr_int64_extended_atomics, 100) 67OPENCL_GENERIC_EXTENSION(cl_khr_3d_image_writes, 100, OCL_C_20, OCL_C_30) 68 69// EMBEDDED_PROFILE 70OPENCL_EXTENSION(cles_khr_int64, 110) 71 72// OpenCL 1.2. 73OPENCL_EXTENSION(cl_khr_depth_images, 120) 74OPENCL_EXTENSION(cl_khr_gl_msaa_sharing, 120) 75 76// OpenCL 2.0. 77OPENCL_EXTENSION(cl_khr_mipmap_image, 200) 78OPENCL_EXTENSION(cl_khr_mipmap_image_writes, 200) 79OPENCL_EXTENSION(cl_khr_srgb_image_writes, 200) 80OPENCL_EXTENSION(cl_khr_subgroups, 200) 81 82// Clang Extensions. 83OPENCL_EXTENSION(cl_clang_storage_class_specifiers, 100) 84OPENCL_EXTENSION(__cl_clang_function_pointers, 100) 85OPENCL_EXTENSION(__cl_clang_variadic_functions, 100) 86 87// AMD OpenCL extensions 88OPENCL_EXTENSION(cl_amd_media_ops, 100) 89OPENCL_EXTENSION(cl_amd_media_ops2, 100) 90 91// ARM OpenCL extensions 92OPENCL_EXTENSION(cl_arm_integer_dot_product_int8, 120) 93OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int8, 120) 94OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_int16, 120) 95OPENCL_EXTENSION(cl_arm_integer_dot_product_accumulate_saturate_int8, 120) 96 97// Intel OpenCL extensions 98OPENCL_EXTENSION(cl_intel_subgroups, 120) 99OPENCL_EXTENSION(cl_intel_subgroups_short, 120) 100OPENCL_EXTENSION(cl_intel_device_side_avc_motion_estimation, 120) 101 102 103#undef OPENCL_OPTIONALCOREFEATURE 104#undef OPENCL_COREFEATURE 105#undef OPENCL_GENERIC_EXTENSION 106 107#ifdef OPENCLEXTNAME 108#undef OPENCLEXTNAME 109#endif 110