Memory volume is memory * lifetime, but we might change the formula
| 346 | |
| 347 | // Memory volume is memory * lifetime, but we might change the formula |
| 348 | void TopoStruct::ComputeMemoryVolume() { |
| 349 | static float lifetime_order = ParseFloatFromEnv("LifetimeOrder", 1.0); |
| 350 | // We might get a large tensor multiply by a long life time, we need some rescaling |
| 351 | memory_volume = static_cast<int64_t>( |
| 352 | (memory_increment * pow(static_cast<double>(min_lifetime), lifetime_order)) / 1000.0); |
| 353 | // We need to distinguish zero or negative memory increment from slight positive memory increment. |
| 354 | // Make sure that we execute -0.1, 0, -0.003 before 0.1, 0.2 |
| 355 | if (memory_increment > 0) { memory_volume += 1; } |
| 356 | } |
| 357 | |
| 358 | // deciding parameter |
| 359 | // kTributaryLayerAscend = 0, // small tributary layers go first |
no test coverage detected