Skip to content

Commit 08d2815

Browse files
committed
[SYCL] Fix dumping of images for multiple targets
1 parent bd64197 commit 08d2815

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,12 @@ void ProgramManager::addImages(pi_device_binaries DeviceBinary) {
12571257
if (KSIdIt != KSIdMap.end()) {
12581258
auto &Imgs = m_DeviceImages[KSIdIt->second];
12591259
assert(Imgs && "Device image vector should have been already created");
1260+
// If the images differ in target format, the dumping is necessary.
1261+
if (DumpImages &&
1262+
!std::all_of(Imgs->begin(), Imgs->end(), [&](auto &I) {
1263+
return I->getFormat() == Img->getFormat();
1264+
}))
1265+
dumpImage(*Img, KSIdIt->second);
12601266

12611267
cacheKernelUsesAssertInfo(M, *Img);
12621268

0 commit comments

Comments
 (0)