File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 30
30
#endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
31
31
32
32
// Define feature macros for OpenCL C 2.0
33
- #if (defined( __OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200)
33
+ #if (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
34
34
#define __opencl_c_pipes 1
35
35
#define __opencl_c_generic_address_space 1
36
36
#define __opencl_c_work_group_collective_functions 1
45
45
#endif
46
46
47
47
// Define header-only feature macros for OpenCL C 3.0.
48
- #if (__OPENCL_C_VERSION__ == 300)
48
+ #if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
49
49
// For the SPIR target all features are supported.
50
50
#if defined(__SPIR__)
51
51
#define __opencl_c_atomic_scope_all_devices 1
52
52
#endif // defined(__SPIR__)
53
- #endif // (__OPENCL_C_VERSION__ == 300)
53
+ #endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
54
54
55
55
// built-in scalar data types:
56
56
Original file line number Diff line number Diff line change @@ -175,13 +175,13 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
175
175
#endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
176
176
177
177
// OpenCL C features.
178
- #if (__OPENCL_C_VERSION__ == 300 )
178
+ #if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300 )
179
179
180
180
#if __opencl_c_atomic_scope_all_devices != 1
181
181
#error "Incorrectly defined feature macro __opencl_c_atomic_scope_all_devices"
182
182
#endif
183
183
184
- #elif (defined( __OPENCL_CPP_VERSION__ ) || __OPENCL_C_VERSION__ == 200 )
184
+ #elif (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200 )
185
185
186
186
#ifndef __opencl_c_pipes
187
187
#error "Feature macro __opencl_c_pipes should be defined"
@@ -262,6 +262,6 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
262
262
#error "Incorrect feature macro __opencl_c_subgroups define"
263
263
#endif
264
264
265
- #endif //(defined( __OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200 )
265
+ #endif // ( __OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300 )
266
266
267
267
#endif // defined(__SPIR__)
Original file line number Diff line number Diff line change 6
6
// RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
7
7
// RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl -cl-std=CL3.0 -cl-ext=+all \
8
8
// RUN: | FileCheck -match-full-lines %s --check-prefix=FEATURES
9
+ // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl -cl-std=clc++2021 -cl-ext=-all \
10
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
11
+ // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl -cl-std=clc++2021 -cl-ext=+all \
12
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=FEATURES
13
+ // RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl -cl-std=clc++2021 \
14
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
15
+ // RUN: %clang_cc1 -triple r600-unknown-unknown %s -E -dM -o - -x cl -cl-std=clc++2021 -cl-ext=+all \
16
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=FEATURES
9
17
10
18
// For OpenCL C 2.0 feature macros are defined only in header, so test that earlier OpenCL
11
19
// versions don't define feature macros accidentally and CL2.0 don't define them without header
15
23
// RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
16
24
// RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl -cl-std=CL2.0 \
17
25
// RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
18
- // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl -cl-std=CLC++ \
26
+ // RUN: %clang_cc1 -triple spir-unknown-unknown %s -E -dM -o - -x cl -cl-std=clc++1.0 \
19
27
// RUN: | FileCheck -match-full-lines %s --check-prefix=NO-FEATURES
20
28
21
29
// Note that __opencl_c_int64 is always defined assuming
You can’t perform that action at this time.
0 commit comments