]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : fix n_threads_cur initialization with one thread (llama/9538)
authorslaren <redacted>
Wed, 18 Sep 2024 17:13:08 +0000 (19:13 +0200)
committerGeorgi Gerganov <redacted>
Fri, 20 Sep 2024 19:03:57 +0000 (22:03 +0300)
* ggml : fix n_threads_cur initialization with one thread

* Update ggml/src/ggml.c

---------

Co-authored-by: Max Krasnyansky <redacted>
src/ggml.c

index 368d5e6295d64244e3cb0a58b5376b61756dcc47..8baeca06813e427051add2a1241c31d68ffed911 100644 (file)
@@ -20444,6 +20444,7 @@ enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cpl
             ggml_graph_compute_thread(&threadpool->workers[omp_get_thread_num()]);
         }
     } else {
+        atomic_store_explicit(&threadpool->n_threads_cur, 1, memory_order_relaxed);
         ggml_graph_compute_thread(&threadpool->workers[0]);
     }
 #else