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

Method BestLifetimePolicy

tensorflow/core/common_runtime/gpu_memory_planner.cc:59–70  ·  view source on GitHub ↗

lifetime policy

Source from the content-addressed store, hash-verified

57
58// lifetime policy
59GPULifetimePolicy* GPUMemoryPlanner::BestLifetimePolicy() {
60 GPULifetimePolicy* best_policy = nullptr;
61 auto total_mem = std::numeric_limits<size_t>::max();
62 for (auto policy : lifetime_stats_polices_) {
63 auto policy_mem = policy->TotalMem();
64 if (policy_mem < total_mem) {
65 best_policy = policy;
66 total_mem = policy_mem;
67 }
68 }
69 return best_policy;
70}
71
72std::vector<GPULifetimeBin*>& GPUMemoryPlanner::GetSmallBins() {
73 return small_bins_;

Callers

nothing calls this directly

Calls 2

maxFunction · 0.50
TotalMemMethod · 0.45

Tested by

no test coverage detected