Skip to content

Commit

Permalink
Add diagnostic to SyclStrict group
Browse files Browse the repository at this point in the history
  • Loading branch information
Fznamznon committed Aug 25, 2020
1 parent ef6a8e0 commit 05d5cdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -10992,7 +10992,7 @@ def err_sycl_restrict : Error<
"}0">;
def warn_sycl_kernel_too_many_args : Warning<
"resulting number of kernel arguments %0 is greater than maximum supported "
"on GPU device - %1">;
"on GPU device - %1">, InGroup<SyclStrict>;
def err_sycl_virtual_types : Error<
"No class with a vtable can be used in a SYCL kernel or any code included in the kernel">;
def note_sycl_recursive_function_declared_here: Note<"function implemented using recursion declared here">;
Expand Down
6 changes: 5 additions & 1 deletion clang/test/SemaSYCL/num-args-overflow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsycl -triple spir64_gen -DGPU -fsycl-is-device -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsycl -triple spir64_gen -Wno-sycl-strict -fsycl-is-device -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsycl -triple spir64_gen -Werror=sycl-strict -DERROR -fsycl-is-device -fsyntax-only -verify %s

template <typename Name, typename F>
__attribute__((sycl_kernel)) void kernel(F kernelFunc) {
Expand All @@ -9,7 +11,9 @@ __attribute__((sycl_kernel)) void kernel(F kernelFunc) {
void use() {
int Arr[2001];
#ifdef GPU
// expected-warning@+4 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}}
// expected-warning@+6 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}}
#elif ERROR
// expected-error@+4 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}}
#else
// expected-no-diagnostics
#endif
Expand Down

0 comments on commit 05d5cdb

Please sign in to comment.