okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
83027df58
main
1// warm_policy_test: when the HIP start-up warm-up of hipBLAS may run (include/strata/prefill/warm_policy.hpp). Pure. 2#include "strata/prefill/warm_policy.hpp" 3 4#include <cstdio> 5 6using strata::prefill::warm_gemm_wanted ; 7 8static int g_fail = 0 ; 9static void expect (bool ok ,const char * what ) { 10if (!ok ) { 11++ g_fail ; 12 std::fprintf (stderr ,"FAIL: %s\n" ,what ); 13 } 14} 15 16int main () { 17expect (warm_gemm_wanted ({},nullptr ),"no device list: the warm-up runs" ); 18expect (warm_gemm_wanted ({"gfx1201" },nullptr ),"one R9700: on" ); 19expect (warm_gemm_wanted ({"gfx1201" ,"gfx1201" },nullptr ),"2x R9700 (same architecture): on (021-iD: no loss)" ); 20expect (warm_gemm_wanted ({"gfx1201:sramecc+:xnack-" ,"gfx1201" },nullptr ),"feature suffixes do not make a mixed pair" ); 21expect (!warm_gemm_wanted ({"gfx1151" ,"gfx1201" },nullptr ),"8060S + R9700 (#3204): off" ); 22expect (!warm_gemm_wanted ({"gfx1201" ,"gfx1151" },nullptr ),"the order does not matter" ); 23expect (!warm_gemm_wanted ({"gfx1100" ,"gfx1100" ,"gfx1030" },nullptr ),"any second architecture turns it off" ); 24expect (!warm_gemm_wanted ({"gfx1201" },"0" ),"STRATA_PREFILL_WARM=0: off" ); 25expect (!warm_gemm_wanted ({"gfx1201" ,"gfx1201" },"0" ),"STRATA_PREFILL_WARM=0 on two cards: off" ); 26expect (warm_gemm_wanted ({"gfx1151" ,"gfx1201" },"1" ),"STRATA_PREFILL_WARM=1 forces it on a mixed pair" ); 27expect (!warm_gemm_wanted ({"gfx1151" ,"gfx1201" },"" ),"an empty value is unset: a mixed pair stays off" ); 28if (g_fail ) { std::fprintf (stderr ,"warm_policy_test: %d failure(s)\n" ,g_fail );return 1 ; } 29 std::printf ("warm_policy_test: OK\n" ); 30return 0 ; 31}