You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Refactor two FPGA function attributes (#3274)
This patch
1. refactors two function attributes:
[[intel::no_global_work_offset()]] and [[intel::scheduler_target_fmax_mhz()]]
using #3224 as a template to better fit for community standards.
2. refactors the way we handle duplicate attributes on a given declaration.
3. handles redeclarations or template instantiations properly.
4. adds test
Signed-off-by: Soumi Manna <[email protected]>
[[intel::scheduler_target_fmax_mhz(12)]] voidbar() {} // OK
11
+
12
+
[[intel::scheduler_target_fmax_mhz(12)]] voidbaz(); // expected-note {{previous attribute is here}}
13
+
[[intel::scheduler_target_fmax_mhz(100)]] voidbaz(); // expected-warning {{attribute 'scheduler_target_fmax_mhz' is already applied with different parameters}}
[]() [[intel::scheduler_target_fmax_mhz(-4)]]{}); // expected-error{{'scheduler_target_fmax_mhz' attribute requires a non-negative integral compile time constant expression}}
48
54
49
55
cl::sycl::kernel_single_task<classtest_kernel6>(
50
-
[]() [[intel::scheduler_target_fmax_mhz(1), intel::scheduler_target_fmax_mhz(2)]]{}); // expected-warning{{attribute 'scheduler_target_fmax_mhz' is already applied with different parameters}}
56
+
[]() [[intel::scheduler_target_fmax_mhz(1), // expected-note {{previous attribute is here}}
57
+
intel::scheduler_target_fmax_mhz(2)]]{}); // expected-warning{{attribute 'scheduler_target_fmax_mhz' is already applied with different parameters}}
[[intel::no_global_work_offset(0)]] voidfunc7(); // expected-note {{previous attribute is here}}
67
+
template <int N>
68
+
[[intel::no_global_work_offset(N)]] voidfunc7() {} // expected-warning {{attribute 'no_global_work_offset' is already applied with different parameters}}
52
69
53
70
intcheck() {
54
-
func3<1>();
71
+
func6<1>();
72
+
func7<1>(); //expected-note {{in instantiation of function template specialization 'func7<1>' requested here}}
0 commit comments