@@ -163,10 +163,19 @@ class KernelProgramCache {
163163 ::boost::unordered_map<ur_program_handle_t , KernelByNameT>;
164164
165165 using KernelFastCacheKeyT =
166- std::tuple<SerializedObj, ur_device_handle_t , std::string, std::string>;
166+ std::tuple<SerializedObj, /* Serialized spec constants. */
167+ ur_device_handle_t , /* UR device handle pointer */
168+ std::string /* Kernel Name */
169+ >;
170+
167171 using KernelFastCacheValT =
168- std::tuple<ur_kernel_handle_t , std::mutex *, const KernelArgMask *,
169- ur_program_handle_t >;
172+ std::tuple<ur_kernel_handle_t , /* UR kernel handle pointer. */
173+ std::mutex *, /* Mutex guarding this kernel. */
174+ const KernelArgMask *, /* Eliminated kernel argument mask. */
175+ ur_program_handle_t /* UR program handle corresponding to this
176+ kernel. */
177+ >;
178+
170179 // This container is used as a fast path for retrieving cached kernels.
171180 // unordered_flat_map is used here to reduce lookup overhead.
172181 // The slow path is used only once for each newly created kernel, so the
@@ -283,7 +292,7 @@ class KernelProgramCache {
283292 std::unique_lock<std::mutex> Lock (MKernelFastCacheMutex);
284293 auto It = MKernelFastCache.find (CacheKey);
285294 if (It != MKernelFastCache.end ()) {
286- traceKernel (" Kernel fetched." , std::get<3 >(CacheKey), true );
295+ traceKernel (" Kernel fetched." , std::get<2 >(CacheKey), true );
287296 return It->second ;
288297 }
289298 return std::make_tuple (nullptr , nullptr , nullptr , nullptr );
@@ -294,7 +303,7 @@ class KernelProgramCache {
294303 std::unique_lock<std::mutex> Lock (MKernelFastCacheMutex);
295304 // if no insertion took place, thus some other thread has already inserted
296305 // smth in the cache
297- traceKernel (" Kernel inserted." , std::get<3 >(CacheKey), true );
306+ traceKernel (" Kernel inserted." , std::get<2 >(CacheKey), true );
298307 MKernelFastCache.emplace (CacheKey, CacheVal);
299308 }
300309
0 commit comments