1*8975f5c5SAndroid Build Coastguard Worker /******************************************************************************* 2*8975f5c5SAndroid Build Coastguard Worker * Copyright (c) 2018-2020 The Khronos Group Inc. 3*8975f5c5SAndroid Build Coastguard Worker * 4*8975f5c5SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*8975f5c5SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*8975f5c5SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*8975f5c5SAndroid Build Coastguard Worker * 8*8975f5c5SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*8975f5c5SAndroid Build Coastguard Worker * 10*8975f5c5SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*8975f5c5SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*8975f5c5SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*8975f5c5SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*8975f5c5SAndroid Build Coastguard Worker * limitations under the License. 15*8975f5c5SAndroid Build Coastguard Worker ******************************************************************************/ 16*8975f5c5SAndroid Build Coastguard Worker 17*8975f5c5SAndroid Build Coastguard Worker #ifndef __CL_VERSION_H 18*8975f5c5SAndroid Build Coastguard Worker #define __CL_VERSION_H 19*8975f5c5SAndroid Build Coastguard Worker 20*8975f5c5SAndroid Build Coastguard Worker /* Detect which version to target */ 21*8975f5c5SAndroid Build Coastguard Worker #if !defined(CL_TARGET_OPENCL_VERSION) 22*8975f5c5SAndroid Build Coastguard Worker #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)") 23*8975f5c5SAndroid Build Coastguard Worker #define CL_TARGET_OPENCL_VERSION 300 24*8975f5c5SAndroid Build Coastguard Worker #endif 25*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION != 100 && \ 26*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 110 && \ 27*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 120 && \ 28*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 200 && \ 29*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 210 && \ 30*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 220 && \ 31*8975f5c5SAndroid Build Coastguard Worker CL_TARGET_OPENCL_VERSION != 300 32*8975f5c5SAndroid Build Coastguard Worker #pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)") 33*8975f5c5SAndroid Build Coastguard Worker #undef CL_TARGET_OPENCL_VERSION 34*8975f5c5SAndroid Build Coastguard Worker #define CL_TARGET_OPENCL_VERSION 300 35*8975f5c5SAndroid Build Coastguard Worker #endif 36*8975f5c5SAndroid Build Coastguard Worker 37*8975f5c5SAndroid Build Coastguard Worker 38*8975f5c5SAndroid Build Coastguard Worker /* OpenCL Version */ 39*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0) 40*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_3_0 1 41*8975f5c5SAndroid Build Coastguard Worker #endif 42*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) 43*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_2_2 1 44*8975f5c5SAndroid Build Coastguard Worker #endif 45*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) 46*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_2_1 1 47*8975f5c5SAndroid Build Coastguard Worker #endif 48*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) 49*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_2_0 1 50*8975f5c5SAndroid Build Coastguard Worker #endif 51*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) 52*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_1_2 1 53*8975f5c5SAndroid Build Coastguard Worker #endif 54*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) 55*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_1_1 1 56*8975f5c5SAndroid Build Coastguard Worker #endif 57*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) 58*8975f5c5SAndroid Build Coastguard Worker #define CL_VERSION_1_0 1 59*8975f5c5SAndroid Build Coastguard Worker #endif 60*8975f5c5SAndroid Build Coastguard Worker 61*8975f5c5SAndroid Build Coastguard Worker /* Allow deprecated APIs for older OpenCL versions. */ 62*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) 63*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_2_2_APIS 64*8975f5c5SAndroid Build Coastguard Worker #endif 65*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) 66*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_2_1_APIS 67*8975f5c5SAndroid Build Coastguard Worker #endif 68*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) 69*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_2_0_APIS 70*8975f5c5SAndroid Build Coastguard Worker #endif 71*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) 72*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 73*8975f5c5SAndroid Build Coastguard Worker #endif 74*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) 75*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_1_1_APIS 76*8975f5c5SAndroid Build Coastguard Worker #endif 77*8975f5c5SAndroid Build Coastguard Worker #if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) 78*8975f5c5SAndroid Build Coastguard Worker #define CL_USE_DEPRECATED_OPENCL_1_0_APIS 79*8975f5c5SAndroid Build Coastguard Worker #endif 80*8975f5c5SAndroid Build Coastguard Worker 81*8975f5c5SAndroid Build Coastguard Worker #endif /* __CL_VERSION_H */ 82