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