File tree Expand file tree Collapse file tree 6 files changed +25
-21
lines changed Expand file tree Collapse file tree 6 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -283,16 +283,16 @@ inline namespace compile_time_kernel_info_v1 {
283283// at least for as long as we support user apps built with GNU libstdc++'s
284284// pre-C++11 ABI.
285285struct CompileTimeKernelInfoTy {
286- const char *Name = nullptr ;
287- unsigned NumParams = 0 ;
288- bool IsESIMD = false ;
289- const char *FileName = " " ;
290- const char *FunctionName = " " ;
291- unsigned LineNumber = 0 ;
292- unsigned ColumnNumber = 0 ;
293- int64_t KernelSize;
294- kernel_param_desc_t (*ParamDescGetter)(int ) = nullptr ;
295- bool HasSpecialCaptures = false ;
286+ const char * const Name = nullptr ;
287+ const unsigned NumParams = 0 ;
288+ const bool IsESIMD = false ;
289+ const char * const FileName = " " ;
290+ const char *const FunctionName = " " ;
291+ const unsigned LineNumber = 0 ;
292+ const unsigned ColumnNumber = 0 ;
293+ const int64_t KernelSize = 0 ;
294+ kernel_param_desc_t (*const ParamDescGetter)(int ) = nullptr ;
295+ const bool HasSpecialCaptures = false ;
296296};
297297
298298template <class Kernel >
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ KernelNameBasedCacheT *createKernelNameBasedCache() {
2222#endif
2323
2424DeviceKernelInfo &getDeviceKernelInfo (const CompileTimeKernelInfoTy &Info) {
25- return ProgramManager::getInstance ().getOrCreateDeviceKernelInfo (Info. Name );
25+ return ProgramManager::getInstance ().getOrCreateDeviceKernelInfo (Info);
2626}
2727
2828} // namespace detail
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ namespace sycl {
1212inline namespace _V1 {
1313namespace detail {
1414
15- DeviceKernelInfo::DeviceKernelInfo (KernelNameStrRefT KernelName) {
16- init (KernelName);
15+ DeviceKernelInfo::DeviceKernelInfo (const CompileTimeKernelInfoTy &Info)
16+ : CompileTimeKernelInfoTy(Info) {
17+ init (Name);
1718}
1819
1920void DeviceKernelInfo::init (KernelNameStrRefT KernelName) {
@@ -53,4 +54,4 @@ void DeviceKernelInfo::assertInitialized() {
5354
5455} // namespace detail
5556} // namespace _V1
56- } // namespace sycl
57+ } // namespace sycl
Original file line number Diff line number Diff line change 1010#include < detail/hashers.hpp>
1111#include < detail/kernel_arg_mask.hpp>
1212#include < emhash/hash_table8.hpp>
13+ #include < sycl/detail/kernel_desc.hpp>
1314#include < sycl/detail/kernel_name_str_t.hpp>
1415#include < sycl/detail/spinlock.hpp>
1516#include < sycl/detail/ur.hpp>
@@ -85,12 +86,12 @@ struct FastKernelSubcacheT {
8586// TODO Currently this class duplicates information fetched from the program
8687// manager. Instead, we should merge all of the kernel name based information
8788// into this structure and get rid of the other KernelName -> * maps.
88- class DeviceKernelInfo {
89+ class DeviceKernelInfo : public CompileTimeKernelInfoTy {
8990public:
9091#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
9192 DeviceKernelInfo () = default;
9293#endif
93- DeviceKernelInfo (KernelNameStrRefT KernelName );
94+ DeviceKernelInfo (const CompileTimeKernelInfoTy &Info );
9495
9596 void init (KernelNameStrRefT KernelName);
9697#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
Original file line number Diff line number Diff line change @@ -1821,8 +1821,9 @@ ProgramManager::kernelImplicitLocalArgPos(KernelNameStrRefT KernelName) const {
18211821}
18221822
18231823DeviceKernelInfo &
1824- ProgramManager::getOrCreateDeviceKernelInfo (KernelNameStrRefT KernelName) {
1825- auto Result = m_KernelNameBasedDataMap.try_emplace (KernelName, KernelName);
1824+ ProgramManager::getOrCreateDeviceKernelInfo (const CompileTimeKernelInfoTy &Info) {
1825+ auto Result =
1826+ m_KernelNameBasedDataMap.try_emplace (KernelNameStrT{Info.Name }, Info);
18261827 return Result.first ->second ;
18271828}
18281829
Original file line number Diff line number Diff line change @@ -376,10 +376,11 @@ class ProgramManager {
376376 std::optional<int >
377377 kernelImplicitLocalArgPos (KernelNameStrRefT KernelName) const ;
378378
379- DeviceKernelInfo &getOrCreateDeviceKernelInfo (KernelNameStrRefT KernelName);
380379 DeviceKernelInfo &
381- getOrCreateDeviceKernelInfo (const CompileTimeKernelInfoTy &Info) {
382- return getOrCreateDeviceKernelInfo (Info.Name );
380+ getOrCreateDeviceKernelInfo (const CompileTimeKernelInfoTy &Info);
381+ DeviceKernelInfo &getOrCreateDeviceKernelInfo (KernelNameStrRefT KernelName) {
382+ return getOrCreateDeviceKernelInfo (
383+ CompileTimeKernelInfoTy{KernelName.data ()});
383384 }
384385
385386 std::set<const RTDeviceBinaryImage *>
You can’t perform that action at this time.
0 commit comments