SWDEV-311271 - Release freed memory from MemPools
Runtime has to release extra memory, held by the pools, in synchronization points for event, stream or device. Change-Id: Id533a5e1d137812aa72bdfe101b4b333c6a43d66
This commit is contained in:
کامیت شده توسط
Rahul Garg
والد
adf9406a16
کامیت
3fa4e31180
@@ -115,7 +115,7 @@ bool Heap::ReleaseAllMemory(size_t min_bytes_to_hold, bool safe_release) {
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Heap::ReleaseAllMemory(hip::Stream* stream) {
|
||||
bool Heap::ReleaseAllMemory() {
|
||||
for (auto it = allocations_.begin(); it != allocations_.end();) {
|
||||
// Make sure the heap holds the minimum number of bytes
|
||||
if (total_size_ <= release_threshold_) {
|
||||
@@ -270,10 +270,10 @@ void MemoryPool::ReleaseAllMemory() {
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void MemoryPool::ReleaseFreedMemory(hip::Stream* stream) {
|
||||
void MemoryPool::ReleaseFreedMemory() {
|
||||
amd::ScopedLock lock(lock_pool_ops_);
|
||||
|
||||
free_heap_.ReleaseAllMemory(stream);
|
||||
free_heap_.ReleaseAllMemory();
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
|
||||
مرجع در شماره جدید
Block a user