@@ -16,22 +16,22 @@ namespace {
1616
1717int g_failures = 0 ;
1818
19- #define CHECK_ORDER (types, expected ) \
20- do { \
21- const std::vector<size_t > _got = transcribe::gpu_probe_order (types); \
22- const std::vector<size_t > _exp = (expected); \
23- if (_got != _exp) { \
24- std::fprintf (stderr, " FAIL %s:%d: got {" , __FILE__, __LINE__); \
25- for (size_t v : _got) { \
26- std::fprintf (stderr, " %zu" , v); \
27- } \
28- std::fprintf (stderr, " }, expected {" ); \
29- for (size_t v : _exp) { \
30- std::fprintf (stderr, " %zu" , v); \
31- } \
32- std::fprintf (stderr, " }\n " ); \
33- ++g_failures; \
34- } \
19+ #define CHECK_ORDER (types, expected ) \
20+ do { \
21+ const std::vector<size_t > _got = transcribe::gpu_probe_order (types); \
22+ const std::vector<size_t > _exp = (expected); \
23+ if (_got != _exp) { \
24+ std::fprintf (stderr, " FAIL %s:%d: got {" , __FILE__, __LINE__); \
25+ for (size_t v : _got) { \
26+ std::fprintf (stderr, " %zu" , v); \
27+ } \
28+ std::fprintf (stderr, " }, expected {" ); \
29+ for (size_t v : _exp) { \
30+ std::fprintf (stderr, " %zu" , v); \
31+ } \
32+ std::fprintf (stderr, " }\n " ); \
33+ ++g_failures; \
34+ } \
3535 } while (0 )
3636
3737} // namespace
@@ -52,14 +52,12 @@ int main() {
5252 // The hybrid-graphics case that motivated the tiering: the iGPU
5353 // enumerates first, but the discrete GPU must be probed first.
5454 CHECK_ORDER ((DevTypes{ GGML_BACKEND_DEVICE_TYPE_IGPU , GGML_BACKEND_DEVICE_TYPE_GPU }), (Order{ 1 , 0 }));
55- CHECK_ORDER ((DevTypes{ GGML_BACKEND_DEVICE_TYPE_IGPU , GGML_BACKEND_DEVICE_TYPE_CPU ,
56- GGML_BACKEND_DEVICE_TYPE_GPU }),
55+ CHECK_ORDER ((DevTypes{ GGML_BACKEND_DEVICE_TYPE_IGPU , GGML_BACKEND_DEVICE_TYPE_CPU , GGML_BACKEND_DEVICE_TYPE_GPU }),
5756 (Order{ 2 , 0 }));
5857
5958 // Registry order is preserved within each tier.
60- CHECK_ORDER ((DevTypes{ GGML_BACKEND_DEVICE_TYPE_GPU , GGML_BACKEND_DEVICE_TYPE_IGPU ,
61- GGML_BACKEND_DEVICE_TYPE_GPU , GGML_BACKEND_DEVICE_TYPE_CPU ,
62- GGML_BACKEND_DEVICE_TYPE_IGPU }),
59+ CHECK_ORDER ((DevTypes{ GGML_BACKEND_DEVICE_TYPE_GPU , GGML_BACKEND_DEVICE_TYPE_IGPU , GGML_BACKEND_DEVICE_TYPE_GPU ,
60+ GGML_BACKEND_DEVICE_TYPE_CPU , GGML_BACKEND_DEVICE_TYPE_IGPU }),
6361 (Order{ 0 , 2 , 1 , 4 }));
6462
6563 return g_failures == 0 ? EXIT_SUCCESS : EXIT_FAILURE ;
0 commit comments