diff --git a/sycl/source/detail/persistent_device_code_cache.cpp b/sycl/source/detail/persistent_device_code_cache.cpp index 49b7530c79dcb..83c19dbf6b75c 100644 --- a/sycl/source/detail/persistent_device_code_cache.cpp +++ b/sycl/source/detail/persistent_device_code_cache.cpp @@ -126,8 +126,7 @@ void PersistentDeviceCodeCache::putItemToDisc( */ std::vector> PersistentDeviceCodeCache::getItemFromDisc( const device &Device, const RTDeviceBinaryImage &Img, - const SerializedObj &SpecConsts, const std::string &BuildOptionsString, - RT::PiProgram &NativePrg) { + const SerializedObj &SpecConsts, const std::string &BuildOptionsString) { if (!isImageCached(Img)) return {}; diff --git a/sycl/source/detail/persistent_device_code_cache.hpp b/sycl/source/detail/persistent_device_code_cache.hpp index ed7201dab9198..d02ca5f03915e 100644 --- a/sycl/source/detail/persistent_device_code_cache.hpp +++ b/sycl/source/detail/persistent_device_code_cache.hpp @@ -174,8 +174,7 @@ class PersistentDeviceCodeCache { static std::vector> getItemFromDisc(const device &Device, const RTDeviceBinaryImage &Img, const SerializedObj &SpecConsts, - const std::string &BuildOptionsString, - RT::PiProgram &NativePrg); + const std::string &BuildOptionsString); /* Stores build program in persisten cache */ diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index 962a47d41b767..d85815789bc82 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -423,7 +423,7 @@ RT::PiProgram ProgramManager::getBuiltPIProgram(OSModuleHandle M, RT::PiProgram NativePrg; auto BinProg = PersistentDeviceCodeCache::getItemFromDisc( - Device, Img, SpecConsts, CompileOpts + LinkOpts, NativePrg); + Device, Img, SpecConsts, CompileOpts + LinkOpts); if (BinProg.size()) { // TODO: Build for multiple devices once supported by program manager NativePrg = createBinaryProgram(ContextImpl, Device, diff --git a/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp b/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp index 2bbc4e90125e6..bdcd7fa4510fd 100644 --- a/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp +++ b/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp @@ -119,7 +119,7 @@ class PersistenDeviceCodeCache : public ::testing::Test { Dev, Img, sycl::vector_class( {'S', 'p', 'e', 'c', 'C', 'o', 'n', 's', 't', ProgramID}), - BuildOptions, NativeProg); + BuildOptions); for (int i = 0; i < Res.size(); ++i) { for (int j = 0; j < Res[i].size(); ++j) { assert(Res[i][j] == i && @@ -187,8 +187,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) { NativeProg); assert(!llvm::sys::fs::remove(ItemDir + "/0.bin") && "Failed to remove binary file"); - auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Item with missed binary file was read"); llvm::sys::fs::remove_directories(ItemDir); @@ -197,8 +197,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) { NativeProg); assert(!llvm::sys::fs::remove(ItemDir + "/0.src") && "Failed to remove source file"); - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Item with missed source file was read"); llvm::sys::fs::remove_directories(ItemDir); @@ -213,8 +213,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) { FileStream << 2 << 12 << "123456789012" << 23 << "1234"; FileStream.close(); assert((!FileStream.fail()) && "Failed to create trancated binary file"); - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Item with corrupted binary file was read"); llvm::sys::fs::remove_directories(ItemDir); @@ -226,8 +226,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) { std::ofstream FileStream(ItemDir + "/0.src", std::ofstream::out | std::ofstream::trunc); } - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Item with corrupted binary file was read"); llvm::sys::fs::remove_directories(ItemDir); } @@ -256,8 +256,8 @@ TEST_F(PersistenDeviceCodeCache, LockFile) { { std::ofstream File{LockFile}; } // Cache item is locked, cache miss happens on read - auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Locked item was read"); // Cache item is locked - new cache item to be created @@ -267,14 +267,14 @@ TEST_F(PersistenDeviceCodeCache, LockFile) { // Second cache item is locked, cache miss happens on read { std::ofstream File{ItemDir + "/1.lock"}; } - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); assert(Res.size() == 0 && "Locked item was read"); // First cache item was unlocked and successfully read std::remove(LockFile.c_str()); - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); for (int i = 0; i < Res.size(); ++i) { for (int j = 0; j < Res[i].size(); ++j) { assert(Res[i][j] == i && "Corrupted image loaded from persistent cache"); @@ -305,8 +305,8 @@ TEST_F(PersistenDeviceCodeCache, AccessDeniedForCacheDir) { assert(llvm::sys::fs::exists(ItemDir + "/1.bin") && "No file created"); llvm::sys::fs::setPermissions(ItemDir + "/1.bin", llvm::sys::fs::no_perms); - auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); // No image to be read due to lack of permissions fro source file assert(Res.size() == 0); @@ -314,8 +314,8 @@ TEST_F(PersistenDeviceCodeCache, AccessDeniedForCacheDir) { llvm::sys::fs::setPermissions(ItemDir + "/0.bin", llvm::sys::fs::all_perms); llvm::sys::fs::setPermissions(ItemDir + "/1.bin", llvm::sys::fs::all_perms); - Res = detail::PersistentDeviceCodeCache::getItemFromDisc( - Dev, Img, {}, BuildOptions, NativeProg); + Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {}, + BuildOptions); // Image should be successfully read for (int i = 0; i < Res.size(); ++i) { for (int j = 0; j < Res[i].size(); ++j) {