MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetExecGraph

Method GetExecGraph

tensorflow/compiler/xla/service/gpu/gpu_graph_util.cc:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void* MutexedGraphExecCache::GetExecGraph(BufferAllocations::KeyType key) {
40 tensorflow::mutex_lock lock(exec_graph_cache_mu_);
41 if (gpu_key_to_exec_graphs_map_.find(key) !=
42 gpu_key_to_exec_graphs_map_.end()) {
43 auto it = std::find(gpu_exec_graphs_.begin(), gpu_exec_graphs_.end(),
44 *(gpu_key_to_exec_graphs_map_[key]));
45 if (it == gpu_exec_graphs_.end()) {
46 gpu_key_to_exec_graphs_map_.erase(key);
47 return nullptr;
48 }
49 auto gpu_exec_graph = *(gpu_key_to_exec_graphs_map_[key]);
50 gpu_exec_graphs_.remove(gpu_exec_graph);
51 gpu_exec_graphs_.push_front(gpu_exec_graph);
52 gpu_key_to_exec_graphs_map_[key] = gpu_exec_graphs_.begin();
53 return gpu_exec_graph;
54 }
55 return nullptr;
56}
57
58void MutexedGraphExecCache::SetCacheSize(int64 cache_size) {
59 cache_size_.store(cache_size);

Callers 1

ExecuteThunksMethod · 0.80

Calls 6

push_frontMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected