@@ -220,10 +220,9 @@ class KernelProgramCache {
220
220
::boost::unordered_map<ur_program_handle_t , KernelByNameT>;
221
221
222
222
using KernelFastCacheKeyT =
223
- std::tuple<SerializedObj, /* Serialized spec constants. */
224
- ur_device_handle_t , /* UR device handle pointer */
225
- std::string /* Kernel Name */
226
- >;
223
+ std::pair<ur_device_handle_t , /* UR device handle pointer */
224
+ std::string /* Kernel Name */
225
+ >;
227
226
228
227
using KernelFastCacheValT =
229
228
std::tuple<ur_kernel_handle_t , /* UR kernel handle pointer. */
@@ -420,7 +419,7 @@ class KernelProgramCache {
420
419
std::unique_lock<std::mutex> Lock (MKernelFastCacheMutex);
421
420
auto It = MKernelFastCache.find (CacheKey);
422
421
if (It != MKernelFastCache.end ()) {
423
- traceKernel (" Kernel fetched." , std::get< 2 >( CacheKey) , true );
422
+ traceKernel (" Kernel fetched." , CacheKey. second , true );
424
423
return It->second ;
425
424
}
426
425
return std::make_tuple (nullptr , nullptr , nullptr , nullptr );
@@ -449,7 +448,7 @@ class KernelProgramCache {
449
448
std::unique_lock<std::mutex> Lock (MKernelFastCacheMutex);
450
449
// if no insertion took place, thus some other thread has already inserted
451
450
// smth in the cache
452
- traceKernel (" Kernel inserted." , std::get< 2 >( CacheKey) , true );
451
+ traceKernel (" Kernel inserted." , CacheKey. second , true );
453
452
MKernelFastCache.emplace (CacheKey, CacheVal);
454
453
}
455
454
@@ -504,7 +503,7 @@ class KernelProgramCache {
504
503
FastCacheKeyItr != MProgramToKernelFastCacheKeyMap.end ()) {
505
504
for (const auto &FastCacheKey : FastCacheKeyItr->second ) {
506
505
MKernelFastCache.erase (FastCacheKey);
507
- traceKernel (" Kernel evicted." , std::get< 2 >( FastCacheKey) , true );
506
+ traceKernel (" Kernel evicted." , FastCacheKey. second , true );
508
507
}
509
508
MProgramToKernelFastCacheKeyMap.erase (FastCacheKeyItr);
510
509
}
0 commit comments