Skip to content

Commit 1d1e6e8

Browse files
committed
fix build bug on msys2-clang64 and ucrt64
1 parent 079ac82 commit 1d1e6e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

common/common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ int32_t cpu_get_num_cores_win(bool print_physical_core_num) {
9797
num_cores_win += info->Processor.GroupCount;
9898
} else {
9999
for (WORD i = 0; i < info->Processor.GroupCount; ++i) {
100+
#ifdef _MSC_VER
100101
num_cores_win += __popcnt64(info->Processor.GroupMask[i].Mask);
102+
#else
103+
num_cores_win += _popcnt64(info->Processor.GroupMask[i].Mask);
104+
#endif
101105
}
102106
}
103107
}

common/common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ struct llama_control_vector_load_info;
4444
//
4545
// CPU utils
4646
//
47-
47+
#ifdef _WIN32
48+
int32_t cpu_get_num_cores_win(bool print_physical_core_num);
49+
#endif
4850
int32_t cpu_get_num_physical_cores();
4951
int32_t cpu_get_num_math();
5052

0 commit comments

Comments
 (0)