Skip to content

Commit df6017f

Browse files
committed
USe atomic<bool> instead
1 parent bee42ec commit df6017f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sycl/source/detail/device_binary_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ void CompressedRTDeviceBinaryImage::Decompress() {
729729
Bin->Format = ur::getBinaryImageFormat(Bin->BinaryStart, getSize());
730730
Format = static_cast<ur::DeviceBinaryType>(Bin->Format);
731731

732-
m_IsCompressed = false;
732+
m_IsCompressed.store(false);
733733
};
734734

735735
std::call_once(m_InitFlag, DecompressFunc);

sycl/source/detail/device_binary_image.hpp

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

325-
bool IsCompressed() const { return m_IsCompressed; }
325+
bool IsCompressed() const { return m_IsCompressed.load(); }
326326

327327
void print() const override {
328328
RTDeviceBinaryImage::print();
@@ -335,7 +335,7 @@ class CompressedRTDeviceBinaryImage : public RTDeviceBinaryImage {
335335

336336
// Flag to ensure decompression happens only once.
337337
std::once_flag m_InitFlag;
338-
bool m_IsCompressed = true;
338+
std::atomic<bool> m_IsCompressed{true};
339339
};
340340
#endif // SYCL_RT_ZSTD_AVAILABLE
341341

0 commit comments

Comments
 (0)