Skip to content

Commit d2117df

Browse files
[SYCL][ABI-Break] Drop device kernel info backward compatibility (#20765)
1 parent 3b227b1 commit d2117df

File tree

10 files changed

+6
-126
lines changed

10 files changed

+6
-126
lines changed

sycl/include/sycl/detail/get_device_kernel_info.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ template <class Kernel> DeviceKernelInfo &getDeviceKernelInfo() {
2929
return Info;
3030
}
3131

32-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
33-
struct KernelNameBasedCacheT;
34-
__SYCL_EXPORT KernelNameBasedCacheT *createKernelNameBasedCache();
35-
#endif
36-
3732
} // namespace detail
3833
} // namespace _V1
3934
} // namespace sycl

sycl/source/detail/device_kernel_info.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,8 @@ DeviceKernelInfo::DeviceKernelInfo(const CompileTimeKernelInfoTy &Info)
2020
void DeviceKernelInfo::init(std::string_view KernelName) {
2121
auto &PM = detail::ProgramManager::getInstance();
2222
MImplicitLocalArgPos = PM.kernelImplicitLocalArgPos(KernelName);
23-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
24-
MInitialized.store(true);
25-
#endif
2623
}
2724

28-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
29-
void DeviceKernelInfo::initIfEmpty(const CompileTimeKernelInfoTy &Info) {
30-
if (MInitialized.load())
31-
return;
32-
33-
CompileTimeKernelInfoTy::operator=(Info);
34-
Name = Info.Name.data();
35-
init(Name.data());
36-
}
37-
#endif
38-
3925
template <typename OtherTy>
4026
inline constexpr bool operator==(const CompileTimeKernelInfoTy &LHS,
4127
const OtherTy &RHS) {
@@ -60,11 +46,7 @@ void DeviceKernelInfo::setCompileTimeInfoIfNeeded(
6046
const CompileTimeKernelInfoTy &Info) {
6147
if (!isCompileTimeInfoSet())
6248
CompileTimeKernelInfoTy::operator=(Info);
63-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
64-
// In case of 6.3 compatibility mode the KernelSize is not passed to the
65-
// runtime. So, it will always be 0 and this assert fails.
6649
assert(isCompileTimeInfoSet());
67-
#endif
6850
assert(Info == *this);
6951
}
7052

sycl/source/detail/device_kernel_info.hpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,39 +89,20 @@ struct FastKernelSubcacheT {
8989
// into this structure and get rid of the other KernelName -> * maps.
9090
class DeviceKernelInfo : public CompileTimeKernelInfoTy {
9191
public:
92-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
93-
DeviceKernelInfo() = default;
94-
#endif
9592
DeviceKernelInfo(const CompileTimeKernelInfoTy &Info);
9693

9794
void init(std::string_view KernelName);
98-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
99-
// Initialize default-created entry that has no data recorded:
100-
void initIfEmpty(const CompileTimeKernelInfoTy &Info);
101-
#endif
10295
void setCompileTimeInfoIfNeeded(const CompileTimeKernelInfoTy &Info);
10396

104-
FastKernelSubcacheT &getKernelSubcache() {
105-
assertInitialized();
106-
return MFastKernelSubcache;
107-
}
97+
FastKernelSubcacheT &getKernelSubcache() { return MFastKernelSubcache; }
10898

10999
std::optional<int> getImplicitLocalArgPos() const {
110-
assertInitialized();
111100
return MImplicitLocalArgPos;
112101
}
113102

114103
private:
115-
void assertInitialized() const {
116-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
117-
assert(MInitialized.load() && "Data needs to be initialized before use");
118-
#endif
119-
}
120104
bool isCompileTimeInfoSet() const { return KernelSize != 0; }
121105

122-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
123-
std::atomic<bool> MInitialized = false;
124-
#endif
125106
FastKernelSubcacheT MFastKernelSubcache;
126107
std::optional<int> MImplicitLocalArgPos;
127108
};

sycl/source/detail/get_device_kernel_info.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ namespace sycl {
1515
inline namespace _V1 {
1616
namespace detail {
1717

18-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
19-
KernelNameBasedCacheT *createKernelNameBasedCache() {
20-
return GlobalHandler::instance().createKernelNameBasedCache();
21-
}
22-
#endif
23-
2418
DeviceKernelInfo &getDeviceKernelInfo(const CompileTimeKernelInfoTy &Info) {
2519
return ProgramManager::getInstance().getOrCreateDeviceKernelInfo(Info);
2620
}

sycl/source/detail/global_handler.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,6 @@ ThreadPool &GlobalHandler::getHostTaskThreadPool() {
218218
return TP;
219219
}
220220

221-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
222-
KernelNameBasedCacheT *GlobalHandler::createKernelNameBasedCache() {
223-
static std::deque<DeviceKernelInfo> &DeviceKernelInfoStorage =
224-
getOrCreate(MDeviceKernelInfoStorage);
225-
LockGuard LG{MDeviceKernelInfoStorage.Lock};
226-
return reinterpret_cast<KernelNameBasedCacheT *>(
227-
&DeviceKernelInfoStorage.emplace_back());
228-
}
229-
#endif
230-
231221
void GlobalHandler::releaseDefaultContexts() {
232222
// Release shared-pointers to SYCL objects.
233223
// Note that on Windows the destruction of the default context
@@ -361,13 +351,6 @@ void shutdown_late() {
361351
GlobalHandler::RTGlobalObjHandler->MScheduler.Inst.reset(nullptr);
362352
GlobalHandler::RTGlobalObjHandler->MProgramManager.Inst.reset(nullptr);
363353

364-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
365-
// Kernel cache, which is part of device kernel info,
366-
// stores handles to the adapter, so clear it before releasing adapters.
367-
GlobalHandler::RTGlobalObjHandler->MDeviceKernelInfoStorage.Inst.reset(
368-
nullptr);
369-
#endif
370-
371354
// Clear the adapters and reset the instance if it was there.
372355
GlobalHandler::RTGlobalObjHandler->unloadAdapters();
373356
if (GlobalHandler::RTGlobalObjHandler->MAdapters.Inst)

sycl/source/detail/global_handler.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ class GlobalHandler {
7575
ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue);
7676
XPTIRegistry &getXPTIRegistry();
7777
ThreadPool &getHostTaskThreadPool();
78-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
79-
KernelNameBasedCacheT *createKernelNameBasedCache();
80-
#endif
8178
static void registerStaticVarShutdownHandler();
8279

8380
bool isOkToDefer() const;

sycl/source/detail/kernel_data.cpp

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,9 @@ static void addArgsForLocalAccessor(detail::LocalAccessorImplHost *LAcc,
103103

104104
void KernelData::processArg(void *Ptr, const detail::kernel_param_kind_t &Kind,
105105
const int Size, const size_t Index,
106-
size_t &IndexShift, bool IsKernelCreatedFromSource
107-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
108-
,
109-
bool IsESIMD
110-
#endif
111-
) {
112-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
106+
size_t &IndexShift,
107+
bool IsKernelCreatedFromSource) {
113108
bool IsESIMD = isESIMD();
114-
#endif
115109
using detail::kernel_param_kind_t;
116110
size_t GlobalSize = MNDRDesc.GlobalSize[0];
117111
for (size_t I = 1; I < MNDRDesc.Dims; ++I) {
@@ -296,12 +290,7 @@ void KernelData::extractArgsAndReqs(bool IsKernelCreatedFromSource) {
296290
const detail::kernel_param_kind_t &Kind = UnPreparedArgs[I].MType;
297291
const int &Size = UnPreparedArgs[I].MSize;
298292
const int Index = UnPreparedArgs[I].MIndex;
299-
processArg(Ptr, Kind, Size, Index, IndexShift, IsKernelCreatedFromSource
300-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
301-
,
302-
isESIMD()
303-
#endif
304-
);
293+
processArg(Ptr, Kind, Size, Index, IndexShift, IsKernelCreatedFromSource);
305294
}
306295
}
307296

@@ -353,12 +342,7 @@ void KernelData::extractArgsAndReqsFromLambda() {
353342
}
354343

355344
processArg(Ptr, Kind, Size, I, IndexShift,
356-
/*IsKernelCreatedFromSource=*/false
357-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
358-
,
359-
isESIMD()
360-
#endif
361-
);
345+
/*IsKernelCreatedFromSource=*/false);
362346
}
363347
}
364348

sycl/source/detail/kernel_data.hpp

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ class KernelData {
8888
return MDeviceKernelInfoPtr->ParamDescGetter;
8989
}
9090

91-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
92-
// TODO: remove this method in the next ABI-breaking window
93-
// it is used by handler code that will be removed in the next
94-
// ABI-breaking window
95-
void setESIMD(bool IsESIMD) {
96-
assert(MDeviceKernelInfoPtr);
97-
MDeviceKernelInfoPtr->IsESIMD = IsESIMD;
98-
}
99-
#endif
10091
bool isESIMD() const {
10192
assert(MDeviceKernelInfoPtr);
10293
return MDeviceKernelInfoPtr->IsESIMD;
@@ -115,26 +106,6 @@ class KernelData {
115106
MDeviceKernelInfoPtr = Ptr;
116107
}
117108

118-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
119-
void setKernelInfo(void *KernelFuncPtr, int KernelNumArgs,
120-
KernelParamDescGetterT KernelParamDescGetter,
121-
bool KernelIsESIMD, bool KernelHasSpecialCaptures) {
122-
MKernelFuncPtr = KernelFuncPtr;
123-
124-
assert(MDeviceKernelInfoPtr &&
125-
"MDeviceKernelInfoPtr must be set before calling setKernelInfo");
126-
127-
detail::CompileTimeKernelInfoTy Info;
128-
Info.Name = MDeviceKernelInfoPtr->Name;
129-
Info.NumParams = KernelNumArgs;
130-
Info.ParamDescGetter = KernelParamDescGetter;
131-
Info.IsESIMD = KernelIsESIMD;
132-
Info.HasSpecialCaptures = KernelHasSpecialCaptures;
133-
134-
MDeviceKernelInfoPtr->initIfEmpty(Info);
135-
}
136-
#endif
137-
138109
void setKernelFunc(void *KernelFuncPtr) { MKernelFuncPtr = KernelFuncPtr; }
139110

140111
// Kernel launch properties getter and setters.
@@ -313,12 +284,7 @@ class KernelData {
313284

314285
void processArg(void *Ptr, const detail::kernel_param_kind_t &Kind,
315286
const int Size, const size_t Index, size_t &IndexShift,
316-
bool IsKernelCreatedFromSource
317-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
318-
,
319-
bool IsESIMD
320-
#endif
321-
);
287+
bool IsKernelCreatedFromSource);
322288

323289
void extractArgsAndReqs(bool IsKernelCreatedFromSource);
324290

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3334,7 +3334,6 @@ _ZN4sycl3_V16detail22reduGetPreferredWGSizeERSt10shared_ptrINS1_10queue_implEEm
33343334
_ZN4sycl3_V16detail22removeDuplicateDevicesERKSt6vectorINS0_6deviceESaIS3_EE
33353335
_ZN4sycl3_V16detail23constructorNotificationEPvS2_NS0_6access6targetENS3_4modeERKNS1_13code_locationE
33363336
_ZN4sycl3_V16detail24find_device_intersectionERKSt6vectorINS0_13kernel_bundleILNS0_12bundle_stateE1EEESaIS5_EE
3337-
_ZN4sycl3_V16detail26createKernelNameBasedCacheEv
33383337
_ZN4sycl3_V16detail26isDeviceGlobalUsedInKernelEPKv
33393338
_ZN4sycl3_V16detail27getPixelCoordLinearFiltModeENS0_3vecIfLi4EEENS0_15addressing_modeENS0_5rangeILi3EEERS3_
33403339
_ZN4sycl3_V16detail28SampledImageAccessorBaseHost10getAccDataEv

sycl/test/abi/sycl_symbols_windows.dump

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3802,7 +3802,6 @@
38023802
?contextSetExtendedDeleter@pi@detail@_V1@sycl@@YAXAEBVcontext@34@P6AXPEAX@Z1@Z
38033803
?copyCodeLoc@handler@_V1@sycl@@AEAAXAEBV123@@Z
38043804
?cpu_selector_v@_V1@sycl@@YAHAEBVdevice@12@@Z
3805-
?createKernelNameBasedCache@detail@_V1@sycl@@YAPEAUKernelNameBasedCacheT@123@XZ
38063805
?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
38073806
?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
38083807
?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

0 commit comments

Comments
 (0)