1
- // RUN: %clang %s -fsyntax-only -Xclang -ast-dump -fsycl-device-only | FileCheck %s
1
+ // RUN: %clang_cc1 %s -fsyntax-only -fsycl -fsycl-is-device -triple spir64 -verify
2
+ // RUN: %clang_cc1 %s -fsyntax-only -fsycl -fsycl-is-device -triple spir64 -DTRIGGER_ERROR -verify
3
+ // RUN: %clang_cc1 %s -fsyntax-only -ast-dump -fsycl -fsycl-is-device -triple spir64 | FileCheck %s
2
4
5
+ #ifndef TRIGGER_ERROR
3
6
[[intelfpga::no_global_work_offset]] // expected-no-diagnostics
4
7
void
5
- func ();
8
+ func1 ();
6
9
7
- [[intelfpga::max_work_group_size(8 , 8 , 8 )]] // expected-no-diagnostics
10
+ [[intelfpga::max_work_group_size(4 , 4 , 4 )]] void func1 ();
11
+
12
+ [[cl::reqd_work_group_size(2 , 2 , 2 )]] void func1 () {}
13
+
14
+ #else
15
+ [[intelfpga::max_work_group_size(4 , 4 , 4 )]] // expected-note {{conflicting attribute is here}}
8
16
void
9
- func ();
17
+ func2 ();
10
18
11
- [[cl::reqd_work_group_size(4 , 4 , 4 )]] // expected-no-diagnostics
19
+ [[cl::reqd_work_group_size(8 , 8 , 8 )]] // expected-note {{conflicting attribute is here}}
12
20
void
13
- func () {}
21
+ func2 () {}
22
+ #endif
14
23
15
24
template <typename Name, typename Type>
16
25
[[clang::sycl_kernel]] void __my_kernel__ (Type bar) {
17
26
bar ();
18
- func ();
27
+ #ifndef TRIGGER_ERROR
28
+ func1 ();
29
+ #else
30
+ func2 ();
31
+ #endif
19
32
}
20
33
21
34
template <typename Name, typename Type>
@@ -24,10 +37,14 @@ void parallel_for(Type func) {
24
37
}
25
38
26
39
void invoke_foo2 () {
40
+ #ifndef TRIGGER_ERROR
27
41
// CHECK-LABEL: FunctionDecl {{.*}} invoke_foo2 'void ()'
28
42
// CHECK: `-FunctionDecl {{.*}} _ZTSZ11invoke_foo2vE10KernelName 'void ()'
29
- // CHECK: -SYCLIntelMaxWorkGroupSizeAttr {{.*}} Inherited 8 8 8
43
+ // CHECK: -SYCLIntelMaxWorkGroupSizeAttr {{.*}} Inherited 4 4 4
30
44
// CHECK: -SYCLIntelNoGlobalWorkOffsetAttr {{.*}} Inherited Enabled
31
- // CHECK: `-ReqdWorkGroupSizeAttr {{.*}} 4 4 4
45
+ // CHECK: `-ReqdWorkGroupSizeAttr {{.*}} 2 2 2
32
46
parallel_for<class KernelName >([]() {});
47
+ #else
48
+ parallel_for<class KernelName >([]() {}); // expected-error {{conflicting attributes applied to a SYCL kernel or SYCL_EXTERNAL function}}
49
+ #endif
33
50
}
0 commit comments