Skip to content

Commit 0a76fe6

Browse files
committed
[SYCL] Fixing comment about propagation of attributes to kernel
Also adding a test to check that the kernel does not get attributes from functions that are not directly called by it.
1 parent 4601713 commit 0a76fe6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fsycl -fsycl-is-device -verify %s
2+
3+
[[intelfpga::no_global_work_offset]] void not_direct() {} //expected-warning {{'no_global_work_offset' attribute ignored}}
4+
5+
void func() { not_direct(); }
6+
7+
template <typename Name, typename Type>
8+
[[clang::sycl_kernel]] void __my_kernel__(Type bar) {
9+
bar();
10+
func();
11+
}
12+
13+
template <typename Name, typename Type>
14+
void parallel_for(Type lambda) {
15+
__my_kernel__<Name>(lambda);
16+
}
17+
18+
void invoke_foo2() {
19+
parallel_for<class KernelName>([]() {});
20+
}

0 commit comments

Comments
 (0)