Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
17 changes: 10 additions & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# commit cd92e72bbc4ebddef63c63c0f7e66a410f4b9552
# Merge: 9a209aa5 b1222f08
# Author: Callum Fare <[email protected]>
# Date: Wed Nov 13 09:57:16 2024 +0000
# Merge pull request #2254 from PietroGhg/pietro/events_rr
# [NATIVECPU] Implement events on Native CPU
set(UNIFIED_RUNTIME_TAG cd92e72bbc4ebddef63c63c0f7e66a410f4b9552)
# commit 3e1a0ea44842b10cfdc0e1e98af2eee8fcd8e937 (HEAD -> main)
# Author: Artur Gainullin <[email protected]>
# Date: Wed Nov 6 16:05:50 2024 -0800
#
# [L0] Fix binary sizes and binaries returned by urProgramGetInfo
#
# Currently urProgramGetInfo will return UR_INVALID_PROGRAM is program is
# compiled only for a subset of associated devices, i.e. not all devices
# have level zero module and binaries. This PR fixes this behaviour.
set(UNIFIED_RUNTIME_TAG 3e1a0ea44842b10cfdc0e1e98af2eee8fcd8e937)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a newer tag, merged in: #16085 (comment). Please remove this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, removed the change.

31 changes: 12 additions & 19 deletions sycl/source/detail/kernel_bundle_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,20 +415,15 @@ class kernel_bundle_impl {

std::vector<const uint8_t *> Binaries;
std::vector<size_t> Lengths;
std::vector<std::vector<std::vector<char>>> PersistentBinaries;
for (size_t i = 0; i < Devices.size(); i++) {
std::vector<std::vector<char>> BinProg =
PersistentDeviceCodeCache::getCompiledKernelFromDisc(
Devices[i], UserArgs, SourceStr);

// exit if any device binary is missing
if (BinProg.empty()) {
return false;
}
PersistentBinaries.push_back(BinProg);

Binaries.push_back((uint8_t *)(PersistentBinaries[i][0].data()));
Lengths.push_back(PersistentBinaries[i][0].size());
std::vector<std::vector<char>> BinProgs =
PersistentDeviceCodeCache::getCompiledKernelFromDisc(Devices, UserArgs,
SourceStr);
if (BinProgs.empty()) {
return false;
}
for (auto &BinProg : BinProgs) {
Binaries.push_back((uint8_t *)(BinProg.data()));
Lengths.push_back(BinProg.size());
}

ur_program_properties_t Properties = {};
Expand Down Expand Up @@ -564,11 +559,9 @@ class kernel_bundle_impl {
// If caching enabled and kernel not fetched from cache, cache.
if (PersistentDeviceCodeCache::isEnabled() && !FetchedFromCache &&
SourceStrPtr) {
for (const auto &Device : Devices) {
PersistentDeviceCodeCache::putCompiledKernelToDisc(
Device, syclex::detail::userArgsAsString(BuildOptions),
*SourceStrPtr, UrProgram);
}
PersistentDeviceCodeCache::putCompiledKernelToDisc(
Devices, syclex::detail::userArgsAsString(BuildOptions),
*SourceStrPtr, UrProgram);
}

return std::make_shared<kernel_bundle_impl>(MContext, MDevices, DevImg,
Expand Down
Loading
Loading