Skip to content

Commit a97bc95

Browse files
committed
Move test to clang/test/SemaSYCL
1 parent bbe994d commit a97bc95

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11991,7 +11991,7 @@ def warn_launch_bounds_is_cuda_specific : Warning<
1199111991
InGroup<IgnoredAttributes>;
1199211992

1199311993
def warn_cuda_maxclusterrank_sm_90 : Warning<
11994-
"maxclusterrank requires sm_90 or higher, CUDA arch provided: %0, ignoring "
11994+
"'maxclusterrank' requires sm_90 or higher, CUDA arch provided: %0, ignoring "
1199511995
"%1 attribute">, InGroup<IgnoredAttributes>;
1199611996

1199711997
def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must "

clang/test/SemaCUDA/launch_bounds.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ __launch_bounds__(0x10000000000000000) void TestWayTooBigArg(void); // expected-
1111

1212
__launch_bounds__(-128, 7) void TestNegArg1(void); // expected-warning {{'launch_bounds' attribute parameter 0 is negative and will be ignored}}
1313
__launch_bounds__(128, -7) void TestNegArg2(void); // expected-warning {{'launch_bounds' attribute parameter 1 is negative and will be ignored}}
14-
__launch_bounds__(128, 2, -8) void TestNegArg2(void); // expected-warning {{maxclusterrank requires sm_90 or higher, CUDA arch provided: sm_75, ignoring 'launch_bounds' attribute}}
14+
__launch_bounds__(128, 2, -8) void TestNegArg2(void); // expected-warning {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_75, ignoring 'launch_bounds' attribute}}
1515

1616
__launch_bounds__(1, 2, 3, 4) void Test4Args(void); // expected-error {{'launch_bounds' attribute takes no more than 3 arguments}}
1717
__launch_bounds__() void TestNoArgs(void); // expected-error {{'launch_bounds' attribute takes at least 1 argument}}
@@ -49,4 +49,4 @@ __launch_bounds__(Args) void TestTemplateVariadicArgs(void) {} // expected-error
4949
template <int... Args>
5050
__launch_bounds__(1, Args) void TestTemplateVariadicArgs2(void) {} // expected-error {{expression contains unexpanded parameter pack 'Args'}}
5151

52-
__launch_bounds__(1, 2, 3) void Test3Args(void); // expected-warning {{maxclusterrank requires sm_90 or higher, CUDA arch provided: sm_75, ignoring 'launch_bounds' attribute}}
52+
__launch_bounds__(1, 2, 3) void Test3Args(void); // expected-warning {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_75, ignoring 'launch_bounds' attribute}}

sycl/test/launch_bounds/lb_sm_70.cpp renamed to clang/test/SemaSYCL/lb_sm_70.cpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,53 @@
1-
// REQUIRES: cuda
1+
// REQUIRES: cuda
22

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
94

105
#include <sycl/sycl.hpp>
116

127
template <int N1, int N2, int N3> class Functor {
138
public:
9+
// expected-warning@+2 {{'maxclusterrank' requires sm_90 or higher, CUDA arch provided: sm_70, ignoring 'max_work_groups_per_mp' attribute}}
1410
[[intel::max_work_group_size(1, 1, N1), intel::min_work_groups_per_cu(N2),
1511
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
1712
operator()() const {}
1813
};
1914

2015
int main() {
2116
sycl::queue Q{};
2217

23-
sycl::range<1> Gws(32);
24-
sycl::range<1> Lws(32);
25-
2618
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}}
2720
cgh.single_task<class T1>(
28-
sycl::nd_range<1>(Gws, Lws),
2921
[=]()
3022
[[intel::max_work_group_size(1, 1, 256),
3123
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
3324
intel::max_work_groups_per_mp(4)]] { volatile int A = 42; });
3425

3526
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}}
3629
cgh.single_task<class T2>(
3730
[=]()
3831
[[intel::max_work_group_size(1, 1, 256),
3932
intel::min_work_groups_per_cu(A),
40-
// CHECK: 'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant
4133
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
4334

35+
// expected-error@+3 {{'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant}}
4436
cgh.single_task<class T3>(
4537
[=]() [[intel::max_work_group_size(1, 1, 256),
4638
intel::min_work_groups_per_cu(2147483647 + 1)]]
47-
// CHECK: 'min_work_groups_per_cu' attribute requires parameter 0 to be an integer constant
4839
{ volatile int A = 42; });
4940

41+
// expected-warning@+4 {{attribute 'min_work_groups_per_cu' is already applied with different arguments}}
42+
// expected-note@+2 {{previous attribute is here}}
5043
cgh.single_task<class T4>([=]() [[intel::max_work_group_size(1, 1, 256),
5144
intel::min_work_groups_per_cu(4),
5245
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
5546
volatile int A = 42;
5647
});
5748

49+
// expected-error@+1 {{'min_work_groups_per_cu' attribute must be greater than 0}}
5850
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
6051
volatile int A = 42;
6152
});
6253
}).wait_and_throw();

0 commit comments

Comments
 (0)