Skip to content

[SYCL] Remove the unused Spec Consts variable #16902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sycl/doc/design/KernelProgramCache.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ The kernels map's key consists of two components:
The third map, called Fast Kernel Cache, is used as an optimization to reduce the
number of lookups in the kernels map. Its key consists of the following components:

- specialization constants values,
- the UR handle of the device this kernel is built for,
- kernel name<sup>[3](#what-is-kname)</sup>.

Expand Down
13 changes: 6 additions & 7 deletions sycl/source/detail/kernel_program_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ class KernelProgramCache {
::boost::unordered_map<ur_program_handle_t, KernelByNameT>;

using KernelFastCacheKeyT =
std::tuple<SerializedObj, /* Serialized spec constants. */
ur_device_handle_t, /* UR device handle pointer */
std::string /* Kernel Name */
>;
std::pair<ur_device_handle_t, /* UR device handle pointer */
std::string /* Kernel Name */
>;

using KernelFastCacheValT =
std::tuple<ur_kernel_handle_t, /* UR kernel handle pointer. */
Expand Down Expand Up @@ -420,7 +419,7 @@ class KernelProgramCache {
std::unique_lock<std::mutex> Lock(MKernelFastCacheMutex);
auto It = MKernelFastCache.find(CacheKey);
if (It != MKernelFastCache.end()) {
traceKernel("Kernel fetched.", std::get<2>(CacheKey), true);
traceKernel("Kernel fetched.", CacheKey.second, true);
return It->second;
}
return std::make_tuple(nullptr, nullptr, nullptr, nullptr);
Expand Down Expand Up @@ -449,7 +448,7 @@ class KernelProgramCache {
std::unique_lock<std::mutex> Lock(MKernelFastCacheMutex);
// if no insertion took place, thus some other thread has already inserted
// smth in the cache
traceKernel("Kernel inserted.", std::get<2>(CacheKey), true);
traceKernel("Kernel inserted.", CacheKey.second, true);
MKernelFastCache.emplace(CacheKey, CacheVal);
}

Expand Down Expand Up @@ -504,7 +503,7 @@ class KernelProgramCache {
FastCacheKeyItr != MProgramToKernelFastCacheKeyMap.end()) {
for (const auto &FastCacheKey : FastCacheKeyItr->second) {
MKernelFastCache.erase(FastCacheKey);
traceKernel("Kernel evicted.", std::get<2>(FastCacheKey), true);
traceKernel("Kernel evicted.", FastCacheKey.second, true);
}
MProgramToKernelFastCacheKeyMap.erase(FastCacheKeyItr);
}
Expand Down
4 changes: 1 addition & 3 deletions sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,11 +1048,9 @@ ProgramManager::getOrCreateKernel(const ContextImplPtr &ContextImpl,
using KernelArgMaskPairT = KernelProgramCache::KernelArgMaskPairT;

KernelProgramCache &Cache = ContextImpl->getKernelProgramCache();
SerializedObj SpecConsts;

ur_device_handle_t UrDevice = DeviceImpl->getHandleRef();

auto key = std::make_tuple(std::move(SpecConsts), UrDevice, KernelName);
auto key = std::make_pair(UrDevice, KernelName);
if (SYCLConfig<SYCL_CACHE_IN_MEM>::get()) {
auto ret_tuple = Cache.tryToGetKernelFast(key);
constexpr size_t Kernel = 0; // see KernelFastCacheValT tuple
Expand Down