Skip to content

Commit 4e030a1

Browse files
authored
[SYCL][NFC] Fix post-commit failure (#3532)
Fixed post-commit regression introduced by ec97165.
1 parent 3c5198d commit 4e030a1

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

sycl/source/detail/persistent_device_code_cache.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ void PersistentDeviceCodeCache::putItemToDisc(
126126
*/
127127
std::vector<std::vector<char>> PersistentDeviceCodeCache::getItemFromDisc(
128128
const device &Device, const RTDeviceBinaryImage &Img,
129-
const SerializedObj &SpecConsts, const std::string &BuildOptionsString,
130-
RT::PiProgram &NativePrg) {
129+
const SerializedObj &SpecConsts, const std::string &BuildOptionsString) {
131130

132131
if (!isImageCached(Img))
133132
return {};

sycl/source/detail/persistent_device_code_cache.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ class PersistentDeviceCodeCache {
174174
static std::vector<std::vector<char>>
175175
getItemFromDisc(const device &Device, const RTDeviceBinaryImage &Img,
176176
const SerializedObj &SpecConsts,
177-
const std::string &BuildOptionsString,
178-
RT::PiProgram &NativePrg);
177+
const std::string &BuildOptionsString);
179178

180179
/* Stores build program in persisten cache
181180
*/

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ RT::PiProgram ProgramManager::getBuiltPIProgram(OSModuleHandle M,
423423
RT::PiProgram NativePrg;
424424

425425
auto BinProg = PersistentDeviceCodeCache::getItemFromDisc(
426-
Device, Img, SpecConsts, CompileOpts + LinkOpts, NativePrg);
426+
Device, Img, SpecConsts, CompileOpts + LinkOpts);
427427
if (BinProg.size()) {
428428
// TODO: Build for multiple devices once supported by program manager
429429
NativePrg = createBinaryProgram(ContextImpl, Device,

sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class PersistenDeviceCodeCache : public ::testing::Test {
119119
Dev, Img,
120120
sycl::vector_class<unsigned char>(
121121
{'S', 'p', 'e', 'c', 'C', 'o', 'n', 's', 't', ProgramID}),
122-
BuildOptions, NativeProg);
122+
BuildOptions);
123123
for (int i = 0; i < Res.size(); ++i) {
124124
for (int j = 0; j < Res[i].size(); ++j) {
125125
assert(Res[i][j] == i &&
@@ -187,8 +187,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) {
187187
NativeProg);
188188
assert(!llvm::sys::fs::remove(ItemDir + "/0.bin") &&
189189
"Failed to remove binary file");
190-
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
191-
Dev, Img, {}, BuildOptions, NativeProg);
190+
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
191+
BuildOptions);
192192
assert(Res.size() == 0 && "Item with missed binary file was read");
193193
llvm::sys::fs::remove_directories(ItemDir);
194194

@@ -197,8 +197,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) {
197197
NativeProg);
198198
assert(!llvm::sys::fs::remove(ItemDir + "/0.src") &&
199199
"Failed to remove source file");
200-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
201-
Dev, Img, {}, BuildOptions, NativeProg);
200+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
201+
BuildOptions);
202202
assert(Res.size() == 0 && "Item with missed source file was read");
203203
llvm::sys::fs::remove_directories(ItemDir);
204204

@@ -213,8 +213,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) {
213213
FileStream << 2 << 12 << "123456789012" << 23 << "1234";
214214
FileStream.close();
215215
assert((!FileStream.fail()) && "Failed to create trancated binary file");
216-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
217-
Dev, Img, {}, BuildOptions, NativeProg);
216+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
217+
BuildOptions);
218218
assert(Res.size() == 0 && "Item with corrupted binary file was read");
219219

220220
llvm::sys::fs::remove_directories(ItemDir);
@@ -226,8 +226,8 @@ TEST_F(PersistenDeviceCodeCache, CorruptedCacheFiles) {
226226
std::ofstream FileStream(ItemDir + "/0.src",
227227
std::ofstream::out | std::ofstream::trunc);
228228
}
229-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
230-
Dev, Img, {}, BuildOptions, NativeProg);
229+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
230+
BuildOptions);
231231
assert(Res.size() == 0 && "Item with corrupted binary file was read");
232232
llvm::sys::fs::remove_directories(ItemDir);
233233
}
@@ -256,8 +256,8 @@ TEST_F(PersistenDeviceCodeCache, LockFile) {
256256
{ std::ofstream File{LockFile}; }
257257

258258
// Cache item is locked, cache miss happens on read
259-
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
260-
Dev, Img, {}, BuildOptions, NativeProg);
259+
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
260+
BuildOptions);
261261
assert(Res.size() == 0 && "Locked item was read");
262262

263263
// Cache item is locked - new cache item to be created
@@ -267,14 +267,14 @@ TEST_F(PersistenDeviceCodeCache, LockFile) {
267267

268268
// Second cache item is locked, cache miss happens on read
269269
{ std::ofstream File{ItemDir + "/1.lock"}; }
270-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
271-
Dev, Img, {}, BuildOptions, NativeProg);
270+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
271+
BuildOptions);
272272
assert(Res.size() == 0 && "Locked item was read");
273273

274274
// First cache item was unlocked and successfully read
275275
std::remove(LockFile.c_str());
276-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
277-
Dev, Img, {}, BuildOptions, NativeProg);
276+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
277+
BuildOptions);
278278
for (int i = 0; i < Res.size(); ++i) {
279279
for (int j = 0; j < Res[i].size(); ++j) {
280280
assert(Res[i][j] == i && "Corrupted image loaded from persistent cache");
@@ -305,17 +305,17 @@ TEST_F(PersistenDeviceCodeCache, AccessDeniedForCacheDir) {
305305
assert(llvm::sys::fs::exists(ItemDir + "/1.bin") && "No file created");
306306

307307
llvm::sys::fs::setPermissions(ItemDir + "/1.bin", llvm::sys::fs::no_perms);
308-
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
309-
Dev, Img, {}, BuildOptions, NativeProg);
308+
auto Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
309+
BuildOptions);
310310

311311
// No image to be read due to lack of permissions fro source file
312312
assert(Res.size() == 0);
313313

314314
llvm::sys::fs::setPermissions(ItemDir + "/0.bin", llvm::sys::fs::all_perms);
315315
llvm::sys::fs::setPermissions(ItemDir + "/1.bin", llvm::sys::fs::all_perms);
316316

317-
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(
318-
Dev, Img, {}, BuildOptions, NativeProg);
317+
Res = detail::PersistentDeviceCodeCache::getItemFromDisc(Dev, Img, {},
318+
BuildOptions);
319319
// Image should be successfully read
320320
for (int i = 0; i < Res.size(); ++i) {
321321
for (int j = 0; j < Res[i].size(); ++j) {

0 commit comments

Comments
 (0)