| 426 | |
| 427 | template <typename T> |
| 428 | bool persistentCompilationCache::LookupCache(int64 key, T &text, |
| 429 | const string &kind) { |
| 430 | VLOG(2) << "Attempting to lookup " << kind << " in cache for key: " << key << "."; |
| 431 | bool in_cache = in_memory_cache_.contains(key); |
| 432 | if (in_cache) { |
| 433 | const string &text_str = in_memory_cache_[key]; |
| 434 | // Make a copy in order to not return a reference to the cache. |
| 435 | std::copy_n(text_str.data(), text_str.size(), std::back_inserter(text)); |
| 436 | VLOG(2) << "Found " << kind << " in cache for key: " << key << "."; |
| 437 | } |
| 438 | return in_cache; |
| 439 | } |
| 440 | |
| 441 | bool persistentCompilationCache::LookupCache(int64 key, string &ptx) { |
| 442 | int64 ptx_key = tensorflow::Hash64Combine(key, ptx_hash_); |
no test coverage detected