mirror of
https://github.com/amd/blis.git
synced 2026-06-29 18:57:23 +00:00
Fix OMP nesting problem.
Detect when OpenMP uses fewer threads than requested and correct accordingly, so that we don't wait forever for nonexistent threads. Fixes #267.
This commit is contained in:
@@ -230,7 +230,18 @@ void bli_l3_thread_decorator
|
||||
|
||||
_Pragma( "omp parallel num_threads(n_threads)" )
|
||||
{
|
||||
dim_t n_threads_real = omp_get_num_threads();
|
||||
dim_t id = omp_get_thread_num();
|
||||
|
||||
if ( n_threads_real != n_threads )
|
||||
{
|
||||
if ( id == 0 )
|
||||
{
|
||||
n_threads = n_threads_real;
|
||||
bli_thrcomm_init( gl_comm, n_threads );
|
||||
}
|
||||
_Pragma( "omp barrier" )
|
||||
}
|
||||
|
||||
obj_t a_t, b_t, c_t;
|
||||
cntl_t* cntl_use;
|
||||
|
||||
Reference in New Issue
Block a user