| 259 | } |
| 260 | |
| 261 | Status XRTCompilationCache::Lookup( |
| 262 | int64 uid, std::unique_ptr<XRTCompilationCacheEntryRef>* entry) { |
| 263 | entry->reset(); |
| 264 | |
| 265 | absl::MutexLock lock(&mu_); |
| 266 | const auto iter = entries_by_uid_.find(uid); |
| 267 | if (iter == entries_by_uid_.end()) { |
| 268 | return errors::NotFound("No executable found for uid ", uid); |
| 269 | } |
| 270 | CompiledSubgraph* cache_entry = iter->second; |
| 271 | *entry = std::unique_ptr<XRTCompilationCacheEntryRef>( |
| 272 | new EntryRefImpl(this, cache_entry)); |
| 273 | return Status::OK(); |
| 274 | } |
| 275 | |
| 276 | string XRTCompilationCache::DebugString() const { |
| 277 | return "XRTCompilationCache"; |