File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868#endif
6969
7070int blas_server_avail = 0 ;
71+ int blas_omp_number_max = 0 ;
7172
7273extern int openblas_omp_adaptive_env ();
7374
@@ -100,7 +101,6 @@ static void adjust_thread_buffers() {
100101
101102void goto_set_num_threads (int num_threads ) {
102103
103- blas_num_threads_set = 1 ;
104104 if (num_threads < 0 ) blas_num_threads_set = 0 ;
105105 if (num_threads < 1 ) num_threads = blas_num_threads ;
106106
@@ -125,6 +125,8 @@ void openblas_set_num_threads(int num_threads) {
125125}
126126
127127int blas_thread_init (void ){
128+ if (blas_omp_number_max <= 0 )
129+ blas_omp_number_max = omp_get_max_threads ();
128130
129131 blas_get_cpu_number ();
130132
Original file line number Diff line number Diff line change @@ -422,8 +422,6 @@ This value is equal or large than blas_cpu_number. This means some threads are s
422422*/
423423int blas_num_threads = 0 ;
424424
425- int blas_num_threads_set = 0 ;
426-
427425int goto_get_num_procs (void ) {
428426 return blas_cpu_number ;
429427}
@@ -1996,8 +1994,6 @@ This value is equal or large than blas_cpu_number. This means some threads are s
19961994*/
19971995int blas_num_threads = 0 ;
19981996
1999- int blas_num_threads_set = 0 ;
2000-
20011997int goto_get_num_procs (void ) {
20021998 return blas_cpu_number ;
20031999}
Original file line number Diff line number Diff line change @@ -283,7 +283,6 @@ The numbers of threads in the thread pool.
283283This value is equal or large than blas_cpu_number. This means some threads are sleep.
284284*/
285285int blas_num_threads = 0 ;
286- int blas_num_threads_set = 0 ;
287286
288287int goto_get_num_procs (void ) {
289288 return blas_cpu_number ;
You can’t perform that action at this time.
0 commit comments