lifetime policy
| 57 | |
| 58 | // lifetime policy |
| 59 | GPULifetimePolicy* 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 | |
| 72 | std::vector<GPULifetimeBin*>& GPUMemoryPlanner::GetSmallBins() { |
| 73 | return small_bins_; |