| 74 | } |
| 75 | |
| 76 | Status XRTCompilationCache::Release(int64 uid) { |
| 77 | absl::MutexLock lock(&mu_); |
| 78 | auto iter = entries_by_uid_.find(uid); |
| 79 | |
| 80 | if (iter == entries_by_uid_.end()) { |
| 81 | return errors::NotFound("No cache entry found for uid ", uid); |
| 82 | } |
| 83 | |
| 84 | DiscardEntryRefLocked(iter->second); |
| 85 | |
| 86 | VLOG(1) << "After releasing entry " << uid << " refs cache is " |
| 87 | << cache_.size() << " entries (" |
| 88 | << cache_entries_ + marked_for_eviction_entries_ |
| 89 | << "), marked for eviction " |
| 90 | << (cache_.size() - entries_by_last_use_.size()) << " entries (" |
| 91 | << marked_for_eviction_entries_ << ")."; |
| 92 | |
| 93 | return Status::OK(); |
| 94 | } |
| 95 | |
| 96 | void XRTCompilationCache::DiscardEntryRef(CompiledSubgraph* entry) { |
| 97 | absl::MutexLock lock(&mu_); |