Skip to content

Commit bfc7e7e

Browse files
committed
check if currentMemoryToSizeMap is a nullptr
1 parent 952c71a commit bfc7e7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interfaces/sycl/Memory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void* ConcreteAPI::allocPinnedMem(size_t size, bool compress, Destination hint)
3838
void ConcreteAPI::freeMem(void* devPtr) {
3939
// NOTE: Freeing nullptr results in segfault in oneAPI. It is an opposite behaviour
4040
// contrast to C++/CUDA/HIP
41-
if (devPtr != nullptr) {
41+
if (devPtr != nullptr && this->currentMemoryToSizeMap != nullptr) {
4242
if (this->currentMemoryToSizeMap().find(devPtr) == this->currentMemoryToSizeMap().end()) {
4343
throw std::invalid_argument(
4444
this->getDeviceInfoAsText(getDeviceId())

0 commit comments

Comments
 (0)