revert synchronization change to ggml_init
Some checks failed
flake8 Lint / Lint (push) Has been cancelled

This commit is contained in:
slaren 2024-11-03 16:28:22 +01:00
parent 673f95bd04
commit 0825ba2fca

View File

@ -1402,9 +1402,10 @@ static inline bool ggml_can_repeat_rows(const struct ggml_tensor * t0, const str
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
struct ggml_context * ggml_init(struct ggml_init_params params) { struct ggml_context * ggml_init(struct ggml_init_params params) {
static volatile bool is_first_call = false; static bool is_first_call = false;
if (!is_first_call) {
ggml_critical_section_start(); ggml_critical_section_start();
if (!is_first_call) { if (!is_first_call) {
// initialize time system (required on Windows) // initialize time system (required on Windows)
ggml_time_init(); ggml_time_init();
@ -1418,8 +1419,8 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
} }
is_first_call = true; is_first_call = true;
} }
ggml_critical_section_end(); ggml_critical_section_end();
}
struct ggml_context * ctx = GGML_MALLOC(sizeof(struct ggml_context)); struct ggml_context * ctx = GGML_MALLOC(sizeof(struct ggml_context));