| 183 | } |
| 184 | |
| 185 | void GPUTensorPoolAllocator::BeginStep() { |
| 186 | if (inited_.load()) { |
| 187 | for (auto b : lifetime_bins_) { |
| 188 | if (b != nullptr) { |
| 189 | b->BeginStep(); |
| 190 | } |
| 191 | } |
| 192 | for (auto it : large_lifetime_bins_) { |
| 193 | it.second->BeginStep(); |
| 194 | } |
| 195 | } |
| 196 | std::lock_guard<spin_lock> l(free_lock_); |
| 197 | for (auto ptr : async_free_list_) { |
| 198 | sub_allocator_->Free(ptr, 0); |
| 199 | } |
| 200 | async_free_list_.clear(); |
| 201 | } |
| 202 | |
| 203 | void* GPUTensorPoolAllocator::AllocateRaw(size_t alignment, |
| 204 | size_t num_bytes) { |
no test coverage detected