1
- // RUN: %clang_cc1 -internal-isystem %S/Inputs -triple nvptx-unknown-unknown -target-cpu sm_70 -fsycl-is-device -S -emit-llvm %s -o -ferror-limit=100 -fsyntax-only -verify %s
1
+ // RUN: %clang_cc1 -internal-isystem %S/Inputs -triple nvptx-unknown-unknown -target-cpu sm_70 -fsycl-is-device -Wno-c++23-extensions - S -emit-llvm %s -o -ferror-limit=100 -fsyntax-only -verify %s
2
2
3
3
// Maximum work groups per multi-processor, mapped to maxclusterrank PTX
4
4
// directive, is an SM_90 feature, make sure that correct warning is issued on
@@ -19,41 +19,38 @@ int main() {
19
19
sycl::queue Q{};
20
20
21
21
Q.submit ([&](sycl::handler &cgh) {
22
- // expected-warning@+5 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}}
23
- cgh.single_task <class T1 >(
24
- [=]()
25
- [[intel::max_work_group_size (1 , 1 , 256 ),
26
- intel::min_work_groups_per_cu (2 ),
27
- intel::max_work_groups_per_mp (4 )]] { volatile int A = 42 ; });
28
-
29
- constexpr float A = 2.0 ;
30
- // expected-error@+5 {{'min_work_groups_per_cu' attribute requires an integer constant}}
31
- // expected-warning@+5 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}}
32
- cgh.single_task <class T2 >(
33
- [=]()
34
- [[intel::max_work_group_size (1 , 1 , 256 ),
35
- intel::min_work_groups_per_cu (A),
36
- intel::max_work_groups_per_mp (4 )]] { volatile int A = 42 ; });
37
-
38
- // expected-error@+3 {{'min_work_groups_per_cu' attribute requires an integer constant}}
39
- cgh.single_task <class T3 >(
40
- [=]() [[intel::max_work_group_size (1 , 1 , 256 ),
41
- intel::min_work_groups_per_cu (2147483647 + 1 )]]
42
- { volatile int A = 42 ; });
43
-
44
- // expected-warning@+4 {{attribute 'min_work_groups_per_cu' is already applied with different arguments}}
45
- // expected-note@+2 {{previous attribute is here}}
46
- cgh.single_task <class T4 >([=]() [[intel::max_work_group_size (1 , 1 , 256 ),
47
- intel::min_work_groups_per_cu (4 ),
48
- intel::min_work_groups_per_cu (8 )]] {
49
- volatile int A = 42 ;
50
- });
51
-
52
- // expected-error@+1 {{'min_work_groups_per_cu' attribute requires a non-negative integral compile time constant expression}}
53
- cgh.single_task <class T5 >([=]() [[intel::min_work_groups_per_cu (-8 )]] {
54
- volatile int A = 42 ;
55
- });
56
- });
22
+ // expected-warning@+4 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}}
23
+ cgh.single_task <class T1 >(
24
+ [=] [[intel::max_work_group_size (1 , 1 , 256 ),
25
+ intel::min_work_groups_per_cu (2 ),
26
+ intel::max_work_groups_per_mp (4 )]] () { volatile int A = 42 ; });
27
+
28
+ constexpr float A = 2.0 ;
29
+ // expected-error@+4 {{'min_work_groups_per_cu' attribute requires an integer constant}}
30
+ // expected-warning@+4 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}}
31
+ cgh.single_task <class T2 >(
32
+ [=] [[intel::max_work_group_size (1 , 1 , 256 ),
33
+ intel::min_work_groups_per_cu (A),
34
+ intel::max_work_groups_per_mp (4 )]] () { volatile int A = 42 ; });
35
+
36
+ // expected-error@+3 {{'min_work_groups_per_cu' attribute requires an integer constant}}
37
+ cgh.single_task <class T3 >(
38
+ [=] [[intel::max_work_group_size (1 , 1 , 256 ),
39
+ intel::min_work_groups_per_cu (2147483647 + 1 )]] () {
40
+ volatile int A = 42 ;
41
+ });
42
+
43
+ // expected-warning@+5 {{attribute 'min_work_groups_per_cu' is already applied with different arguments}}
44
+ // expected-note@+3 {{previous attribute is here}}
45
+ cgh.single_task <class T4 >(
46
+ [=] [[intel::max_work_group_size (1 , 1 , 256 ),
47
+ intel::min_work_groups_per_cu (4 ),
48
+ intel::min_work_groups_per_cu (8 )]] () { volatile int A = 42 ; });
49
+
50
+ // expected-error@+2 {{'min_work_groups_per_cu' attribute requires a non-negative integral compile time constant expression}}
51
+ cgh.single_task <class T5 >(
52
+ [=] [[intel::min_work_groups_per_cu (-8 )]] () { volatile int A = 42 ; });
53
+ });
57
54
58
55
Q.submit ([&](sycl::handler &cgh) {
59
56
cgh.single_task <class F >(Functor<512 , 8 , 16 >{});
0 commit comments