Browse Source

Fix openblas_get_num_threads and openblas_get_num_procs bug with single thread.

tags/v0.2.14^2
Zhang Xianyi 11 years ago
parent
commit
cfa9392ffa
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      driver/others/memory.c

+ 13
- 3
driver/others/memory.c View File

@@ -241,9 +241,6 @@ void set_stack_limit(int limitMB){
*/
#endif

int openblas_get_num_procs(void) {
return get_num_procs();
}

/*
OpenBLAS uses the numbers of CPU cores in multithreading.
@@ -327,8 +324,21 @@ int blas_get_cpu_number(void){
}
#endif


int openblas_get_num_procs(void) {
#ifndef SMP
return 1;
#else
return get_num_procs();
#endif
}

int openblas_get_num_threads(void) {
#ifndef SMP
return 1;
#else
return blas_get_cpu_number();
#endif
}

struct release_t {


Loading…
Cancel
Save