Skip to content

Commit 2f7a8b5

Browse files
committed
Add support for setting/getting theading information for NVPL
NVPL splits the threading control for the BLAS and LAPACK libraries, so we should set both of them.
1 parent f26278e commit 2f7a8b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/threading.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@
1515
* libblastrampoline will propagate the call through to its loaded libraries as long as the
1616
* library exposes a getter/setter method named in one of these arrays, and its signature
1717
* matches the common theme here.
18+
*
19+
* For the getters, the function signature should match:
20+
* int get_num_threads()
21+
* For the setters, the function signature should match:
22+
* void set_num_threads(int numThreads)
1823
*/
1924
static char * getter_names[MAX_THREADING_NAMES] = {
2025
"openblas_get_num_threads",
2126
"bli_thread_get_num_threads",
27+
// There isn't a non-max NVPL function for this
28+
"nvpl_blas_get_max_threads",
29+
"nvpl_lapack_get_max_threads",
2230
// We special-case MKL in the lookup loop below
2331
//"MKL_Domain_Get_Max_Threads",
2432
NULL
@@ -27,6 +35,8 @@ static char * getter_names[MAX_THREADING_NAMES] = {
2735
static char * setter_names[MAX_THREADING_NAMES] = {
2836
"openblas_set_num_threads",
2937
"bli_thread_set_num_threads",
38+
"nvpl_blas_set_num_threads",
39+
"nvpl_lapack_set_num_threads",
3040
// We special-case MKL in the lookup loop below
3141
//"MKL_Domain_Set_Num_Threads",
3242
NULL

0 commit comments

Comments
 (0)