| 312 | } |
| 313 | |
| 314 | Result<DeviceMapper> GetMapper(DeviceAllocationType device_type) { |
| 315 | std::lock_guard<std::mutex> lock(lock_); |
| 316 | auto it = registry_.find(device_type); |
| 317 | if (it == registry_.end()) { |
| 318 | return Status::KeyError("Device type ", static_cast<int>(device_type), |
| 319 | "is not registered"); |
| 320 | } |
| 321 | return it->second; |
| 322 | } |
| 323 | |
| 324 | private: |
| 325 | std::mutex lock_; |
no test coverage detected