diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index c131290849538..b90d5982f376e 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -2429,6 +2429,8 @@ static bool ggml_thread_apply_priority(int32_t prio) { // Newer Windows 11 versions aggresively park (offline) CPU cores and often place // all our threads onto the first 4 cores which results in terrible performance with // n_threads > 4 + #if defined(_MSC_VER) + #if _WIN32_WINNT >= 0x0602 THREAD_POWER_THROTTLING_STATE t; ZeroMemory(&t, sizeof(t)); @@ -2441,6 +2443,7 @@ static bool ggml_thread_apply_priority(int32_t prio) { return false; } #endif + #endif } if (prio == GGML_SCHED_PRIO_NORMAL) {