4
4
5
5
using namespace cl ::sycl;
6
6
7
+ class Functor0 {
8
+ public:
9
+ [[intel::max_concurrency(0 )]] void operator ()() const {}
10
+ };
11
+
7
12
class Functor1 {
8
13
public:
9
14
[[intel::max_concurrency(4 )]] void operator ()() const {}
@@ -36,7 +41,7 @@ class Functor4 {
36
41
}
37
42
};
38
43
39
- // expected-error@+1 {{'max_concurrency' attribute requires a positive integral compile time constant expression}}
44
+ // expected-error@+1 {{'max_concurrency' attribute requires a non-negative integral compile time constant expression}}
40
45
[[intel::max_concurrency(-1 )]] void bar () {}
41
46
class Functor5 {
42
47
public:
@@ -45,6 +50,14 @@ class Functor5 {
45
50
}
46
51
};
47
52
53
+ [[intel::max_concurrency(0 )]] void bar0 () {}
54
+ class Functor6 {
55
+ public:
56
+ void operator () () const {
57
+ bar0 ();
58
+ }
59
+ };
60
+
48
61
// expected-error@+1 {{integral constant expression must have integral or unscoped enumeration type, not 'const char [16]'}}
49
62
[[intel::max_concurrency(" numberofthreads" )]] void zoo () {}
50
63
@@ -58,6 +71,9 @@ int main() {
58
71
queue q;
59
72
60
73
q.submit ([&](handler &h) {
74
+ Functor1 f0;
75
+ h.single_task <class kernel_name1 >(f0);
76
+
61
77
Functor1 f1;
62
78
h.single_task <class kernel_name1 >(f1);
63
79
@@ -81,6 +97,11 @@ int main() {
81
97
});
82
98
}
83
99
100
+ // CHECK: CXXMethodDecl {{.*}} operator() {{.*}}
101
+ // CHECK: SYCLIntelFPGAMaxConcurrencyAttr
102
+ // CHECK: ConstantExpr {{.*}} 'int'
103
+ // CHECK: value: Int 0
104
+ // CHECK: IntegerLiteral {{.*}}0{{$}}
84
105
// CHECK: CXXMethodDecl {{.*}}used operator() {{.*}}
85
106
// CHECK: SYCLIntelFPGAMaxConcurrencyAttr {{.*}}
86
107
// CHECK: ConstantExpr {{.*}} 'int'
@@ -94,6 +115,11 @@ int main() {
94
115
// CHECK: ConstantExpr {{.*}} 'int'
95
116
// CHECK: value: Int 4
96
117
// CHECK: IntegerLiteral {{.*}}4{{$}}
118
+ // CHECK: FunctionDecl {{.*}}{{.*}} used bar0 {{.*}}
119
+ // CHECK: SYCLIntelFPGAMaxConcurrencyAttr {{.*}}
120
+ // CHECK: ConstantExpr {{.*}} 'int'
121
+ // CHECK: value: Int 0
122
+ // CHECK:IntegerLiteral {{.*}}{{.*}}0{{$}}
97
123
// CHECK: FunctionDecl {{.*}}{{.*}}func {{.*}}
98
124
// CHECK: SYCLIntelFPGAMaxConcurrencyAttr {{.*}}
99
125
// CHECK: FunctionDecl {{.*}}{{.*}}used func 'void ()'
0 commit comments