Skip to content

Commit 191746c

Browse files
authored
Merge pull request #1557 from martin-frbg/getconfig
Add threading and OpenMP information to output
2 parents 9c1aa0b + 41ae8e8 commit 191746c

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

driver/others/openblas_get_config.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,33 @@ static char* openblas_config_str=""
5454
#ifdef NO_AFFINITY
5555
"NO_AFFINITY "
5656
#endif
57+
#ifdef USE_OPENMP
58+
"USE_OPENMP "
59+
#endif
5760
#ifndef DYNAMIC_ARCH
5861
CHAR_CORENAME
5962
#endif
6063
;
6164

6265
#ifdef DYNAMIC_ARCH
6366
char *gotoblas_corename();
64-
static char tmp_config_str[256];
6567
#endif
6668

69+
static char tmp_config_str[256];
70+
int openblas_get_parallel();
6771

6872
char* CNAME() {
69-
#ifndef DYNAMIC_ARCH
70-
return openblas_config_str;
71-
#else
73+
char tmpstr[20];
7274
strcpy(tmp_config_str, openblas_config_str);
75+
#ifdef DYNAMIC_ARCH
7376
strcat(tmp_config_str, gotoblas_corename());
74-
return tmp_config_str;
7577
#endif
78+
if (openblas_get_parallel() == 0)
79+
sprintf(tmpstr, " SINGLE_THREADED");
80+
else
81+
snprintf(tmpstr,19," MAX_THREADS=%d",MAX_CPU_NUMBER);
82+
strcat(tmp_config_str, tmpstr);
83+
return tmp_config_str;
7684
}
7785

7886

@@ -83,3 +91,4 @@ char* openblas_get_corename() {
8391
return gotoblas_corename();
8492
#endif
8593
}
94+

0 commit comments

Comments
 (0)