| 71 | } |
| 72 | |
| 73 | ScopedAllocatorInstance* ScopedAllocatorContainer::GetInstance(int32 scope_id) { |
| 74 | VLOG(2) << "GetInstance " << scope_id << " step " << step_id_ << " on " |
| 75 | << mgr_->device_name(); |
| 76 | mutex_lock l(mu_); |
| 77 | auto it = allocators_.find(scope_id); |
| 78 | if (it != allocators_.end()) { |
| 79 | return it->second.instance; |
| 80 | } |
| 81 | LOG(FATAL) << "Failed to find instance " << scope_id << " in container " |
| 82 | << step_id_ << " on " << mgr_->device_name(); |
| 83 | return nullptr; |
| 84 | } |
| 85 | |
| 86 | void ScopedAllocatorContainer::Drop(int32 scope_id, ScopedAllocator* sa) { |
| 87 | VLOG(2) << "Drop " << scope_id << " from container " << this << " step " |