pub fn next_power_of_two(n: usize, fixed_power: Option<usize>) -> usize {
    match fixed_power {
        Some(power) => {
            let padded_nb_rows = 1 << power;
            if n * 2 < padded_nb_rows {
                tracing::debug!(
                    "fixed log2 rows can be potentially reduced: got {}, expected {}",
                    n,
                    padded_nb_rows
                );
            }
            if n > padded_nb_rows {
                panic!("fixed log2 rows is too small: got {}, expected {}", n, padded_nb_rows);
            }
            padded_nb_rows
        }
        None => {
            let mut padded_nb_rows = n.next_power_of_two();
            if padded_nb_rows < 16 {
                padded_nb_rows = 16;
            }
            padded_nb_rows
        }
    }
}
Returns the next power of two that is >= `n` and >= 16. If `fixed_power` is set, it will return
`2^fixed_power` after checking that `n <= 2^fixed_power`.
crates/core/machine/src/utils/mod.rs