diff --git a/rocclr/device/device.hpp b/rocclr/device/device.hpp index 5f319c0852..9fab651d24 100644 --- a/rocclr/device/device.hpp +++ b/rocclr/device/device.hpp @@ -1899,7 +1899,9 @@ class Device : public RuntimeObject { Memory* P2PStage() const { return p2p_stage_; } //! Returns heap buffer object for device allocator - device::Memory* HeapBuffer() const { return heap_buffer_->getDeviceMemory(*this); } + device::Memory* HeapBuffer() const { + return (heap_buffer_ != nullptr) ? heap_buffer_->getDeviceMemory(*this) : nullptr; + } //! Does this device allow P2P access? bool P2PAccessAllowed() const { return (p2p_access_devices_.size() > 0) ? true : false; }