SWDEV-548482 - Address memory leaks in memory tests (#438)

* SWDEV-548482 - Address memory leaks in memory tests

* SWDEV-547453 - Do not alter the dev_ptr if operation is not successfull

* SWDEV-548482 - Minor tweaks

* SWDEV-548482 - Move eventlist release after the command is created

---------

Co-authored-by: Marko Arandjelovic <Marko.Arandjelovic@amd.com>
Este commit está contenido en:
systems-assistant[bot]
2025-09-02 17:29:41 +02:00
cometido por GitHub
padre 05a9a528f7
commit 12ca3c9043
Se han modificado 2 ficheros con 14 adiciones y 1 borrados
+13
Ver fichero
@@ -1801,6 +1801,7 @@ hipError_t ihipMemcpyDtoHCommand(amd::Command*& command, void* dstHost, amd::Coo
waitList.push_back(cmd);
}
}
amd::ReadMemoryCommand* readCommand =
new amd::ReadMemoryCommand(*stream, CL_COMMAND_READ_BUFFER_RECT, waitList, *srcMemory,
srcStart, copyRegion, dstHost, srcRect, dstRect, copyMetadata);
@@ -1813,6 +1814,10 @@ hipError_t ihipMemcpyDtoHCommand(amd::Command*& command, void* dstHost, amd::Coo
return hipErrorInvalidValue;
}
command = readCommand;
if (!waitList.empty()) {
waitList[0]->release();
}
}
return hipSuccess;
@@ -1949,6 +1954,10 @@ hipError_t ihipMemcpyHtoACommand(amd::Command*& command, amd::Image* dstImage,
return hipErrorInvalidValue;
}
command = writeMemCmd;
if (!waitList.empty()) {
waitList[0]->release();
}
}
return hipSuccess;
@@ -1997,6 +2006,10 @@ hipError_t ihipMemcpyAtoHCommand(amd::Command*& command, void* dstHost, amd::Coo
return hipErrorInvalidValue;
}
command = readMemCmd;
if (!waitList.empty()) {
waitList[0]->release();
}
}
return hipSuccess;
+1 -1
Ver fichero
@@ -425,7 +425,7 @@ hipError_t hipMemPoolImportFromShareableHandle(hipMemPool_t* mem_pool, void* sha
}
auto device = g_devices[0];
auto pool = new hip::MemoryPool(device);
auto pool = new hip::MemoryPool(device, nullptr, true);
if (pool == nullptr) {
HIP_RETURN(hipErrorOutOfMemory);
}