Skip to content

Commit 2f195f5

Browse files
committed
Guard ThreadPowerThrottling block with #if defined(_MSC_VER) to avoid MinGW compile errors
1 parent 261e6a2 commit 2f195f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
24292429
// 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+
#if defined(_MSC_VER)
2433+
24322434
#if _WIN32_WINNT >= 0x0602
24332435
THREAD_POWER_THROTTLING_STATE t;
24342436
ZeroMemory(&t, sizeof(t));
@@ -2441,6 +2443,7 @@ static bool ggml_thread_apply_priority(int32_t prio) {
24412443
return false;
24422444
}
24432445
#endif
2446+
#endif
24442447
}
24452448

24462449
if (prio == GGML_SCHED_PRIO_NORMAL) {

0 commit comments

Comments
 (0)