From 7af6a9c24e2ad4ccdef0d885174abc65b61cf32d Mon Sep 17 00:00:00 2001 From: Georgij Tsarin <68424751+crystarm@users.noreply.github.com> Date: Thu, 2 Jul 2026 14:33:54 +0300 Subject: [PATCH 1/4] [SYCL] Deprecate legacy info::kernel descriptors --- sycl/include/sycl/info/kernel.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sycl/include/sycl/info/kernel.hpp b/sycl/include/sycl/info/kernel.hpp index eec1f242635c2..47ad23041069c 100644 --- a/sycl/include/sycl/info/kernel.hpp +++ b/sycl/include/sycl/info/kernel.hpp @@ -8,6 +8,7 @@ #pragma once +#include // for __SYCL_DEPRECATED #include #include #include @@ -35,15 +36,23 @@ struct num_args : kernel_traits { struct attributes : kernel_traits { using return_type = std::string; }; -struct function_name : kernel_traits { +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +struct __SYCL_DEPRECATED( + "info::kernel::function_name is not part of SYCL 2020") + function_name : kernel_traits { using return_type = std::string; }; -struct reference_count : kernel_traits { +struct __SYCL_DEPRECATED( + "info::kernel::reference_count is not part of SYCL 2020") + reference_count : kernel_traits { using return_type = uint32_t; }; -struct context : kernel_traits { +struct __SYCL_DEPRECATED( + "info::kernel::context is not part of SYCL 2020") + context : kernel_traits { using return_type = sycl::context; }; +#endif // __INTEL_PREVIEW_BREAKING_CHANGES } // namespace kernel namespace kernel_device_specific { From 39fff513e238f099faefe6121826eaccd85092a5 Mon Sep 17 00:00:00 2001 From: Georgij Tsarin <68424751+crystarm@users.noreply.github.com> Date: Thu, 2 Jul 2026 15:54:30 +0300 Subject: [PATCH 2/4] [SYCL] Guard defines_elementary include --- sycl/include/sycl/info/kernel.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sycl/include/sycl/info/kernel.hpp b/sycl/include/sycl/info/kernel.hpp index 47ad23041069c..6d06d4492ffeb 100644 --- a/sycl/include/sycl/info/kernel.hpp +++ b/sycl/include/sycl/info/kernel.hpp @@ -8,7 +8,9 @@ #pragma once +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES #include // for __SYCL_DEPRECATED +#endif #include #include #include From f6f43ba7a1f676cf0604409f93ffc78a4912c803 Mon Sep 17 00:00:00 2001 From: Georgij Tsarin <68424751+crystarm@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:50:21 +0300 Subject: [PATCH 3/4] [SYCL] Fix __INTEL_PREVIEW_BREAKING_CHANGES build for deprecated kernel info --- sycl/include/sycl/info/kernel.hpp | 10 ++++------ sycl/source/detail/kernel_impl.cpp | 19 +++++++++++++++---- sycl/source/detail/kernel_impl.hpp | 2 ++ sycl/source/detail/scheduler/commands.cpp | 2 +- sycl/source/kernel.cpp | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/sycl/include/sycl/info/kernel.hpp b/sycl/include/sycl/info/kernel.hpp index 6d06d4492ffeb..721357c9bf50a 100644 --- a/sycl/include/sycl/info/kernel.hpp +++ b/sycl/include/sycl/info/kernel.hpp @@ -39,18 +39,16 @@ struct attributes : kernel_traits { using return_type = std::string; }; #ifndef __INTEL_PREVIEW_BREAKING_CHANGES -struct __SYCL_DEPRECATED( - "info::kernel::function_name is not part of SYCL 2020") +struct __SYCL_DEPRECATED("info::kernel::function_name is not part of SYCL 2020") function_name : kernel_traits { using return_type = std::string; }; struct __SYCL_DEPRECATED( - "info::kernel::reference_count is not part of SYCL 2020") - reference_count : kernel_traits { + "info::kernel::reference_count is not part of SYCL 2020") reference_count + : kernel_traits { using return_type = uint32_t; }; -struct __SYCL_DEPRECATED( - "info::kernel::context is not part of SYCL 2020") +struct __SYCL_DEPRECATED("info::kernel::context is not part of SYCL 2020") context : kernel_traits { using return_type = sycl::context; }; diff --git a/sycl/source/detail/kernel_impl.cpp b/sycl/source/detail/kernel_impl.cpp index a628bb50d5929..9409704aeb902 100644 --- a/sycl/source/detail/kernel_impl.cpp +++ b/sycl/source/detail/kernel_impl.cpp @@ -11,6 +11,7 @@ #include #include +#include namespace sycl { inline namespace _V1 { @@ -117,10 +118,20 @@ bool kernel_impl::hasSYCLMetadata() const noexcept { sycl::ext::oneapi::experimental::source_language::sycl)); } -// TODO this is how kernel_impl::get_info should behave instead. std::string_view kernel_impl::getName() const { - std::call_once(MNameInitFlag, - [&]() { MName = get_info(); }); + std::call_once(MNameInitFlag, [&]() { + adapter_impl &Adapter = getAdapter(); + size_t NameSize = 0; + Adapter.call( + MKernel, UR_KERNEL_INFO_FUNCTION_NAME, 0u, nullptr, &NameSize); + if (NameSize > 0) { + std::vector NameBuf(NameSize); + Adapter.call(MKernel, + UR_KERNEL_INFO_FUNCTION_NAME, + NameSize, NameBuf.data(), nullptr); + MName = std::string(NameBuf.data()); + } + }); return MName; } @@ -139,7 +150,7 @@ bool kernel_impl::isBuiltInKernel(device_impl &Device) const { auto BuiltInKernels = Device.get_info(); if (BuiltInKernels.empty()) return false; - std::string KernelName = get_info(); + std::string_view KernelName = getName(); return (std::any_of( BuiltInKernels.begin(), BuiltInKernels.end(), [&KernelName](kernel_id &Id) { return Id.get_name() == KernelName; })); diff --git a/sycl/source/detail/kernel_impl.hpp b/sycl/source/detail/kernel_impl.hpp index c7d1d6a13bcbb..bf3a4ab6aff13 100644 --- a/sycl/source/detail/kernel_impl.hpp +++ b/sycl/source/detail/kernel_impl.hpp @@ -329,10 +329,12 @@ inline typename Param::return_type kernel_impl::get_info() const { return get_kernel_info(this->getHandleRef(), getAdapter()); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES template <> inline context kernel_impl::get_info() const { return createSyclObjFromImpl(MContext); } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES // NOTE: the global_work_size and spill_memory_size pre-query checks below are // mirrored in validateDeviceSpecificQuery (get_kernel_info_impl.cpp), which diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index c85608faa2dd1..f511f7b662703 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -2831,7 +2831,7 @@ void enqueueImpKernel( uint32_t IdQueryRangeProp = 0; if (nullptr != MSyclKernel) { - assert(MSyclKernel->get_info() == + assert(createSyclObjFromImpl(MSyclKernel->getContextImpl()) == Queue.get_context()); Kernel = MSyclKernel->getHandleRef(); Program = MSyclKernel->getProgramRef(); diff --git a/sycl/source/kernel.cpp b/sycl/source/kernel.cpp index 8abde164c6b62..2b0e67ad87c37 100644 --- a/sycl/source/kernel.cpp +++ b/sycl/source/kernel.cpp @@ -39,7 +39,7 @@ kernel::kernel(cl_kernel ClKernel, const context &SyclContext) { cl_kernel kernel::get() const { return impl->get(); } context kernel::get_context() const { - return impl->get_info(); + return detail::createSyclObjFromImpl(impl->getContextImpl()); } backend kernel::get_backend() const noexcept { return getImplBackend(impl); } From 2ef0a006a6c1c16cb1b5919420fa4dea6f2d722a Mon Sep 17 00:00:00 2001 From: Georgij Tsarin <68424751+crystarm@users.noreply.github.com> Date: Fri, 10 Jul 2026 15:10:45 +0300 Subject: [PATCH 4/4] [SYCL] Fix __INTEL_PREVIEW_BREAKING_CHANGES build and formatting for deprecated kernel info --- sycl/source/detail/kernel_impl.cpp | 6 +++--- sycl/source/kernel.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sycl/source/detail/kernel_impl.cpp b/sycl/source/detail/kernel_impl.cpp index 9409704aeb902..7340fabe35f41 100644 --- a/sycl/source/detail/kernel_impl.cpp +++ b/sycl/source/detail/kernel_impl.cpp @@ -126,9 +126,9 @@ std::string_view kernel_impl::getName() const { MKernel, UR_KERNEL_INFO_FUNCTION_NAME, 0u, nullptr, &NameSize); if (NameSize > 0) { std::vector NameBuf(NameSize); - Adapter.call(MKernel, - UR_KERNEL_INFO_FUNCTION_NAME, - NameSize, NameBuf.data(), nullptr); + Adapter.call( + MKernel, UR_KERNEL_INFO_FUNCTION_NAME, NameSize, NameBuf.data(), + nullptr); MName = std::string(NameBuf.data()); } }); diff --git a/sycl/source/kernel.cpp b/sycl/source/kernel.cpp index 2b0e67ad87c37..96a39ceaab745 100644 --- a/sycl/source/kernel.cpp +++ b/sycl/source/kernel.cpp @@ -61,9 +61,11 @@ kernel::get_info_impl() const { kernel::get_info_impl() const; __SYCL_KERNEL_INFO_INST(num_args, uint32_t) __SYCL_KERNEL_INFO_INST(attributes, std::string) +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_KERNEL_INFO_INST(function_name, std::string) __SYCL_KERNEL_INFO_INST(reference_count, uint32_t) __SYCL_KERNEL_INFO_INST(context, sycl::context) +#endif // __INTEL_PREVIEW_BREAKING_CHANGES #undef __SYCL_KERNEL_INFO_INST template