CoreAndroidCPUCores.diff
Core.upp (kopia robocza) | ||
---|---|---|
23 | 23 | |
24 | 24 |
library(!WIN32) z; |
25 | 25 | |
26 |
static_library(ANDROID) cpufeatures; |
|
27 | ||
26 | 28 |
options(XGNU) -O0; |
27 | 29 | |
28 | 30 |
options(XGNU) -ffunction-sections; |
Cpu.cpp (kopia robocza) | ||
---|---|---|
102 | 102 |
#else |
103 | 103 | |
104 | 104 |
#ifdef PLATFORM_LINUX |
105 |
#include <sys/sysinfo.h> |
|
106 | ||
107 |
int CPU_Cores() |
|
108 |
{ |
|
109 | 105 |
#ifdef PLATFORM_ANDROID |
110 |
return 1; |
|
106 |
#include <cpu-features.h> |
|
107 |
|
|
108 |
int CPU_Cores() |
|
109 |
{ |
|
110 |
return android_getCpuCount(); |
|
111 |
} |
|
112 |
|
|
111 | 113 |
#else |
114 |
#include <sys/sysinfo.h> |
|
115 | ||
116 |
int CPU_Cores() |
|
117 |
{ |
|
112 | 118 |
return minmax(get_nprocs(), 1, 256); |
119 |
} |
|
113 | 120 |
#endif |
114 |
} |
|
115 | 121 |
#else |
116 | 122 |
int CPU_Cores() |
117 | 123 |
{ |