SWDEV-353281 - Change pool type for graphs

Under ROCr physical allocations don't have initial VA and require extra
flag in ROCclr. Add an option to have a mempool of physical allocations.

Change-Id: I4d062fe0dd8113d4eaf6e8b51749ed56d8701d1e


[ROCm/clr commit: f296159f62]
This commit is contained in:
German Andryeyev
2024-03-18 18:17:12 -04:00
committed by Julia Jiang
parent 50ecfb39c9
commit e46ab0bff5
5 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -180,6 +180,7 @@ void* MemoryPool::AllocateMemory(size_t size, Stream* stream, void* dptr) {
return nullptr;
}
cl_svm_mem_flags flags = (state_.interprocess_) ? ROCCLR_MEM_INTERPROCESS : 0;
flags |= (state_.phys_mem_) ? ROCCLR_MEM_PHYMEM : 0;
dev_ptr = amd::SvmBuffer::malloc(*context, flags, size, dev_info.memBaseAddrAlign_, nullptr);
if (dev_ptr == nullptr) {
size_t free = 0, total =0;
@@ -291,7 +292,7 @@ bool MemoryPool::FreeMemory(amd::Memory* memory, Stream* stream, Event* event) {
// Decrement the reference counter on the pool.
// Note: It may delete memory pool for the last allocation. Thus, the scope lock can't include
// this call.
// this call.
release();
return true;