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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user