From 2592774fe8f1aa646e4a5e2e4f918bb855427efd Mon Sep 17 00:00:00 2001 From: Edward Smyth Date: Tue, 13 Dec 2022 06:55:43 -0500 Subject: [PATCH] BLIS: Nested Parallelism issues (3) Bugfix for parallel BLAS1 and BLAS2 routines. Threading information was not being set correctly when initializing local rntm from global. Also ensure th_rntm is initialized along with global_rntm by updating it in bli_thread_init(), called by bli_init_once() AMD-Internal: [CPUPL-2433] Change-Id: Iba658f87ae13fe16a57ca1fc279e149b7fa294cf --- frame/base/bli_rntm.c | 5 ++++- frame/thread/bli_thread.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frame/base/bli_rntm.c b/frame/base/bli_rntm.c index b26322b47..79782c282 100644 --- a/frame/base/bli_rntm.c +++ b/frame/base/bli_rntm.c @@ -54,9 +54,12 @@ void bli_rntm_init_from_global( rntm_t* rntm ) dim_t jc, pc, ic, jr, ir; - // We must ensure that global_rntm and tl_rntm have been initialized. + // We must ensure that global_rntm has been initialized bli_init_once(); + // We must also ensure that tl_rntm has been updated. + bli_thread_update_tl(); + // Acquire the mutex protecting global_rntm. bli_pthread_mutex_lock( &global_rntm_mutex ); diff --git a/frame/thread/bli_thread.c b/frame/thread/bli_thread.c index dd73d91b4..fe4b5ce25 100644 --- a/frame/thread/bli_thread.c +++ b/frame/thread/bli_thread.c @@ -64,6 +64,8 @@ void bli_thread_init( void ) // to ensure all thread local get information from any BLIS environment // variables set, as these are not re-read for performance reasons. bli_thread_init_rntm_from_env( &global_rntm ); + // Initialize tl_rntm. + bli_thread_update_rntm_from_env( &tl_rntm ); } void bli_thread_update_tl( void )