Skip to content

Commit bee42ec

Browse files
committed
Add bool m_IsCompressed to indicate if it's compressed
1 parent 0d8ecf3 commit bee42ec

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sycl/source/detail/device_binary_image.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,11 @@ void CompressedRTDeviceBinaryImage::Decompress() {
728728

729729
Bin->Format = ur::getBinaryImageFormat(Bin->BinaryStart, getSize());
730730
Format = static_cast<ur::DeviceBinaryType>(Bin->Format);
731+
732+
m_IsCompressed = false;
731733
};
732734

733-
std::call_once(InitFlag, DecompressFunc);
735+
std::call_once(m_InitFlag, DecompressFunc);
734736
}
735737

736738
CompressedRTDeviceBinaryImage::~CompressedRTDeviceBinaryImage() {

sycl/source/detail/device_binary_image.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ class CompressedRTDeviceBinaryImage : public RTDeviceBinaryImage {
322322
return m_ImageSize;
323323
}
324324

325-
bool IsCompressed() const { return m_DecompressedData.get() == nullptr; }
325+
bool IsCompressed() const { return m_IsCompressed; }
326+
326327
void print() const override {
327328
RTDeviceBinaryImage::print();
328329
std::cerr << " COMPRESSED\n";
@@ -333,7 +334,8 @@ class CompressedRTDeviceBinaryImage : public RTDeviceBinaryImage {
333334
size_t m_ImageSize = 0;
334335

335336
// Flag to ensure decompression happens only once.
336-
std::once_flag InitFlag;
337+
std::once_flag m_InitFlag;
338+
bool m_IsCompressed = true;
337339
};
338340
#endif // SYCL_RT_ZSTD_AVAILABLE
339341

0 commit comments

Comments
 (0)