|
1 |
| -// REQUIRES: cuda |
| 1 | +// REQUIRES: cuda |
2 | 2 |
|
3 |
| -// RUN: not %clangxx -ferror-limit=100 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_70 -fsyntax-only %s -o - 2>&1 | FileCheck %s |
4 |
| - |
5 |
| -// NOTE: we can not use the `-verify` run alongside |
6 |
| -// `expected-error`/`expected-warnings` as the diagnostics come from the device |
7 |
| -// compilation, which happen in temporary files, while `expected-...` are |
8 |
| -// placed in the main file, causing clang to complain at the file mismatch |
| 3 | +// RUN: %clangxx -ferror-limit=100 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_70 -fsycl-device-only -fsyntax-only -Xclang -verify %s |
9 | 4 |
|
10 | 5 | #include <sycl/sycl.hpp>
|
11 | 6 |
|
12 | 7 | template <int N1, int N2, int N3> class Functor {
|
13 | 8 | public:
|
| 9 | + // expected-warning@+2 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}} |
14 | 10 | [[intel::max_work_group_size(1, 1, N1), intel::min_work_groups_per_cu(N2),
|
15 | 11 | intel::max_work_groups_per_mp(N3)]] void
|
16 |
| - // CHECK: maxclusterrank requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute |
17 | 12 | operator()() const {}
|
18 | 13 | };
|
19 | 14 |
|
20 | 15 | int main() {
|
21 | 16 | sycl::queue Q{};
|
22 | 17 |
|
23 |
| - sycl::range<1> Gws(32); |
24 |
| - sycl::range<1> Lws(32); |
25 |
| - |
26 | 18 | Q.submit([&](sycl::handler &cgh) {
|
| 19 | + // expected-warning@+5 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}} |
27 | 20 | cgh.single_task<class T1>(
|
28 |
| - sycl::nd_range<1>(Gws, Lws), |
29 | 21 | [=]()
|
30 | 22 | [[intel::max_work_group_size(1, 1, 256),
|
31 | 23 | intel::min_work_groups_per_cu(2),
|
32 |
| - // CHECK: maxclusterrank requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute |
33 | 24 | intel::max_work_groups_per_mp(4)]] { volatile int A = 42; });
|
34 | 25 |
|
35 | 26 | constexpr float A = 2.0;
|
| 27 | + // expected-error@+5 {{'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant}} |
| 28 | + // expected-warning@+5 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}} |
36 | 29 | cgh.single_task<class T2>(
|
37 | 30 | [=]()
|
38 | 31 | [[intel::max_work_group_size(1, 1, 256),
|
39 | 32 | intel::min_work_groups_per_cu(A),
|
40 |
| - // CHECK: 'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant |
41 | 33 | intel::max_work_groups_per_mp(4)]] { volatile int A = 42; });
|
42 |
| - // CHECK: maxclusterrank requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute |
43 | 34 |
|
| 35 | + // expected-error@+3 {{'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant}} |
44 | 36 | cgh.single_task<class T3>(
|
45 | 37 | [=]() [[intel::max_work_group_size(1, 1, 256),
|
46 | 38 | intel::min_work_groups_per_cu(2147483647 + 1)]]
|
47 |
| - // CHECK: 'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant |
48 | 39 | { volatile int A = 42; });
|
49 | 40 |
|
| 41 | + // expected-warning@+4 {{attribute 'min_work_groups_per_cu' is already applied with different arguments}} |
| 42 | + // expected-note@+2 {{previous attribute is here}} |
50 | 43 | cgh.single_task<class T4>([=]() [[intel::max_work_group_size(1, 1, 256),
|
51 | 44 | intel::min_work_groups_per_cu(4),
|
52 | 45 | intel::min_work_groups_per_cu(8)]] {
|
53 |
| - // CHECK: attribute 'min_work_groups_per_cu' is already applied with different arguments |
54 |
| - // CHECK: note: previous attribute is here |
55 | 46 | volatile int A = 42;
|
56 | 47 | });
|
57 | 48 |
|
| 49 | + // expected-error@+1 {{'min_work_groups_per_cu' attribute must be greater than 0}} |
58 | 50 | cgh.single_task<class T5>([=]() [[intel::min_work_groups_per_cu(-8)]] {
|
59 |
| - // CHECK: 'min_work_groups_per_cu' attribute must be greater than 0 |
60 | 51 | volatile int A = 42;
|
61 | 52 | });
|
62 | 53 | }).wait_and_throw();
|
|
0 commit comments