Currently, Level::as_sse2, Level::as_neon and so forth are only implemented on the target where that feature could be available. For writing tests/benchmarks that want to run over all locally available levels, this means you have to combine the as_* checks with #[cfg] checks or you get a compile error.
Could we instead define all as_* methods on all targets, with the impls on mismatched targets unconditionally returning None ? That would also make it slightly easier to write dispatches to custom kernels for specific levels, because your general simd function can just as_neon() on all platforms instead of having to throw in target conditionals.
Currently, Level::as_sse2, Level::as_neon and so forth are only implemented on the target where that feature could be available. For writing tests/benchmarks that want to run over all locally available levels, this means you have to combine the
as_*checks with#[cfg]checks or you get a compile error.Could we instead define all
as_*methods on all targets, with the impls on mismatched targets unconditionally returningNone? That would also make it slightly easier to write dispatches to custom kernels for specific levels, because your general simd function can justas_neon()on all platforms instead of having to throw in target conditionals.