File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2426,19 +2426,21 @@ static bool ggml_thread_apply_priority(int32_t prio) {
24262426
24272427 if (prio != GGML_SCHED_PRIO_LOW ) {
24282428 // Tell Windows that this thread should not be throttled (needs its own CPU core).
2429- // Newer Windows 11 ARM64 versions aggresively park (offline) CPU cores and often place
2429+ // Newer Windows 11 versions aggresively park (offline) CPU cores and often place
24302430 // all our threads onto the first 4 cores which results in terrible performance with
24312431 // n_threads > 4
2432- THREAD_POWER_THROTTLING_STATE p ;
2433- ZeroMemory (& p , sizeof (p ));
2434- p .Version = THREAD_POWER_THROTTLING_CURRENT_VERSION ;
2435- p .ControlMask = THREAD_POWER_THROTTLING_EXECUTION_SPEED ;
2436- p .StateMask = 0 ;
2437-
2438- if (!SetThreadInformation (GetCurrentThread (), ThreadPowerThrottling , & p , sizeof (p ))) {
2432+ #if _WIN32_WINNT >= 0x0602
2433+ THREAD_POWER_THROTTLING_STATE t ;
2434+ ZeroMemory (& t , sizeof (t ));
2435+ t .Version = THREAD_POWER_THROTTLING_CURRENT_VERSION ;
2436+ t .ControlMask = THREAD_POWER_THROTTLING_EXECUTION_SPEED ;
2437+ t .StateMask = 0 ;
2438+
2439+ if (!SetThreadInformation (GetCurrentThread (), ThreadPowerThrottling , & t , sizeof (t ))) {
24392440 GGML_LOG_DEBUG ("failed to disable thread power throttling %d : (%d)\n" , prio , (int ) GetLastError ());
24402441 return false;
24412442 }
2443+ #endif
24422444 }
24432445
24442446 if (prio == GGML_SCHED_PRIO_NORMAL ) {
You can’t perform that action at this time.
0 commit comments