From 3b3a5d1ed971570ca25db089aaee4ee330305fba Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Fri, 5 Sep 2025 11:27:58 -0700 Subject: [PATCH 1/3] [NFCI][SYCL] Assert `KernelHasName` in `StoreLambda` I don't understand what not having a name was supposed to mean and it doesn't make any sense to me. The only failures I've seen after implementing this change is when we compile SYCL code with non-SYCL compiler without any SYCL knowledge (as in `clang++ -fsycl -fsycl-host-compiler=<...>` does have SYCL knowledge provided via integration headers). If anyone knows why this change would be incorrect, please let me know. --- sycl/include/sycl/handler.hpp | 44 +++++++++---------- sycl/test/basic_tests/fp-accuracy.cpp | 2 +- .../basic_tests/single_task_error_message.cpp | 8 ++-- .../non_esimd_kernel_fp_control.cpp | 2 +- .../virtual-functions/properties-negative.cpp | 2 +- .../warnings/deprecated_get_backend_info.cpp | 2 +- sycl/test/warnings/sycl_2020_deprecations.cpp | 20 ++++----- sycl/unittests/CMakeLists.txt | 2 + 8 files changed, 40 insertions(+), 42 deletions(-) diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index dc9f8fcf1146e..3afc70b934a89 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -825,16 +825,24 @@ class __SYCL_EXPORT handler { #endif constexpr auto Info = detail::CompileTimeKernelInfo; - constexpr bool KernelHasName = (Info.Name != std::string_view{}); + // SYCL unittests are built without sycl compiler, so "host" information + // about kernels isn't provided (e.g., via integration headers or compiler + // builtins). + // + // However, some copy/fill USM operation are implemented via SYCL kernels + // and are instantiated resulting in all the `static_assert` checks being + // exercised. Without kernel information that would fail, so we explicitly + // disable such checks when this macro is defined. Note that the unittests + // don't actually execute those operation, that's why disabling + // unconditional `static_asserts`s is enough for now. +#ifndef __SYCL_UNITTESTS + static_assert(Info.Name != std::string_view{}, "Kernel must have a name!"); // Some host compilers may have different captures from Clang. Currently // there is no stable way of handling this when extracting the captures, // so a static assert is made to fail for incompatible kernel lambdas. - - // TODO remove the ifdef once the kernel size builtin is supported. -#ifdef __INTEL_SYCL_USE_INTEGRATION_HEADERS static_assert( - !KernelHasName || sizeof(KernelType) == Info.KernelSize, + sizeof(KernelType) == Info.KernelSize, "Unexpected kernel lambda size. This can be caused by an " "external host compiler producing a lambda with an " "unexpected layout. This is a limitation of the compiler." @@ -846,25 +854,13 @@ class __SYCL_EXPORT handler { "-fsycl-host-compiler-options='/std:c++latest' " "might also help."); #endif - // Empty name indicates that the compilation happens without integration - // header, so don't perform things that require it. - if constexpr (KernelHasName) { - // TODO support ESIMD in no-integration-header case too. - - // Force hasSpecialCaptures to be evaluated at compile-time. - setKernelInfo((void *)MHostKernel->getPtr(), Info.NumParams, - Info.ParamDescGetter, Info.IsESIMD, - Info.HasSpecialCaptures); - - MKernelName = Info.Name; - setDeviceKernelInfoPtr(&detail::getDeviceKernelInfo()); - } else { - // In case w/o the integration header it is necessary to process - // accessors from the list(which are associated with this handler) as - // arguments. We must copy the associated accessors as they are checked - // later during finalize. - setArgsToAssociatedAccessors(); - } + + // Force hasSpecialCaptures to be evaluated at compile-time. + setKernelInfo((void *)MHostKernel->getPtr(), Info.NumParams, + Info.ParamDescGetter, Info.IsESIMD, Info.HasSpecialCaptures); + + MKernelName = Info.Name; + setDeviceKernelInfoPtr(&detail::getDeviceKernelInfo()); // If the kernel lambda is callable with a kernel_handler argument, manifest // the associated kernel handler. diff --git a/sycl/test/basic_tests/fp-accuracy.cpp b/sycl/test/basic_tests/fp-accuracy.cpp index 5281e07e69f55..7b71a7325de21 100644 --- a/sycl/test/basic_tests/fp-accuracy.cpp +++ b/sycl/test/basic_tests/fp-accuracy.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -%fsycl-host-only -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s +// RUN: %clangxx -fsycl -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s #include diff --git a/sycl/test/basic_tests/single_task_error_message.cpp b/sycl/test/basic_tests/single_task_error_message.cpp index 7389296645d63..6b5d87c08f2ea 100644 --- a/sycl/test/basic_tests/single_task_error_message.cpp +++ b/sycl/test/basic_tests/single_task_error_message.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include int main() { @@ -11,7 +11,7 @@ int main() { myQueue .single_task([&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } @@ -27,7 +27,7 @@ int main() { .single_task(e, [&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } @@ -43,7 +43,7 @@ int main() { .single_task(vector_event, [&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } diff --git a/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp b/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp index 46d11eccdfe54..3fd7262d766da 100644 --- a/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp +++ b/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s +// RUN: %clangxx -D__SYCL_UNITTESTS %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s #include diff --git a/sycl/test/virtual-functions/properties-negative.cpp b/sycl/test/virtual-functions/properties-negative.cpp index b8e1b75f1d9a9..e69c753f1577c 100644 --- a/sycl/test/virtual-functions/properties-negative.cpp +++ b/sycl/test/virtual-functions/properties-negative.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s +// RUN: %clangxx -D__SYCL_UNITTESTS %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s #include diff --git a/sycl/test/warnings/deprecated_get_backend_info.cpp b/sycl/test/warnings/deprecated_get_backend_info.cpp index 1932fc910fc68..46e5a5adb3f45 100644 --- a/sycl/test/warnings/deprecated_get_backend_info.cpp +++ b/sycl/test/warnings/deprecated_get_backend_info.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include #include diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index de03ad097adf0..ef7a7ecd42275 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx %fsycl-host-only -fsyntax-only -ferror-limit=0 -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx -fsycl-device-only -fsyntax-only -ferror-limit=0 -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s // expected-warning@CL/sycl.hpp:* {{CL/sycl.hpp is deprecated, use sycl/sycl.hpp}} #include @@ -283,7 +283,7 @@ int main() { // expected-warning@+8{{'get_pointer' is deprecated: accessor::get_pointer() is deprecated, please use get_multi_ptr()}} // expected-warning@+7{{'get_pointer' is deprecated: accessor::get_pointer() is deprecated, please use get_multi_ptr()}} - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyGlobalMptr = @@ -291,7 +291,7 @@ int main() { sycl::access::decorated::legacy>( GlobalAcc.get_pointer()); // expected-warning@+7{{'get_pointer' is deprecated: local_accessor::get_pointer() is deprecated, please use get_multi_ptr()}} - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyLocalMptr = @@ -299,7 +299,7 @@ int main() { sycl::access::decorated::legacy>( LocalAcc.get_pointer()); - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyPrivateMptr = @@ -329,27 +329,27 @@ int main() { sycl::access::decorated::yes> UndecoratedPrivateMptr = DecoratedPrivateMptr; - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __global int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedGlobalPtr = static_cast( DecoratedGlobalMptr); - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __local int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedLocalPtr = static_cast( DecoratedLocalMptr); - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __private int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedPrivatePtr = static_cast( DecoratedPrivateMptr); - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __global int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedGlobalPtr = static_cast( UndecoratedGlobalMptr); - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __local int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedLocalPtr = static_cast( UndecoratedLocalMptr); - // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator __private int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedPrivatePtr = static_cast( UndecoratedPrivateMptr); diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 62af3d0074cac..308df97c18630 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -9,6 +9,8 @@ endforeach() add_compile_definitions(SYCL2020_DISABLE_DEPRECATION_WARNINGS SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) +add_compile_definitions(__SYCL_UNITTESTS) + # suppress warnings which came from Google Test sources if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG) add_compile_options("-Wno-suggest-override") From 93e1a8afc1e8ccb300f2d8a5a1fef59571af7fdb Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Mon, 8 Sep 2025 09:44:32 -0700 Subject: [PATCH 2/3] Address code-review feedback --- sycl/include/sycl/handler.hpp | 2 +- sycl/test/basic_tests/fp-accuracy.cpp | 2 +- .../basic_tests/single_task_error_message.cpp | 8 ++++---- .../non_esimd_kernel_fp_control.cpp | 2 +- sycl/test/lit.cfg.py | 2 +- .../virtual-functions/properties-negative.cpp | 2 +- .../warnings/deprecated_get_backend_info.cpp | 2 +- sycl/test/warnings/sycl_2020_deprecations.cpp | 20 +++++++++---------- sycl/unittests/CMakeLists.txt | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index 3afc70b934a89..1f40aed34d350 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -835,7 +835,7 @@ class __SYCL_EXPORT handler { // disable such checks when this macro is defined. Note that the unittests // don't actually execute those operation, that's why disabling // unconditional `static_asserts`s is enough for now. -#ifndef __SYCL_UNITTESTS +#ifndef __SYCL_UNITTESTS_BYPASS_KERNEL_NAME_CHECK static_assert(Info.Name != std::string_view{}, "Kernel must have a name!"); // Some host compilers may have different captures from Clang. Currently diff --git a/sycl/test/basic_tests/fp-accuracy.cpp b/sycl/test/basic_tests/fp-accuracy.cpp index 7b71a7325de21..5281e07e69f55 100644 --- a/sycl/test/basic_tests/fp-accuracy.cpp +++ b/sycl/test/basic_tests/fp-accuracy.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s +// RUN: %clangxx -%fsycl-host-only -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s #include diff --git a/sycl/test/basic_tests/single_task_error_message.cpp b/sycl/test/basic_tests/single_task_error_message.cpp index 6b5d87c08f2ea..7389296645d63 100644 --- a/sycl/test/basic_tests/single_task_error_message.cpp +++ b/sycl/test/basic_tests/single_task_error_message.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include int main() { @@ -11,7 +11,7 @@ int main() { myQueue .single_task([&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } @@ -27,7 +27,7 @@ int main() { .single_task(e, [&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } @@ -43,7 +43,7 @@ int main() { .single_task(vector_event, [&](sycl::handler &cgh) { // expected-error-re@sycl/queue.hpp:* {{static assertion failed due to requirement '{{.*}}': sycl::queue.single_task() requires a kernel instead of command group.{{.*}} Use queue.submit() instead}} - // expected-error-re@sycl/detail/kernel_launch_helper.hpp:* {{no matching function for call to object of type 'const (lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} + // expected-error-re@sycl/detail/cg_types.hpp:* {{no matching function for call to object of type '(lambda at {{.*}}single_task_error_message.cpp:{{.*}})'}} }) .wait(); } diff --git a/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp b/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp index 3fd7262d766da..46d11eccdfe54 100644 --- a/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp +++ b/sycl/test/extensions/properties/non_esimd_kernel_fp_control.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -D__SYCL_UNITTESTS %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s #include diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index 4ebe0b06ff040..1bc4f2ba0ef39 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -126,7 +126,7 @@ llvm_symbolizer = os.path.join(config.llvm_build_bin_dir, "llvm-symbolizer") llvm_config.with_environment("LLVM_SYMBOLIZER_PATH", llvm_symbolizer) -sycl_host_only_options = "-std=c++17 -Xclang -fsycl-is-host" +sycl_host_only_options = "-std=c++17 -Xclang -fsycl-is-host -D__SYCL_UNITTESTS_BYPASS_KERNEL_NAME_CHECK=1" for include_dir in [ config.sycl_include, config.level_zero_include_dir, diff --git a/sycl/test/virtual-functions/properties-negative.cpp b/sycl/test/virtual-functions/properties-negative.cpp index e69c753f1577c..b8e1b75f1d9a9 100644 --- a/sycl/test/virtual-functions/properties-negative.cpp +++ b/sycl/test/virtual-functions/properties-negative.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -D__SYCL_UNITTESTS %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s #include diff --git a/sycl/test/warnings/deprecated_get_backend_info.cpp b/sycl/test/warnings/deprecated_get_backend_info.cpp index 46e5a5adb3f45..1932fc910fc68 100644 --- a/sycl/test/warnings/deprecated_get_backend_info.cpp +++ b/sycl/test/warnings/deprecated_get_backend_info.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include #include diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index ef7a7ecd42275..de03ad097adf0 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl-device-only -fsyntax-only -ferror-limit=0 -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx %fsycl-host-only -fsyntax-only -ferror-limit=0 -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s // expected-warning@CL/sycl.hpp:* {{CL/sycl.hpp is deprecated, use sycl/sycl.hpp}} #include @@ -283,7 +283,7 @@ int main() { // expected-warning@+8{{'get_pointer' is deprecated: accessor::get_pointer() is deprecated, please use get_multi_ptr()}} // expected-warning@+7{{'get_pointer' is deprecated: accessor::get_pointer() is deprecated, please use get_multi_ptr()}} - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyGlobalMptr = @@ -291,7 +291,7 @@ int main() { sycl::access::decorated::legacy>( GlobalAcc.get_pointer()); // expected-warning@+7{{'get_pointer' is deprecated: local_accessor::get_pointer() is deprecated, please use get_multi_ptr()}} - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyLocalMptr = @@ -299,7 +299,7 @@ int main() { sycl::access::decorated::legacy>( LocalAcc.get_pointer()); - // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} + // expected-warning@+4{{'make_ptr' is deprecated: make_ptr is deprecated since SYCL 2020. Please use address_space_cast instead.}} sycl::multi_ptr LegacyPrivateMptr = @@ -329,27 +329,27 @@ int main() { sycl::access::decorated::yes> UndecoratedPrivateMptr = DecoratedPrivateMptr; - // expected-warning@+2{{'operator __global int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedGlobalPtr = static_cast( DecoratedGlobalMptr); - // expected-warning@+2{{'operator __local int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedLocalPtr = static_cast( DecoratedLocalMptr); - // expected-warning@+2{{'operator __private int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto DecoratedPrivatePtr = static_cast( DecoratedPrivateMptr); - // expected-warning@+2{{'operator __global int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedGlobalPtr = static_cast( UndecoratedGlobalMptr); - // expected-warning@+2{{'operator __local int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedLocalPtr = static_cast( UndecoratedLocalMptr); - // expected-warning@+2{{'operator __private int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} + // expected-warning@+2{{'operator int *' is deprecated: Conversion to pointer type is deprecated since SYCL 2020. Please use get() instead.}} auto UndecoratedPrivatePtr = static_cast( UndecoratedPrivateMptr); diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 308df97c18630..6002f48d214a7 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -9,7 +9,7 @@ endforeach() add_compile_definitions(SYCL2020_DISABLE_DEPRECATION_WARNINGS SYCL_DISABLE_FSYCL_SYCLHPP_WARNING) -add_compile_definitions(__SYCL_UNITTESTS) +add_compile_definitions(__SYCL_UNITTESTS_BYPASS_KERNEL_NAME_CHECK) # suppress warnings which came from Google Test sources if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG) From 809ae70badb4f27864944303afb9225abf29352d Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Mon, 8 Sep 2025 09:52:16 -0700 Subject: [PATCH 3/3] python formatting --- sycl/test/lit.cfg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index 1bc4f2ba0ef39..94408de4ec328 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -126,7 +126,9 @@ llvm_symbolizer = os.path.join(config.llvm_build_bin_dir, "llvm-symbolizer") llvm_config.with_environment("LLVM_SYMBOLIZER_PATH", llvm_symbolizer) -sycl_host_only_options = "-std=c++17 -Xclang -fsycl-is-host -D__SYCL_UNITTESTS_BYPASS_KERNEL_NAME_CHECK=1" +sycl_host_only_options = ( + "-std=c++17 -Xclang -fsycl-is-host -D__SYCL_UNITTESTS_BYPASS_KERNEL_NAME_CHECK=1" +) for include_dir in [ config.sycl_include, config.level_zero_include_dir,