threadpool: replace checks for compute_thread ret code with proper status check

This commit is contained in:
Max Krasnyansky 2024-08-24 15:36:02 -07:00 committed by fmz
parent c506d7fc46
commit 8008463aee

View file

@ -19218,13 +19218,9 @@ static thread_ret_t ggml_graph_compute_secondary_thread(void* data) {
if (state->pending) { if (state->pending) {
state->pending = false; state->pending = false;
int64_t ret = (int64_t) ggml_graph_compute_thread(state); ggml_graph_compute_thread(state);
if (ret == GGML_EXIT_ABORTED) if (state->threadpool->ec != GGML_STATUS_SUCCESS) {
return (thread_ret_t) ret; break;
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);
} }
} }
} }