From 8008463aeea5fcea89e8bc39351cb297fc749b28 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sat, 24 Aug 2024 15:36:02 -0700 Subject: [PATCH] threadpool: replace checks for compute_thread ret code with proper status check --- ggml/src/ggml.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 839aa3f57..f0a70138f 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -19218,13 +19218,9 @@ static thread_ret_t ggml_graph_compute_secondary_thread(void* data) { if (state->pending) { state->pending = false; - int64_t ret = (int64_t) ggml_graph_compute_thread(state); - if (ret == GGML_EXIT_ABORTED) - return (thread_ret_t) ret; - - if (ret != GGML_EXIT_SUCCESS && ret != GGML_EXIT_ABORTED) { - fprintf(stderr, "ggml_graph_compute_thread exited with an unexpected error: %lld\n", (long long int) ret); - GGML_ASSERT(false); + ggml_graph_compute_thread(state); + if (state->threadpool->ec != GGML_STATUS_SUCCESS) { + break; } } }