MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / release_pool

Method release_pool

src/runtime/PoolManager.cpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73std::unique_ptr<IMemoryPool> PoolManager::release_pool()
74{
75 arm_compute::lock_guard<arm_compute::Mutex> lock(_mtx);
76 ARM_COMPUTE_ERROR_ON_MSG(!_occupied_pools.empty(), "All pools should be free in order to release one!");
77
78 if (!_free_pools.empty())
79 {
80 std::unique_ptr<IMemoryPool> pool = std::move(_free_pools.front());
81 ARM_COMPUTE_ERROR_ON(_free_pools.front() != nullptr);
82 _free_pools.pop_front();
83
84 // Update semaphore
85 _sem = std::make_unique<arm_compute::Semaphore>(_free_pools.size());
86
87 return pool;
88 }
89
90 return nullptr;
91}
92
93void PoolManager::clear_pools()
94{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected