okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
d6aa6504e
main
1// tools/vision/gpu_arch_test.cpp - the HIP picture reader's architecture check (gpu_arch.h) without a GPU. Exit 0 = passed. 2#include "gpu_arch.h" 3 4#include <cstdio> 5 6static int bad = 0 ; 7#define CHECK (c ) do { if (!(c)) { std::printf("FAIL line %d: %s\n", __LINE__, #c); ++bad; } } while (0) 8 9int main () { 10CHECK (strata_gfx_in (" Device 0: AMD Radeon RX 9070 XT, gfx1201:sramecc-:xnack- (0x1201), VMM: no, Wave Size: 32" )== "gfx1201" ); 11CHECK (strata_gfx_in (" Device 0: AMD Radeon Graphics, gfx1151 (0x1151)" )== "gfx1151" ); 12CHECK (strata_gfx_in (" Device 0: gfx, nothing after it" )== "" ); 13CHECK (strata_gfx_in ("no architecture here" )== "" ); 14CHECK (strata_arch_listed ("gfx1200,gfx1201" ,"gfx1201" )); 15CHECK (strata_arch_listed ("gfx1200;gfx1201" ,"gfx1200" )); 16CHECK (strata_arch_listed ("gfx1100" ,"gfx1100" )); 17CHECK (!strata_arch_listed ("gfx1200,gfx1201" ,"gfx1100" )); 18CHECK (!strata_arch_listed ("gfx1100" ,"gfx110" ));// a prefix is not an architecture 19CHECK (!strata_arch_listed ("gfx1100" ,"gfx11000" )); 20CHECK (!strata_arch_listed ("" ,"gfx1100" )); 21CHECK (!strata_arch_listed ("gfx1100" ,"" )); 22 std::printf (bad ?"gpu_arch_test: %d FAILED\n" :"gpu_arch_test: ok\n" ,bad ); 23return bad ?1 :0 ; 24}