USE NPROCESSOR_CONF instaed of NPORCESSOR_ONLN
to determine the number of CPU. In ARM platform, online CPU will increasing when there is more workload. while configure cpu is the max number of CPU.
This commit is contained in:
parent
161c927071
commit
ff1da01476
|
@ -814,7 +814,7 @@ void gotoblas_affinity_init(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//returns the number of processors which are currently online
|
//returns the number of processors which are currently online
|
||||||
common -> num_procs = sysconf(_SC_NPROCESSORS_ONLN);;
|
common -> num_procs = sysconf(_SC_NPROCESSORS_CONF);;
|
||||||
|
|
||||||
if(common -> num_procs > MAX_CPUS) {
|
if(common -> num_procs > MAX_CPUS) {
|
||||||
fprintf(stderr, "\nOpenBLAS Warining : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
|
fprintf(stderr, "\nOpenBLAS Warining : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
|
||||||
|
@ -923,7 +923,7 @@ void gotoblas_set_affinity2(int threads) {};
|
||||||
|
|
||||||
void gotoblas_affinity_reschedule(void) {};
|
void gotoblas_affinity_reschedule(void) {};
|
||||||
|
|
||||||
int get_num_procs(void) { return sysconf(_SC_NPROCESSORS_ONLN); }
|
int get_num_procs(void) { return sysconf(_SC_NPROCESSORS_CONF); }
|
||||||
|
|
||||||
int get_num_nodes(void) { return 1; }
|
int get_num_nodes(void) { return 1; }
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ int get_num_procs(void);
|
||||||
#else
|
#else
|
||||||
int get_num_procs(void) {
|
int get_num_procs(void) {
|
||||||
static int nums = 0;
|
static int nums = 0;
|
||||||
if (!nums) nums = sysconf(_SC_NPROCESSORS_ONLN);
|
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
|
||||||
return nums;
|
return nums;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -184,7 +184,7 @@ int get_num_procs(void) {
|
||||||
#ifdef OS_ANDROID
|
#ifdef OS_ANDROID
|
||||||
int get_num_procs(void) {
|
int get_num_procs(void) {
|
||||||
static int nums = 0;
|
static int nums = 0;
|
||||||
if (!nums) nums = sysconf(_SC_NPROCESSORS_ONLN);
|
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
|
||||||
return nums;
|
return nums;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -971,7 +971,7 @@ static int get_num_cores(void) {
|
||||||
|
|
||||||
#if defined(linux) || defined(__sun__)
|
#if defined(linux) || defined(__sun__)
|
||||||
//returns the number of processors which are currently online
|
//returns the number of processors which are currently online
|
||||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
return sysconf(_SC_NPROCESSORS_CONF);
|
||||||
|
|
||||||
#elif defined(OS_WINDOWS)
|
#elif defined(OS_WINDOWS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue