7070int blas_server_avail = 0 ;
7171int blas_omp_number_max = 0 ;
7272int blas_omp_threads_local = 1 ;
73+ int blas_is_num_threads_set_explicitly = 0 ; // tracks whether the user called openblas_set_num_threads()
7374
7475extern int openblas_omp_adaptive_env (void );
7576
@@ -118,7 +119,7 @@ void goto_set_num_threads(int num_threads) {
118119
119120}
120121void openblas_set_num_threads (int num_threads ) {
121-
122+ blas_is_num_threads_set_explicitly = 1 ;
122123 goto_set_num_threads (num_threads );
123124}
124125
@@ -141,7 +142,7 @@ extern int openblas_omp_num_threads_env(void);
141142
142143 if (blas_omp_number_max <= 0 )
143144 blas_omp_number_max = openblas_omp_num_threads_env ();
144- if (blas_omp_number_max <= 0 )
145+ if (blas_omp_number_max <= 0 )
145146 blas_omp_number_max = MAX_CPU_NUMBER ;
146147#else
147148 blas_omp_number_max = omp_get_max_threads ();
@@ -361,14 +362,14 @@ static void exec_threads(int thread_num, blas_queue_t *queue, int buf_index){
361362#ifdef BUILD_COMPLEX16
362363 sb = (void * )(((BLASLONG )sa + ((ZGEMM_P * ZGEMM_Q * 2 * sizeof (double )
363364 + GEMM_ALIGN ) & ~GEMM_ALIGN )) + GEMM_OFFSET_B );
364- #else
365+ #else
365366fprintf (stderr ,"UNHANDLED COMPLEX16\n" );
366367#endif
367368 } else if ((queue -> mode & BLAS_PREC ) == BLAS_SINGLE ) {
368369#ifdef BUILD_COMPLEX
369370 sb = (void * )(((BLASLONG )sa + ((CGEMM_P * CGEMM_Q * 2 * sizeof (float )
370371 + GEMM_ALIGN ) & ~GEMM_ALIGN )) + GEMM_OFFSET_B );
371- #else
372+ #else
372373fprintf (stderr ,"UNHANDLED COMPLEX\n" );
373374#endif
374375 } else {
0 commit comments