Skip to content

Commit 1c55fd6

Browse files
committed
ggml-cpu : set openmp wait policy to active if not set
1 parent 259469c commit 1c55fd6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,12 @@ void ggml_cpu_init(void) {
34843484
const uint64_t t_end = ggml_time_us(); UNUSED(t_end);
34853485

34863486
GGML_PRINT_DEBUG("%s: GELU, Quick GELU, SILU and EXP tables initialized in %f ms\n", __func__, (t_end - t_start)/1000.0);
3487+
3488+
#ifdef GGML_USE_OPENMP
3489+
if (!getenv("OMP_WAIT_POLICY")) {
3490+
putenv("OMP_WAIT_POLICY=active");
3491+
}
3492+
#endif
34873493
}
34883494

34893495
#if defined(__ARM_ARCH)

0 commit comments

Comments
 (0)