#![cfg(feature = "std")]
use gemmkit::tuning;
#[test]
fn env_knobs_resolution_contract() {
unsafe {
std::env::remove_var("GEMMKIT_SMALL_MN_DIM");
}
assert_eq!(
tuning::small_mn_dim(),
tuning::SMALL_MN_DIM_DEFAULT,
"an unset GEMMKIT_* var must fall through to the default"
);
unsafe {
std::env::set_var("GEMMKIT_K_STREAM_MAX", "not-a-number"); std::env::set_var("GEMMKIT_MC_REG_PANELS", "5"); std::env::set_var("GEMMKIT_KC_MIN", "7"); }
assert_eq!(
tuning::k_stream_max(),
tuning::K_STREAM_MAX_DEFAULT,
"a malformed GEMMKIT_* value must fall back to the default"
);
assert_eq!(
tuning::mc_reg_panels(),
5,
"a well-formed GEMMKIT_* value must be parsed and used"
);
tuning::set_kc_min(999);
assert_eq!(
tuning::kc_min(),
999,
"set_* must override the GEMMKIT_* env var"
);
}