From 1eee22b9788bed08fad61fe35426f71c11629f26 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 26 Nov 2025 10:16:37 -0800 Subject: [PATCH 1/2] [SYCL][ABI-Break] Drop device kernel info backward compatibility --- .../sycl/detail/get_device_kernel_info.hpp | 5 --- sycl/source/detail/device_kernel_info.cpp | 18 ---------- sycl/source/detail/device_kernel_info.hpp | 17 --------- sycl/source/detail/get_device_kernel_info.cpp | 6 ---- sycl/source/detail/global_handler.cpp | 17 --------- sycl/source/detail/global_handler.hpp | 3 -- sycl/source/detail/kernel_data.cpp | 24 +++---------- sycl/source/detail/kernel_data.hpp | 36 +------------------ sycl/test/abi/sycl_symbols_linux.dump | 1 - sycl/test/abi/sycl_symbols_windows.dump | 1 - 10 files changed, 5 insertions(+), 123 deletions(-) diff --git a/sycl/include/sycl/detail/get_device_kernel_info.hpp b/sycl/include/sycl/detail/get_device_kernel_info.hpp index 021f4077b9a3a..b4c47ff098f04 100644 --- a/sycl/include/sycl/detail/get_device_kernel_info.hpp +++ b/sycl/include/sycl/detail/get_device_kernel_info.hpp @@ -29,11 +29,6 @@ template DeviceKernelInfo &getDeviceKernelInfo() { return Info; } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -struct KernelNameBasedCacheT; -__SYCL_EXPORT KernelNameBasedCacheT *createKernelNameBasedCache(); -#endif - } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/device_kernel_info.cpp b/sycl/source/detail/device_kernel_info.cpp index 209a18cd7f96b..7e086225ed97b 100644 --- a/sycl/source/detail/device_kernel_info.cpp +++ b/sycl/source/detail/device_kernel_info.cpp @@ -20,22 +20,8 @@ DeviceKernelInfo::DeviceKernelInfo(const CompileTimeKernelInfoTy &Info) void DeviceKernelInfo::init(std::string_view KernelName) { auto &PM = detail::ProgramManager::getInstance(); MImplicitLocalArgPos = PM.kernelImplicitLocalArgPos(KernelName); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - MInitialized.store(true); -#endif } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -void DeviceKernelInfo::initIfEmpty(const CompileTimeKernelInfoTy &Info) { - if (MInitialized.load()) - return; - - CompileTimeKernelInfoTy::operator=(Info); - Name = Info.Name.data(); - init(Name.data()); -} -#endif - template inline constexpr bool operator==(const CompileTimeKernelInfoTy &LHS, const OtherTy &RHS) { @@ -60,11 +46,7 @@ void DeviceKernelInfo::setCompileTimeInfoIfNeeded( const CompileTimeKernelInfoTy &Info) { if (!isCompileTimeInfoSet()) CompileTimeKernelInfoTy::operator=(Info); -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - // In case of 6.3 compatibility mode the KernelSize is not passed to the - // runtime. So, it will always be 0 and this assert fails. assert(isCompileTimeInfoSet()); -#endif assert(Info == *this); } diff --git a/sycl/source/detail/device_kernel_info.hpp b/sycl/source/detail/device_kernel_info.hpp index 50f60e12be741..aecd635dc5193 100644 --- a/sycl/source/detail/device_kernel_info.hpp +++ b/sycl/source/detail/device_kernel_info.hpp @@ -89,39 +89,22 @@ struct FastKernelSubcacheT { // into this structure and get rid of the other KernelName -> * maps. class DeviceKernelInfo : public CompileTimeKernelInfoTy { public: -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - DeviceKernelInfo() = default; -#endif DeviceKernelInfo(const CompileTimeKernelInfoTy &Info); void init(std::string_view KernelName); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - // Initialize default-created entry that has no data recorded: - void initIfEmpty(const CompileTimeKernelInfoTy &Info); -#endif void setCompileTimeInfoIfNeeded(const CompileTimeKernelInfoTy &Info); FastKernelSubcacheT &getKernelSubcache() { - assertInitialized(); return MFastKernelSubcache; } std::optional getImplicitLocalArgPos() const { - assertInitialized(); return MImplicitLocalArgPos; } private: - void assertInitialized() const { -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - assert(MInitialized.load() && "Data needs to be initialized before use"); -#endif - } bool isCompileTimeInfoSet() const { return KernelSize != 0; } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - std::atomic MInitialized = false; -#endif FastKernelSubcacheT MFastKernelSubcache; std::optional MImplicitLocalArgPos; }; diff --git a/sycl/source/detail/get_device_kernel_info.cpp b/sycl/source/detail/get_device_kernel_info.cpp index 084eeeb60d714..9d4f30efeaf8a 100644 --- a/sycl/source/detail/get_device_kernel_info.cpp +++ b/sycl/source/detail/get_device_kernel_info.cpp @@ -15,12 +15,6 @@ namespace sycl { inline namespace _V1 { namespace detail { -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -KernelNameBasedCacheT *createKernelNameBasedCache() { - return GlobalHandler::instance().createKernelNameBasedCache(); -} -#endif - DeviceKernelInfo &getDeviceKernelInfo(const CompileTimeKernelInfoTy &Info) { return ProgramManager::getInstance().getOrCreateDeviceKernelInfo(Info); } diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp index 97e67523cff86..5806b9ba70d34 100644 --- a/sycl/source/detail/global_handler.cpp +++ b/sycl/source/detail/global_handler.cpp @@ -218,16 +218,6 @@ ThreadPool &GlobalHandler::getHostTaskThreadPool() { return TP; } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -KernelNameBasedCacheT *GlobalHandler::createKernelNameBasedCache() { - static std::deque &DeviceKernelInfoStorage = - getOrCreate(MDeviceKernelInfoStorage); - LockGuard LG{MDeviceKernelInfoStorage.Lock}; - return reinterpret_cast( - &DeviceKernelInfoStorage.emplace_back()); -} -#endif - void GlobalHandler::releaseDefaultContexts() { // Release shared-pointers to SYCL objects. // Note that on Windows the destruction of the default context @@ -361,13 +351,6 @@ void shutdown_late() { GlobalHandler::RTGlobalObjHandler->MScheduler.Inst.reset(nullptr); GlobalHandler::RTGlobalObjHandler->MProgramManager.Inst.reset(nullptr); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - // Kernel cache, which is part of device kernel info, - // stores handles to the adapter, so clear it before releasing adapters. - GlobalHandler::RTGlobalObjHandler->MDeviceKernelInfoStorage.Inst.reset( - nullptr); -#endif - // Clear the adapters and reset the instance if it was there. GlobalHandler::RTGlobalObjHandler->unloadAdapters(); if (GlobalHandler::RTGlobalObjHandler->MAdapters.Inst) diff --git a/sycl/source/detail/global_handler.hpp b/sycl/source/detail/global_handler.hpp index c46d90df88594..c7306d5b19519 100644 --- a/sycl/source/detail/global_handler.hpp +++ b/sycl/source/detail/global_handler.hpp @@ -75,9 +75,6 @@ class GlobalHandler { ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue); XPTIRegistry &getXPTIRegistry(); ThreadPool &getHostTaskThreadPool(); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - KernelNameBasedCacheT *createKernelNameBasedCache(); -#endif static void registerStaticVarShutdownHandler(); bool isOkToDefer() const; diff --git a/sycl/source/detail/kernel_data.cpp b/sycl/source/detail/kernel_data.cpp index 116321b7b3b8b..2fa9a964ef36f 100644 --- a/sycl/source/detail/kernel_data.cpp +++ b/sycl/source/detail/kernel_data.cpp @@ -103,15 +103,9 @@ static void addArgsForLocalAccessor(detail::LocalAccessorImplHost *LAcc, void KernelData::processArg(void *Ptr, const detail::kernel_param_kind_t &Kind, const int Size, const size_t Index, - size_t &IndexShift, bool IsKernelCreatedFromSource -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - , - bool IsESIMD -#endif -) { -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + size_t &IndexShift, + bool IsKernelCreatedFromSource) { bool IsESIMD = isESIMD(); -#endif using detail::kernel_param_kind_t; size_t GlobalSize = MNDRDesc.GlobalSize[0]; for (size_t I = 1; I < MNDRDesc.Dims; ++I) { @@ -296,12 +290,7 @@ void KernelData::extractArgsAndReqs(bool IsKernelCreatedFromSource) { const detail::kernel_param_kind_t &Kind = UnPreparedArgs[I].MType; const int &Size = UnPreparedArgs[I].MSize; const int Index = UnPreparedArgs[I].MIndex; - processArg(Ptr, Kind, Size, Index, IndexShift, IsKernelCreatedFromSource -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - , - isESIMD() -#endif - ); + processArg(Ptr, Kind, Size, Index, IndexShift, IsKernelCreatedFromSource); } } @@ -353,12 +342,7 @@ void KernelData::extractArgsAndReqsFromLambda() { } processArg(Ptr, Kind, Size, I, IndexShift, - /*IsKernelCreatedFromSource=*/false -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - , - isESIMD() -#endif - ); + /*IsKernelCreatedFromSource=*/false); } } diff --git a/sycl/source/detail/kernel_data.hpp b/sycl/source/detail/kernel_data.hpp index b0ed3db0dface..5380e76efebbd 100644 --- a/sycl/source/detail/kernel_data.hpp +++ b/sycl/source/detail/kernel_data.hpp @@ -88,15 +88,6 @@ class KernelData { return MDeviceKernelInfoPtr->ParamDescGetter; } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - // TODO: remove this method in the next ABI-breaking window - // it is used by handler code that will be removed in the next - // ABI-breaking window - void setESIMD(bool IsESIMD) { - assert(MDeviceKernelInfoPtr); - MDeviceKernelInfoPtr->IsESIMD = IsESIMD; - } -#endif bool isESIMD() const { assert(MDeviceKernelInfoPtr); return MDeviceKernelInfoPtr->IsESIMD; @@ -115,26 +106,6 @@ class KernelData { MDeviceKernelInfoPtr = Ptr; } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - void setKernelInfo(void *KernelFuncPtr, int KernelNumArgs, - KernelParamDescGetterT KernelParamDescGetter, - bool KernelIsESIMD, bool KernelHasSpecialCaptures) { - MKernelFuncPtr = KernelFuncPtr; - - assert(MDeviceKernelInfoPtr && - "MDeviceKernelInfoPtr must be set before calling setKernelInfo"); - - detail::CompileTimeKernelInfoTy Info; - Info.Name = MDeviceKernelInfoPtr->Name; - Info.NumParams = KernelNumArgs; - Info.ParamDescGetter = KernelParamDescGetter; - Info.IsESIMD = KernelIsESIMD; - Info.HasSpecialCaptures = KernelHasSpecialCaptures; - - MDeviceKernelInfoPtr->initIfEmpty(Info); - } -#endif - void setKernelFunc(void *KernelFuncPtr) { MKernelFuncPtr = KernelFuncPtr; } // Kernel launch properties getter and setters. @@ -313,12 +284,7 @@ class KernelData { void processArg(void *Ptr, const detail::kernel_param_kind_t &Kind, const int Size, const size_t Index, size_t &IndexShift, - bool IsKernelCreatedFromSource -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - , - bool IsESIMD -#endif - ); + bool IsKernelCreatedFromSource); void extractArgsAndReqs(bool IsKernelCreatedFromSource); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 6f503004eba14..4df0e60740a48 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3334,7 +3334,6 @@ _ZN4sycl3_V16detail22reduGetPreferredWGSizeERSt10shared_ptrINS1_10queue_implEEm _ZN4sycl3_V16detail22removeDuplicateDevicesERKSt6vectorINS0_6deviceESaIS3_EE _ZN4sycl3_V16detail23constructorNotificationEPvS2_NS0_6access6targetENS3_4modeERKNS1_13code_locationE _ZN4sycl3_V16detail24find_device_intersectionERKSt6vectorINS0_13kernel_bundleILNS0_12bundle_stateE1EEESaIS5_EE -_ZN4sycl3_V16detail26createKernelNameBasedCacheEv _ZN4sycl3_V16detail26isDeviceGlobalUsedInKernelEPKv _ZN4sycl3_V16detail27getPixelCoordLinearFiltModeENS0_3vecIfLi4EEENS0_15addressing_modeENS0_5rangeILi3EEERS3_ _ZN4sycl3_V16detail28SampledImageAccessorBaseHost10getAccDataEv diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index ef359906ac9c1..f921ed7a1dddd 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -3802,7 +3802,6 @@ ?contextSetExtendedDeleter@pi@detail@_V1@sycl@@YAXAEBVcontext@34@P6AXPEAX@Z1@Z ?copyCodeLoc@handler@_V1@sycl@@AEAAXAEBV123@@Z ?cpu_selector_v@_V1@sycl@@YAHAEBVdevice@12@@Z -?createKernelNameBasedCache@detail@_V1@sycl@@YAPEAUKernelNameBasedCacheT@123@XZ ?create_image@experimental@oneapi@ext@_V1@sycl@@YA?AUsampled_image_handle@12345@AEAVimage_mem@12345@AEBUbindless_image_sampler@12345@AEBUimage_descriptor@12345@AEBVdevice@45@AEBVcontext@45@@Z ?create_image@experimental@oneapi@ext@_V1@sycl@@YA?AUsampled_image_handle@12345@AEAVimage_mem@12345@AEBUbindless_image_sampler@12345@AEBUimage_descriptor@12345@AEBVqueue@45@@Z ?create_image@experimental@oneapi@ext@_V1@sycl@@YA?AUsampled_image_handle@12345@PEAX_KAEBUbindless_image_sampler@12345@AEBUimage_descriptor@12345@AEBVdevice@45@AEBVcontext@45@@Z From 47bfd1cdc73322cd08c8f3eb56c0d5f0ba640235 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 26 Nov 2025 10:23:23 -0800 Subject: [PATCH 2/2] Apply clang-format --- sycl/source/detail/device_kernel_info.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sycl/source/detail/device_kernel_info.hpp b/sycl/source/detail/device_kernel_info.hpp index aecd635dc5193..0533de2b72a55 100644 --- a/sycl/source/detail/device_kernel_info.hpp +++ b/sycl/source/detail/device_kernel_info.hpp @@ -94,9 +94,7 @@ class DeviceKernelInfo : public CompileTimeKernelInfoTy { void init(std::string_view KernelName); void setCompileTimeInfoIfNeeded(const CompileTimeKernelInfoTy &Info); - FastKernelSubcacheT &getKernelSubcache() { - return MFastKernelSubcache; - } + FastKernelSubcacheT &getKernelSubcache() { return MFastKernelSubcache; } std::optional getImplicitLocalArgPos() const { return MImplicitLocalArgPos;