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) {
2426
2426
2427
2427
if (prio != GGML_SCHED_PRIO_LOW ) {
2428
2428
// 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
2430
2430
// all our threads onto the first 4 cores which results in terrible performance with
2431
2431
// 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 ))) {
2439
2440
GGML_LOG_DEBUG ("failed to disable thread power throttling %d : (%d)\n" , prio , (int ) GetLastError ());
2440
2441
return false;
2441
2442
}
2443
+ #endif
2442
2444
}
2443
2445
2444
2446
if (prio == GGML_SCHED_PRIO_NORMAL ) {
You can’t perform that action at this time.
0 commit comments