]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
tests : fix test-quantize-fns to init the CPU backend (llama/12306)
authorGeorgi Gerganov <redacted>
Mon, 10 Mar 2025 12:07:15 +0000 (14:07 +0200)
committerGeorgi Gerganov <redacted>
Thu, 27 Mar 2025 07:35:24 +0000 (09:35 +0200)
ggml-ci

tests/test-quantize-fns.cpp

index c77c8ed1388d74d48583fd2473cf3e4a2dc295b3..037c0582bbbf8005cdb18729b0ddbd0adc63bb96 100644 (file)
@@ -120,13 +120,7 @@ int main(int argc, char * argv[]) {
     generate_data(0.0, test_data.size(), test_data.data());
     generate_data(1.0, test_data2.size(), test_data2.data());
 
-    // Initialize GGML, ensures float conversion tables are initialized
-    struct ggml_init_params ggml_params = {
-        /* .mem_size   = */ 1*1024,
-        /* .mem_buffer = */ NULL,
-        /* .no_alloc   = */ true,
-    };
-    struct ggml_context * ctx = ggml_init(ggml_params);
+    ggml_cpu_init();
 
     int num_failed = 0;
     bool failed = false;
@@ -188,7 +182,5 @@ int main(int argc, char * argv[]) {
         printf("%d tests failed\n", num_failed);
     }
 
-    ggml_free(ctx);
-
     return num_failed > 0;
 }