| 52 | } |
| 53 | |
| 54 | StatusOr<std::shared_ptr<Executable>> CompilationCache::LookUp( |
| 55 | const ExecutionHandle& handle) const { |
| 56 | tensorflow::mutex_lock lock(mutex_); |
| 57 | |
| 58 | CacheKey key = handle.handle(); |
| 59 | VLOG(2) << "looking up cache key: " << key; |
| 60 | if (cache_.count(key) == 0) { |
| 61 | VLOG(2) << "cache key not found: " << key; |
| 62 | return InvalidArgumentStrCat("can not find executable with handle ", key); |
| 63 | } else { |
| 64 | auto& result = cache_.at(key); |
| 65 | VLOG(2) << "hit executable: " << result->module().name(); |
| 66 | return result; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | } // namespace xla |
no test coverage detected