SWDEV-497841 - Avoid access to the null stream on mempool alloc

Null stream isn't created during the device creation
This commit is contained in:
Andryeyev, German
2025-03-17 11:40:14 -04:00
committed by GitHub
parent cde722ad71
commit 392ed53c3c
3 changed files with 19 additions and 15 deletions
+4 -1
View File
@@ -214,7 +214,7 @@ class MemoryPool : public amd::ReferenceCountedObject, amd::VmHeap {
};
MemoryPool(hip::Device* device, const hipMemPoolProps* props = nullptr, bool phys_mem = false)
: VmHeap(device->asContext()->devices()[0], *device->NullStream()),
: VmHeap(device->devices()[0]),
busy_heap_(device, *this),
free_heap_(device, *this),
lock_pool_ops_(true),
@@ -259,6 +259,9 @@ class MemoryPool : public amd::ReferenceCountedObject, amd::VmHeap {
}
}
/// Returns a queue for virtual memory map/unmap operations
virtual amd::HostQueue& GetVmQueue() final { return *device_->NullStream(); }
/// The same stream can reuse memory without HIP event validation
void* AllocateMemory(size_t size, Stream* stream, void* dptr = nullptr);