Skip to content

Commit 211ccda

Browse files
authored
[SYCL] Fix SYCL_DUMP_IMAGES handling to also dump when spec constants are on. (#6052)
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent 2e7d244 commit 211ccda

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,9 +913,6 @@ ProgramManager::getDeviceImage(OSModuleHandle M, KernelSetId KSId,
913913
std::cerr << "selected device image: " << &Img->getRawData() << "\n";
914914
Img->print();
915915
}
916-
917-
if (std::getenv("SYCL_DUMP_IMAGES") && !m_UseSpvFile)
918-
dumpImage(*Img, KSId);
919916
return *Img;
920917
}
921918

@@ -1094,6 +1091,7 @@ bool ProgramManager::kernelUsesAssert(OSModuleHandle M,
10941091

10951092
void ProgramManager::addImages(pi_device_binaries DeviceBinary) {
10961093
std::lock_guard<std::mutex> Guard(Sync::getGlobalLock());
1094+
const bool DumpImages = std::getenv("SYCL_DUMP_IMAGES") && !m_UseSpvFile;
10971095

10981096
for (int I = 0; I < DeviceBinary->NumDeviceBinaries; I++) {
10991097
pi_device_binary RawImg = &(DeviceBinary->DeviceBinaries[I]);
@@ -1230,10 +1228,12 @@ void ProgramManager::addImages(pi_device_binaries DeviceBinary) {
12301228
}
12311229
}
12321230
m_DeviceImages[KSId].reset(new std::vector<RTDeviceBinaryImageUPtr>());
1233-
12341231
cacheKernelUsesAssertInfo(M, *Img);
12351232

1233+
if (DumpImages)
1234+
dumpImage(*Img, KSId);
12361235
m_DeviceImages[KSId]->push_back(std::move(Img));
1236+
12371237
continue;
12381238
}
12391239
// Otherwise assume that the image contains all kernels associated with the
@@ -1248,6 +1248,8 @@ void ProgramManager::addImages(pi_device_binaries DeviceBinary) {
12481248

12491249
cacheKernelUsesAssertInfo(M, *Img);
12501250

1251+
if (DumpImages)
1252+
dumpImage(*Img, KSId);
12511253
Imgs->push_back(std::move(Img));
12521254
}
12531255
}

0 commit comments

Comments
 (0)