SWDEV-353281 - Initial support of memalloc in graph

Add memory allocation support in graph. Current implementation uses
cache from mempool  to hold the allocations which belong to the graph.
Also the resource tracking is disabled at this moment because mempool
operates with hip::Stream objects, but graph has execution with
amd::HostQueue objects.

Change-Id: I54fe3250126d24f5a26ada975f37d429bb4ef17b
This commit is contained in:
German Andryeyev
2022-12-14 18:54:16 -05:00
parent 873bc03034
commit eef47ca24a
13 changed files with 352 additions and 39 deletions
+4 -1
View File
@@ -108,7 +108,10 @@ hipError_t ihipFree(void *ptr) {
queue->finish();
}
hip::Stream::syncNonBlockingStreams(device_id);
amd::SvmBuffer::free(memory_object->getContext(), ptr);
// Find out if memory belongs to any memory pool
if (!g_devices[device_id]->FreeMemory(memory_object, nullptr)) {
amd::SvmBuffer::free(memory_object->getContext(), ptr);
}
return hipSuccess;
}
return hipErrorInvalidValue;