cutile::core::Latency currently uses a u32 const parameter:
pub struct Latency<const CYCLES: u32>;
However, kernel entry points currently support only i32 and bool const generics. As a result, latency cannot be exposed as a tunable kernel generic:
#[cutile::entry]
unsafe fn kernel<const LATENCY: u32>(...) {
load_ptr_tko(..., Latency::<LATENCY>);
}
This fails with:
const generic LATENCY must be i32 or bool, got u32
Changing the kernel generic to i32 also fails because Latency expects u32.
Would it make sense to make Latency use i32, or alternatively support u32 kernel const generics? Either approach would provide a supported way to write:
without branching over hard-coded values such as Latency::<1>, Latency::<2>, etc.
cutile::core::Latencycurrently uses au32const parameter:However, kernel entry points currently support only
i32andboolconst generics. As a result, latency cannot be exposed as a tunable kernel generic:This fails with:
const generic
LATENCYmust bei32orbool, gotu32Changing the kernel generic to
i32also fails becauseLatencyexpectsu32.Would it make sense to make
Latencyusei32, or alternatively supportu32kernel const generics? Either approach would provide a supported way to write:without branching over hard-coded values such as
Latency::<1>,Latency::<2>, etc.