| 38 | } // namespace |
| 39 | |
| 40 | ExecutionHandle CompilationCache::Insert( |
| 41 | std::unique_ptr<Executable> executable) { |
| 42 | tensorflow::mutex_lock lock(mutex_); |
| 43 | |
| 44 | CacheKey key = GetUniqueId(); |
| 45 | VLOG(2) << "inserting cache key: " << key; |
| 46 | CHECK_EQ(cache_.count(key), 0); |
| 47 | cache_.emplace(key, std::move(executable)); |
| 48 | |
| 49 | ExecutionHandle handle; |
| 50 | handle.set_handle(key); |
| 51 | return handle; |
| 52 | } |
| 53 | |
| 54 | StatusOr<std::shared_ptr<Executable>> CompilationCache::LookUp( |
| 55 | const ExecutionHandle& handle) const { |
no test coverage detected