Skip to content

Commit dd38fd4

Browse files
authored
support arm core > 128 (#7857)
1 parent 4258cdf commit dd38fd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lite/core/device_info.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ const int DEFAULT_L3_CACHE_SIZE = 0;
101101
int get_cpu_num() {
102102
#ifdef LITE_WITH_LINUX
103103
// get cpu count from /sys/devices/system/cpu/cpunum/uevent
104-
int max_cpu_num = 128;
105104
int cpu_num = 0;
106-
for (int i = 0; i < max_cpu_num; ++i) {
105+
while (true) {
107106
char path[256];
108-
snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/uevent", i);
107+
snprintf(
108+
path, sizeof(path), "/sys/devices/system/cpu/cpu%d/uevent", cpu_num);
109109
FILE* fp = fopen(path, "rb");
110110
if (!fp) {
111111
break;

0 commit comments

Comments
 (0)