Skip to content

Commit fa50f3f

Browse files
Complete the renaming
1 parent 5fc91a5 commit fa50f3f

File tree

16 files changed

+55
-61
lines changed

16 files changed

+55
-61
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ class __SYCL_EXPORT handler {
862862
constexpr std::string_view KernelNameStr =
863863
detail::getKernelName<KernelName>();
864864
MKernelName = KernelNameStr;
865-
setKernelNameBasedDataPtr(&detail::getDeviceKernelInfo<KernelName>());
865+
setDeviceKernelInfoPtr(&detail::getDeviceKernelInfo<KernelName>());
866866
} else {
867867
// In case w/o the integration header it is necessary to process
868868
// accessors from the list(which are associated with this handler) as
@@ -3688,8 +3688,7 @@ class __SYCL_EXPORT handler {
36883688
void setKernelNameBasedCachePtr(
36893689
detail::KernelNameBasedCacheT *KernelNameBasedCachePtr);
36903690
#endif
3691-
void setKernelNameBasedDataPtr(
3692-
detail::DeviceKernelInfo *KernelNameBasedDataPtr);
3691+
void setDeviceKernelInfoPtr(detail::DeviceKernelInfo *DeviceKernelInfoPtr);
36933692

36943693
queue getQueue();
36953694

sycl/source/detail/cg.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class CGExecKernel : public CG {
254254
std::shared_ptr<detail::kernel_bundle_impl> MKernelBundle;
255255
std::vector<ArgDesc> MArgs;
256256
KernelNameStrT MKernelName;
257-
DeviceKernelInfo &MKernelNameBasedData;
257+
DeviceKernelInfo &MDeviceKernelInfo;
258258
std::vector<std::shared_ptr<detail::stream_impl>> MStreams;
259259
std::vector<std::shared_ptr<const void>> MAuxiliaryResources;
260260
/// Used to implement ext_oneapi_graph dynamic_command_group. Stores the list
@@ -269,8 +269,7 @@ class CGExecKernel : public CG {
269269
std::shared_ptr<detail::kernel_impl> SyclKernel,
270270
std::shared_ptr<detail::kernel_bundle_impl> KernelBundle,
271271
CG::StorageInitHelper CGData, std::vector<ArgDesc> Args,
272-
KernelNameStrT KernelName,
273-
DeviceKernelInfo &DeviceKernelInfo,
272+
KernelNameStrT KernelName, DeviceKernelInfo &DeviceKernelInfo,
274273
std::vector<std::shared_ptr<detail::stream_impl>> Streams,
275274
std::vector<std::shared_ptr<const void>> AuxiliaryResources,
276275
CGType Type, ur_kernel_cache_config_t KernelCacheConfig,
@@ -279,8 +278,8 @@ class CGExecKernel : public CG {
279278
: CG(Type, std::move(CGData), std::move(loc)), MNDRDesc(NDRDesc),
280279
MHostKernel(std::move(HKernel)), MSyclKernel(std::move(SyclKernel)),
281280
MKernelBundle(std::move(KernelBundle)), MArgs(std::move(Args)),
282-
MKernelName(std::move(KernelName)),
283-
MKernelNameBasedData(DeviceKernelInfo), MStreams(std::move(Streams)),
281+
MKernelName(std::move(KernelName)), MDeviceKernelInfo(DeviceKernelInfo),
282+
MStreams(std::move(Streams)),
284283
MAuxiliaryResources(std::move(AuxiliaryResources)),
285284
MAlternativeKernels{}, MKernelCacheConfig(std::move(KernelCacheConfig)),
286285
MKernelIsCooperative(KernelIsCooperative),

sycl/source/detail/global_handler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ ThreadPool &GlobalHandler::getHostTaskThreadPool() {
251251

252252
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
253253
KernelNameBasedCacheT *GlobalHandler::createKernelNameBasedCache() {
254-
static std::deque<DeviceKernelInfo> &KernelNameBasedDataStorage =
255-
getOrCreate(MKernelNameBasedDataStorage);
256-
LockGuard LG{MKernelNameBasedDataStorage.Lock};
254+
static std::deque<DeviceKernelInfo> &DeviceKernelInfoStorage =
255+
getOrCreate(MDeviceKernelInfoStorage);
256+
LockGuard LG{MDeviceKernelInfoStorage.Lock};
257257
return reinterpret_cast<KernelNameBasedCacheT *>(
258-
&KernelNameBasedDataStorage.emplace_back());
258+
&DeviceKernelInfoStorage.emplace_back());
259259
}
260260
#endif
261261

@@ -394,9 +394,9 @@ void shutdown_late() {
394394
Handler->MProgramManager.Inst.reset(nullptr);
395395

396396
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
397-
// Kernel cache, which is part of kernel name based data,
397+
// Kernel cache, which is part of device kernel info,
398398
// stores handles to the adapter, so clear it before releasing adapters.
399-
Handler->MKernelNameBasedDataStorage.Inst.reset(nullptr);
399+
Handler->MDeviceKernelInfoStorage.Inst.reset(nullptr);
400400
#endif
401401

402402
// Clear the adapters and reset the instance if it was there.

sycl/source/detail/global_handler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class GlobalHandler {
138138
// Thread pool for host task and event callbacks execution
139139
InstWithLock<ThreadPool> MHostTaskThreadPool;
140140
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
141-
InstWithLock<std::deque<DeviceKernelInfo>> MKernelNameBasedDataStorage;
141+
InstWithLock<std::deque<DeviceKernelInfo>> MDeviceKernelInfoStorage;
142142
#endif
143143
};
144144
} // namespace detail

sycl/source/detail/graph/graph_impl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ ur_exp_command_buffer_sync_point_t exec_graph_impl::enqueueNodeDirect(
741741
CGExec->MLine, CGExec->MColumn);
742742
std::tie(CmdTraceEvent, InstanceID) = emitKernelInstrumentationData(
743743
StreamID, CGExec->MSyclKernel, CodeLoc, CGExec->MIsTopCodeLoc,
744-
CGExec->MKernelName.data(), CGExec->MKernelNameBasedData, nullptr,
744+
CGExec->MKernelName.data(), CGExec->MDeviceKernelInfo, nullptr,
745745
CGExec->MNDRDesc, CGExec->MKernelBundle.get(), CGExec->MArgs);
746746
if (CmdTraceEvent)
747747
sycl::detail::emitInstrumentationGeneral(
@@ -1574,8 +1574,7 @@ void exec_graph_impl::populateURKernelUpdateStructs(
15741574
EliminatedArgMask = SyclKernelImpl->getKernelArgMask();
15751575
} else {
15761576
BundleObjs = sycl::detail::ProgramManager::getInstance().getOrCreateKernel(
1577-
ContextImpl, DeviceImpl, ExecCG.MKernelName,
1578-
ExecCG.MKernelNameBasedData);
1577+
ContextImpl, DeviceImpl, ExecCG.MKernelName, ExecCG.MDeviceKernelInfo);
15791578
UrKernel = BundleObjs->MKernelHandle;
15801579
EliminatedArgMask = BundleObjs->MKernelArgMask;
15811580
}

sycl/source/detail/handler_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ class handler_impl {
243243
bool MKernelIsESIMD = false;
244244
bool MKernelHasSpecialCaptures = true;
245245

246-
// A pointer to kernel name based data. Cached on the application side in
246+
// A pointer to device kernel information. Cached on the application side in
247247
// headers or retrieved from program manager.
248-
DeviceKernelInfo *MKernelNameBasedDataPtr = nullptr;
248+
DeviceKernelInfo *MDeviceKernelInfoPtr = nullptr;
249249
};
250250

251251
} // namespace detail

sycl/source/detail/kernel_name_based_data.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ struct FastKernelSubcacheT {
8080
FastKernelSubcacheMutexT Mutex;
8181
};
8282

83-
// This class is used for aggregating kernel name based information.
84-
// Pointers to instances of this class are stored in header function templates
85-
// as a static variable to avoid repeated runtime lookup overhead.
83+
// This class aggregates information specific to device kernels (i.e.
84+
// information that is uniform between different submissions of the same
85+
// kernel). Pointers to instances of this class are stored in header function
86+
// templates as a static variable to avoid repeated runtime lookup overhead.
8687
// TODO Currently this class duplicates information fetched from the program
87-
// manager. Instead, we should merge all of the kernel name based information
88+
// manager. Instead, we should merge all of this information
8889
// into this structure and get rid of the other KernelName -> * maps.
8990
class DeviceKernelInfo : public CompileTimeKernelInfoTy {
9091
public:

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ ProgramManager::kernelImplicitLocalArgPos(KernelNameStrRefT KernelName) const {
18231823
DeviceKernelInfo &
18241824
ProgramManager::getOrCreateDeviceKernelInfo(const CompileTimeKernelInfoTy &Info) {
18251825
auto Result =
1826-
m_KernelNameBasedDataMap.try_emplace(KernelNameStrT{Info.Name}, Info);
1826+
m_DeviceKernelInfoMap.try_emplace(KernelNameStrT{Info.Name}, Info);
18271827
return Result.first->second;
18281828
}
18291829

@@ -2234,7 +2234,7 @@ void ProgramManager::removeImages(sycl_device_binaries DeviceBinary) {
22342234
// share lifetime.
22352235
m_KernelUsesAssert.erase(Name);
22362236
m_KernelImplicitLocalArgPos.erase(Name);
2237-
m_KernelNameBasedDataMap.erase(Name);
2237+
m_DeviceKernelInfoMap.erase(Name);
22382238
m_KernelNameRefCount.erase(RefCountIt);
22392239
if (Name2IDIt != m_KernelName2KernelIDs.end())
22402240
m_KernelName2KernelIDs.erase(Name2IDIt);

sycl/source/detail/program_manager/program_manager.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ class ProgramManager {
459459

460460
/// Keeps track of binary image to kernel name reference count.
461461
/// Used for checking if the last image referencing the kernel name
462-
/// is removed in order to trigger cleanup of kernel name based information.
462+
/// is removed in order to trigger cleanup of kernel specific information.
463463
/// Access must be guarded by the m_KernelIDsMutex mutex.
464464
std::unordered_map<KernelNameStrT, int> m_KernelNameRefCount;
465465

@@ -539,10 +539,9 @@ class ProgramManager {
539539
KernelUsesAssertSet m_KernelUsesAssert;
540540
std::unordered_map<KernelNameStrT, int> m_KernelImplicitLocalArgPos;
541541

542-
// Map for storing kernel name based data. Runtime lookup should be avoided
542+
// Map for storing device kernel information. Runtime lookup should be avoided
543543
// by caching the pointers when possible.
544-
std::unordered_map<KernelNameStrT, DeviceKernelInfo>
545-
m_KernelNameBasedDataMap;
544+
std::unordered_map<KernelNameStrT, DeviceKernelInfo> m_DeviceKernelInfoMap;
546545

547546
// Sanitizer type used in device image
548547
SanitizerType m_SanitizerFoundInImage;

sycl/source/detail/queue_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
871871
// Kernel only uses assert if it's non interop one
872872
KernelUsesAssert =
873873
(!Handler.MKernel || Handler.MKernel->hasSYCLMetadata()) &&
874-
Handler.impl->MKernelNameBasedDataPtr->usesAssert();
874+
Handler.impl->MDeviceKernelInfoPtr->usesAssert();
875875

876876
auto &PostProcess = *PostProcessorFunc;
877877
PostProcess(IsKernel, KernelUsesAssert, Event);

0 commit comments

Comments
 (0)