mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 03:14:35 +00:00
Fix Linux /sys cpu path to guess number of cores (#7064)
This commit is contained in:
parent
03fb8a002d
commit
fcd84a0f5a
@ -76,7 +76,7 @@ int32_t get_num_physical_cores() {
|
|||||||
// enumerate the set of thread siblings, num entries is num cores
|
// enumerate the set of thread siblings, num entries is num cores
|
||||||
std::unordered_set<std::string> siblings;
|
std::unordered_set<std::string> siblings;
|
||||||
for (uint32_t cpu=0; cpu < UINT32_MAX; ++cpu) {
|
for (uint32_t cpu=0; cpu < UINT32_MAX; ++cpu) {
|
||||||
std::ifstream thread_siblings("/sys/devices/system/cpu"
|
std::ifstream thread_siblings("/sys/devices/system/cpu/cpu"
|
||||||
+ std::to_string(cpu) + "/topology/thread_siblings");
|
+ std::to_string(cpu) + "/topology/thread_siblings");
|
||||||
if (!thread_siblings.is_open()) {
|
if (!thread_siblings.is_open()) {
|
||||||
break; // no more cpus
|
break; // no more cpus
|
||||||
|
Loading…
Reference in New Issue
Block a user