Merge pull request #1557 from martin-frbg/getconfig

Add threading and OpenMP information to output
This commit is contained in:
Martin Kroeker 2018-05-14 17:37:55 +02:00 committed by GitHub
commit 191746c493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 5 deletions

View File

@ -54,6 +54,9 @@ static char* openblas_config_str=""
#ifdef NO_AFFINITY #ifdef NO_AFFINITY
"NO_AFFINITY " "NO_AFFINITY "
#endif #endif
#ifdef USE_OPENMP
"USE_OPENMP "
#endif
#ifndef DYNAMIC_ARCH #ifndef DYNAMIC_ARCH
CHAR_CORENAME CHAR_CORENAME
#endif #endif
@ -61,18 +64,23 @@ static char* openblas_config_str=""
#ifdef DYNAMIC_ARCH #ifdef DYNAMIC_ARCH
char *gotoblas_corename(); char *gotoblas_corename();
static char tmp_config_str[256];
#endif #endif
static char tmp_config_str[256];
int openblas_get_parallel();
char* CNAME() { char* CNAME() {
#ifndef DYNAMIC_ARCH char tmpstr[20];
return openblas_config_str;
#else
strcpy(tmp_config_str, openblas_config_str); strcpy(tmp_config_str, openblas_config_str);
#ifdef DYNAMIC_ARCH
strcat(tmp_config_str, gotoblas_corename()); strcat(tmp_config_str, gotoblas_corename());
return tmp_config_str;
#endif #endif
if (openblas_get_parallel() == 0)
sprintf(tmpstr, " SINGLE_THREADED");
else
snprintf(tmpstr,19," MAX_THREADS=%d",MAX_CPU_NUMBER);
strcat(tmp_config_str, tmpstr);
return tmp_config_str;
} }
@ -83,3 +91,4 @@ char* openblas_get_corename() {
return gotoblas_corename(); return gotoblas_corename();
#endif #endif
} }