Skip to content

Commit

Permalink
fix bs allocator bug (#892)
Browse files Browse the repository at this point in the history
* fix bs allocator bug

* minor change
  • Loading branch information
zhaoguochun1995 authored Jul 12, 2024
1 parent 4d62b53 commit ee58ddc
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class BSCachingAllocator : public CacheAllocator {
}

void empty_resource_pool() const {
std::lock_guard<mutex_t> lk(mutex_);
DIPU_DEBUG_ALLOCATOR(
8, "BSCachingAllocator::empty_resource_pool ,allocator:" << this);
while (!async_mem_pool()->empty()) {
Expand Down Expand Up @@ -180,6 +181,7 @@ class BSCachingAllocator : public CacheAllocator {
void release_all_memory() const override { release_all_memory_impl(); }

void flush_mem_pool() const {
std::lock_guard<mutex_t> lk(mutex_);
DIPU_DEBUG_ALLOCATOR(
8, "BSCachingAllocator::flush_mem_pool allocator:" << this);
while (async_mem_pool()->ready()) {
Expand Down

0 comments on commit ee58ddc

Please sign in to comment.