SWDEV-311271 - Fix Windows mempool management

Windows path still uses multi threading implementation. Hence, in graphs
all nodes are executed in a queue thread and that requires to manage
mempool in the queue thread. However, the spec allows to destory memory,
allocated in a graph, outside of the graph's execution. That may cause
mempool management to go out of sync.

Change-Id: I0ffb2244b3cb720455ed44d1b3e2487fa8959a77


[ROCm/clr commit: 4f6b0da028]
This commit is contained in:
German Andryeyev
2024-02-09 11:02:56 -05:00
orang tua bbf1d7c5b5
melakukan c9bace9b71
6 mengubah file dengan 143 tambahan dan 88 penghapusan
+2 -2
Melihat File
@@ -91,11 +91,11 @@ void Device::RemoveMemoryPool(MemoryPool* pool) {
}
// ================================================================================================
bool Device::FreeMemory(amd::Memory* memory, Stream* stream) {
bool Device::FreeMemory(amd::Memory* memory, Stream* stream, Event* event) {
amd::ScopedLock lock(lock_);
// Search for memory in the entire list of pools
for (auto it : mem_pools_) {
if (it->FreeMemory(memory, stream)) {
if (it->FreeMemory(memory, stream, event)) {
return true;
}
}