Skip to content

Commit 3f1ab43

Browse files
committed
Fix CI issues
1 parent 95f4e99 commit 3f1ab43

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ RT::PiProgram ProgramManager::createPIProgram(const RTDeviceBinaryImage &Img,
357357
}
358358

359359
std::string getDeviceString(const device &Device) {
360-
return {Device.get_platform().get_info<sycl::info::platform::name>() +"/"+
361-
Device.get_info<sycl::info::device::name>() + "/"+
362-
Device.get_info<sycl::info::device::version>() + "/"+
360+
return {Device.get_platform().get_info<sycl::info::platform::name>() + "/" +
361+
Device.get_info<sycl::info::device::name>() + "/" +
362+
Device.get_info<sycl::info::device::version>() + "/" +
363363
Device.get_info<sycl::info::device::driver_version>()};
364364
}
365365

@@ -428,7 +428,7 @@ void WriteCacheItemSrc(const std::string &FileName, const device &Device,
428428
DumpBinData(SpecConsts.data(), SpecConsts.size())};
429429
if (DbgProgMgr > 1) {
430430
std::cerr << "####Writing source for cache item.\n";
431-
std::cerr << "####'"<<DeviceString<<"'"<<std::endl;
431+
std::cerr << "####'" << DeviceString << "'" << std::endl;
432432
}
433433

434434
size_t Size = DeviceString.size();
@@ -491,14 +491,16 @@ bool IsCacheItemSrcEqual(const std::string &FileName, const device &Device,
491491
FileStream.read(&res[0], Size);
492492
if (DeviceString.compare(res)) {
493493
if (DbgProgMgr > 1) {
494-
std::cerr << "####Devices differ:"<<DeviceString.compare(0, Size-1, res.data())<<"\n";
495-
std::cerr << "####'" <<DeviceString<<"'\n";
494+
std::cerr << "####Devices differ:"
495+
<< DeviceString.compare(0, Size - 1, res.data()) << "\n";
496+
std::cerr << "####'" << DeviceString << "'\n";
496497
std::cerr << "####\t vs\n";
497-
std::cerr << "####'" <<std::string(res.data(),Size)<<"'\n";
498-
std::cerr << "####Cached size "<< std::dec << Size << " vs current size " << DeviceString.size() << std::endl;
499-
for(unsigned int i=0; i< Size;i++){
500-
if(res[i]!=DeviceString[i])
501-
std::cerr << "####First diff on " << i<<std::endl;
498+
std::cerr << "####'" << std::string(res.data(), Size) << "'\n";
499+
std::cerr << "####Cached size " << std::dec << Size << " vs current size "
500+
<< DeviceString.size() << std::endl;
501+
for (unsigned int i = 0; i < Size; i++) {
502+
if (res[i] != DeviceString[i])
503+
std::cerr << "####First diff on " << i << std::endl;
502504
}
503505
}
504506

@@ -511,9 +513,9 @@ bool IsCacheItemSrcEqual(const std::string &FileName, const device &Device,
511513
if (BuildOptionsString.compare(0, Size, res.data())) {
512514
if (DbgProgMgr > 1) {
513515
std::cerr << "####Build options differ:\n";
514-
std::cerr << "####'" <<BuildOptionsString<<"'\n";
516+
std::cerr << "####'" << BuildOptionsString << "'\n";
515517
std::cerr << "####\t vs\n";
516-
std::cerr << "####'" <<std::string(res.data(), Size)<<"'\n";
518+
std::cerr << "####'" << std::string(res.data(), Size) << "'\n";
517519
}
518520
return false;
519521
}
@@ -524,9 +526,9 @@ bool IsCacheItemSrcEqual(const std::string &FileName, const device &Device,
524526
if (SpecConstsString.compare(0, Size, res.data())) {
525527
if (DbgProgMgr > 1) {
526528
std::cerr << "####Specialization constants differ\n";
527-
std::cerr << "####'" <<SpecConstsString<<"'\n";
529+
std::cerr << "####'" << SpecConstsString << "'\n";
528530
std::cerr << "####\t vs\n";
529-
std::cerr << "####'" <<std::string(res.data(), Size)<<"'\n";
531+
std::cerr << "####'" << std::string(res.data(), Size) << "'\n";
530532
}
531533
return false;
532534
}
@@ -537,10 +539,9 @@ bool IsCacheItemSrcEqual(const std::string &FileName, const device &Device,
537539
if (ImgString.compare(0, Size, res.data())) {
538540
if (DbgProgMgr > 1) {
539541
std::cerr << "####Images differ\n";
540-
std::cerr << "####'" <<ImgString<<"'\n";
542+
std::cerr << "####'" << ImgString << "'\n";
541543
std::cerr << "####\t vs\n";
542-
std::cerr << "####'" <<std::string(res.data(), Size)<<"'\n";
543-
544+
std::cerr << "####'" << std::string(res.data(), Size) << "'\n";
544545
}
545546
return false;
546547
}
@@ -600,11 +601,11 @@ void ProgramManager::putPIProgramToDisc(const detail::plugin &Plugin,
600601
FileName = DirName + "/" + std::to_string(i++);
601602
} while (IsFSEntryPresent(FileName + ".bin"));
602603

603-
unsigned int DeviceNum=0;
604+
unsigned int DeviceNum = 0;
604605

605606
Plugin.call<PiApiKind::piProgramGetInfo>(Program, PI_PROGRAM_INFO_NUM_DEVICES,
606607
sizeof(DeviceNum), &DeviceNum,
607-
nullptr);
608+
nullptr);
608609

609610
std::vector<size_t> BinarySizes(DeviceNum);
610611
Plugin.call<PiApiKind::piProgramGetInfo>(

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ static pi_result redefinedProgramGetInfo(pi_program program,
100100
return PI_SUCCESS;
101101
}
102102

103-
static pi_result redefinedProgramRetain(pi_program program) { return PI_SUCCESS; }
103+
static pi_result redefinedProgramRetain(pi_program program) {
104+
return PI_SUCCESS;
105+
}
104106

105-
static pi_result redefinedProgramRelease(pi_program program) { return PI_SUCCESS; }
107+
static pi_result redefinedProgramRelease(pi_program program) {
108+
return PI_SUCCESS;
109+
}
106110

107111
static pi_result redefinedKernelCreate(pi_program program,
108112
const char *kernel_name,
@@ -160,7 +164,8 @@ class KernelAndProgramCacheTest : public ::testing::Test {
160164
Mock->redefine<detail::PiApiKind::piProgramGetInfo>(
161165
redefinedProgramGetInfo);
162166
Mock->redefine<detail::PiApiKind::piProgramRetain>(redefinedProgramRetain);
163-
Mock->redefine<detail::PiApiKind::piProgramRelease>(redefinedProgramRelease);
167+
Mock->redefine<detail::PiApiKind::piProgramRelease>(
168+
redefinedProgramRelease);
164169
Mock->redefine<detail::PiApiKind::piKernelCreate>(redefinedKernelCreate);
165170
Mock->redefine<detail::PiApiKind::piKernelRetain>(redefinedKernelRetain);
166171
Mock->redefine<detail::PiApiKind::piKernelRelease>(redefinedKernelRelease);

0 commit comments

Comments
 (0)