1 // REQUIRES
: nvptx-registered-target
2 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple nvptx-unknown-unknown
3 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple nvptx-unknown-unknown
4 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple nvptx-unknown-unknown
5 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
6 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
7 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
8 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple nvptx64-unknown-unknown
9 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple nvptx64-unknown-unknown
10 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple nvptx64-unknown-unknown
11 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
12 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
13 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
15 // Extensions in all versions
16 #ifndef cl_clang_storage_class_specifiers
17 #error
"Missing cl_clang_storage_class_specifiers define"
19 #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers
: enable
21 #ifndef __cl_clang_function_pointers
22 #error
"Missing __cl_clang_function_pointers define"
24 #pragma OPENCL EXTENSION __cl_clang_function_pointers
: enable
26 #ifndef __cl_clang_variadic_functions
27 #error
"Missing __cl_clang_variadic_functions define"
29 #pragma OPENCL EXTENSION __cl_clang_variadic_functions
: enable
31 #ifndef __cl_clang_non_portable_kernel_param_types
32 #error
"Missing __cl_clang_non_portable_kernel_param_types define"
34 #pragma OPENCL EXTENSION __cl_clang_non_portable_kernel_param_types
: enable
36 #ifndef __cl_clang_bitfields
37 #error
"Missing __cl_clang_bitfields define"
39 #pragma OPENCL EXTENSION __cl_clang_bitfields
: enable
42 #error
"Incorrect cl_khr_fp16 define"
44 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
45 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_fp16
' - ignoring
}}
47 #ifdef cl_khr_int64_base_atomics
48 #error
"Incorrect cl_khr_int64_base_atomics define"
50 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics
: enable
51 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_int64_base_atomics
' - ignoring
}}
53 #ifdef cl_khr_int64_extended_atomics
54 #error
"Incorrect cl_khr_int64_extended_atomics define"
56 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics
: enable
57 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_int64_extended_atomics
' - ignoring
}}
59 // Core features in CL
1.1
61 #ifndef cl_khr_byte_addressable_store
62 #error
"Missing cl_khr_byte_addressable_store define"
64 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store
: enable
65 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
66 // expected-warning
@-
2{{OpenCL extension
'cl_khr_byte_addressable_store
' is core feature or supported optional core feature - ignoring
}}
69 #ifndef cl_khr_global_int32_base_atomics
70 #error
"Missing cl_khr_global_int32_base_atomics define"
72 #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics
: enable
73 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
74 // expected-warning
@-
2{{OpenCL extension
'cl_khr_global_int32_base_atomics
' is core feature or supported optional core feature - ignoring
}}
77 #ifndef cl_khr_global_int32_extended_atomics
78 #error
"Missing cl_khr_global_int32_extended_atomics define"
80 #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics
: enable
81 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
82 // expected-warning
@-
2{{OpenCL extension
'cl_khr_global_int32_extended_atomics
' is core feature or supported optional core feature - ignoring
}}
85 #ifndef cl_khr_local_int32_base_atomics
86 #error
"Missing cl_khr_local_int32_base_atomics define"
88 #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics
: enable
89 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
90 // expected-warning
@-
2{{OpenCL extension
'cl_khr_local_int32_base_atomics
' is core feature or supported optional core feature - ignoring
}}
93 #ifndef cl_khr_local_int32_extended_atomics
94 #error
"Missing cl_khr_local_int32_extended_atomics define"
96 #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics
: enable
97 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
98 // expected-warning
@-
2{{OpenCL extension
'cl_khr_local_int32_extended_atomics
' is core feature or supported optional core feature - ignoring
}}
101 // Core feature in CL
1.2
103 #error
"Missing cl_khr_fp64 define"
105 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
106 #if
(__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES
107 // expected-warning
@-
2{{OpenCL extension
'cl_khr_fp64
' is core feature or supported optional core feature - ignoring
}}
110 // Core feature in CL
2.0, but not supported on nvptx
111 #ifdef cl_khr_3d_image_writes
112 #error
"Incorrect cl_khr_3d_image_writes define"
114 #pragma OPENCL EXTENSION cl_khr_3d_image_writes
: enable
115 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_3d_image_writes
' - ignoring
}}
117 #ifdef cl_khr_gl_msaa_sharing
118 #error
"Incorrect cl_khr_gl_msaa_sharing define"
120 #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing
: enable
121 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_gl_msaa_sharing
' - ignoring
}}
123 #ifdef cl_khr_srgb_image_writes
124 #error
"Incorrect cl_khr_srgb_image_writes define"
126 #pragma OPENCL EXTENSION cl_khr_srgb_image_writes
: enable
127 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_srgb_image_writes
' - ignoring
}}
129 #ifdef cl_khr_subgroups
130 #error
"Incorrect cl_khr_subgroups define"
132 #pragma OPENCL EXTENSION cl_khr_subgroups
: enable
133 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_subgroups
' - ignoring
}}