Skip to content

Commit 27305a0

Browse files
authored
[SYCL][NFC] Silence unknown attribute warnings on Host compilation (#6124)
This patch updates test to use a custom verify. e.g, -verify=host on the RUN line and then // host-warning {{'bank_bits' attribute ignored}} instead of using the preprocessor conditional. Fixes #5667 Signed-off-by: Soumi Manna <soumi.manna@intel.com>
1 parent 059efbc commit 27305a0

File tree

1 file changed

+37
-88
lines changed

1 file changed

+37
-88
lines changed
Lines changed: 37 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,46 @@
1-
// RUN: %clang_cc1 -fsycl-is-host -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s -DSYCLHOST
2-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -fsycl-is-host -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
2+
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify=device %s
33

44
// Test checks the attribute is silently ignored during host compilation
55
// where -fsycl-is-host is passed on cc1.
66

7-
#ifdef SYCLHOST
87
// expected-no-diagnostics
9-
#endif
108

119
void foo()
1210
{
13-
#ifndef SYCLHOST
14-
// expected-warning@+2 {{'doublepump' attribute ignored}}
15-
#endif
16-
[[intel::doublepump]] unsigned int v_one[64];
17-
18-
#ifndef SYCLHOST
19-
// expected-warning@+2 {{'fpga_memory' attribute ignored}}
20-
#endif
21-
[[intel::fpga_memory]] unsigned int v_two[64];
22-
23-
#ifndef SYCLHOST
24-
// expected-warning@+2 {{'fpga_register' attribute ignored}}
25-
#endif
26-
[[intel::fpga_register]] unsigned int v_three[64];
27-
28-
#ifndef SYCLHOST
29-
// expected-warning@+2 {{'singlepump' attribute ignored}}
30-
#endif
31-
[[intel::singlepump]] unsigned int v_four[64];
32-
33-
#ifndef SYCLHOST
34-
// expected-warning@+2 {{'bankwidth' attribute ignored}}
35-
#endif
36-
[[intel::bankwidth(4)]] unsigned int v_five[32];
37-
38-
#ifndef SYCLHOST
39-
// expected-warning@+2 {{'numbanks' attribute ignored}}
40-
#endif
41-
[[intel::numbanks(8)]] unsigned int v_six[32];
42-
43-
#ifndef SYCLHOST
44-
// expected-warning@+2 {{'private_copies' attribute ignored}}
45-
#endif
46-
[[intel::private_copies(8)]] unsigned int v_seven[64];
47-
48-
#ifndef SYCLHOST
49-
// expected-warning@+2 {{'merge' attribute ignored}}
50-
#endif
51-
[[intel::merge("mrg1", "depth")]] unsigned int v_eight[64];
52-
53-
#ifndef SYCLHOST
54-
// expected-warning@+2 {{'max_replicates' attribute ignored}}
55-
#endif
56-
[[intel::max_replicates(2)]] unsigned int v_nine[64];
57-
58-
#ifndef SYCLHOST
59-
// expected-warning@+2 {{'simple_dual_port' attribute ignored}}
60-
#endif
61-
[[intel::simple_dual_port]] unsigned int v_ten[64];
62-
63-
#ifndef SYCLHOST
64-
// expected-warning@+2 {{'bank_bits' attribute ignored}}
65-
#endif
66-
[[intel::bank_bits(2, 3, 4, 5)]] unsigned int v_eleven[64];
67-
68-
#ifndef SYCLHOST
69-
// expected-warning@+2 {{'use_stall_enable_clusters' attribute ignored}}
70-
#endif
71-
[[intel::use_stall_enable_clusters]] void func();
72-
73-
#ifndef SYCLHOST
74-
// expected-warning@+2 {{'max_global_work_dim' attribute ignored}}
75-
#endif
76-
[[intel::max_global_work_dim(1)]] void func1();
77-
78-
#ifndef SYCLHOST
79-
// expected-warning@+2 {{'scheduler_target_fmax_mhz' attribute ignored}}
80-
#endif
81-
[[intel::scheduler_target_fmax_mhz(3)]] void func2();
82-
83-
#ifndef SYCLHOST
84-
// expected-warning@+2 {{'kernel_args_restrict' attribute ignored}}
85-
#endif
86-
[[intel::kernel_args_restrict]] void func3();
87-
88-
#ifndef SYCLHOST
89-
// expected-warning@+2 {{'num_simd_work_items' attribute ignored}}
90-
#endif
91-
[[intel::num_simd_work_items(12)]] void func4();
92-
93-
#ifndef SYCLHOST
94-
// expected-warning@+2 {{'max_work_group_size' attribute ignored}}
95-
#endif
96-
[[intel::max_work_group_size(32, 32, 32)]] void func5();
11+
[[intel::doublepump]] unsigned int v_one[64]; // device-warning {{'doublepump' attribute ignored}}
12+
13+
[[intel::fpga_memory]] unsigned int v_two[64]; // device-warning {{'fpga_memory' attribute ignored}}
14+
15+
[[intel::fpga_register]] unsigned int v_three[64]; // device-warning {{'fpga_register' attribute ignored}}
16+
17+
[[intel::singlepump]] unsigned int v_four[64]; // device-warning {{'singlepump' attribute ignored}}
18+
19+
[[intel::bankwidth(4)]] unsigned int v_five[32]; // device-warning {{'bankwidth' attribute ignored}}
20+
21+
[[intel::numbanks(8)]] unsigned int v_six[32]; // device-warning {{'numbanks' attribute ignored}}
22+
23+
[[intel::private_copies(8)]] unsigned int v_seven[64]; // device-warning {{'private_copies' attribute ignored}}
24+
25+
[[intel::merge("mrg1", "depth")]] unsigned int v_eight[64]; // device-warning {{'merge' attribute ignored}}
26+
27+
[[intel::max_replicates(2)]] unsigned int v_nine[64]; // device-warning {{'max_replicates' attribute ignored}}
28+
29+
[[intel::simple_dual_port]] unsigned int v_ten[64]; // device-warning {{'simple_dual_port' attribute ignored}}
30+
31+
[[intel::bank_bits(2, 3, 4, 5)]] unsigned int v_eleven[64]; // device-warning {{'bank_bits' attribute ignored}}
32+
33+
[[intel::use_stall_enable_clusters]] void func(); // device-warning {{'use_stall_enable_clusters' attribute ignored}}
34+
35+
[[intel::max_global_work_dim(1)]] void func1(); // device-warning {{'max_global_work_dim' attribute ignored}}
36+
37+
[[intel::scheduler_target_fmax_mhz(3)]] void func2(); // device-warning {{'scheduler_target_fmax_mhz' attribute ignored}}
38+
39+
[[intel::kernel_args_restrict]] void func3(); // device-warning {{'kernel_args_restrict' attribute ignored}}
40+
41+
[[intel::num_simd_work_items(12)]] void func4(); // device-warning {{'num_simd_work_items' attribute ignored}}
42+
43+
[[intel::max_work_group_size(32, 32, 32)]] void func5(); // device-warning {{'max_work_group_size' attribute ignored}}
44+
45+
[[intel::device_indirectly_callable]] void func6(); // device-warning {{'device_indirectly_callable' attribute ignored}}
9746
}

0 commit comments

Comments
 (0)