]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
[UT] enhance UT to show all real unsupported backends (#25234)
authorNeo Zhang <redacted>
Thu, 30 Jul 2026 06:04:58 +0000 (14:04 +0800)
committerGitHub <redacted>
Thu, 30 Jul 2026 06:04:58 +0000 (14:04 +0800)
* enhance UT to show real unsupported backends

* cont : simplify

---------

Co-authored-by: Georgi Gerganov <redacted>
tests/test-backend-ops.cpp

index a5b660f47a0a60c0caf1159dfe8d878f3989633f..d0eb173a8f176680a6307e7d0021c31736b5c909 100644 (file)
@@ -1350,18 +1350,22 @@ struct test_case {
 
         // check if the backends support the ops
         bool supported = true;
+        std::string unsupported_str;
         for (ggml_backend_t backend : {backend1, backend2}) {
             for (ggml_tensor * t = ggml_get_first_tensor(ctx.get()); t != NULL; t = ggml_get_next_tensor(ctx.get(), t)) {
                 if (!ggml_backend_supports_op(backend, t)) {
                     supported = false;
-                    break;
+                    if (unsupported_str.empty()) {
+                        unsupported_str = std::string(ggml_backend_name(backend));
+                    } else {
+                        unsupported_str += ", " + std::string(ggml_backend_name(backend));
+                    }
                 }
             }
         }
 
         if (!supported) {
-            // Create test result for unsupported operation
-            test_result result(ggml_backend_name(backend1), current_op_name, vars(), "test",
+            test_result result(unsupported_str, current_op_name, vars(), "test",
                              false, false, "not supported");
 
             print_test_result_locked(output_printer, result);