SWDEV-311271 - Initial mempool implementation

HIP_MEM_POOL_SUPPORT controls memory pool support in runtime.
Currently it's disabled by default. The initial change doesn't
include: IPC, MGPU, virtual memory alloc, suballoc, defragmentation,
internal dependencies.

Change-Id: Ibed8528ebec698b045ebb247e49c0ecd6e587ed7
Этот коммит содержится в:
German Andryeyev
2022-03-28 12:30:04 -04:00
родитель 1a4fd9b7ea
Коммит 539d264eb0
14 изменённых файлов: 1438 добавлений и 7 удалений
+6
Просмотреть файл
@@ -407,6 +407,12 @@ hipError_t hipStreamSynchronize(hipStream_t stream) {
// Wait for the current host queue
hip::getQueue(stream)->finish();
// Make sure runtime releases memory for all memory pools on the device,
// associated with the queue
auto hip_stream = reinterpret_cast<hip::Stream*>(stream);
auto device = (hip_stream == nullptr) ? hip::getCurrentDevice() : hip_stream->GetDevice();
device->ReleaseFreedMemory(hip_stream);
HIP_RETURN(hipSuccess);
}