From 5c048a90d8dfa1dbde4e45fbc10ffcbdfe59d960 Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Wed, 14 May 2014 16:20:06 -0500 Subject: [PATCH] Disabled parallelism for right-sided TRMM JC loop The loop has dependent iterations. --- frame/3/trmm/bli_trmm_front.c | 2 +- frame/3/trmm/bli_trmm_threading.c | 14 +++++++++++--- frame/3/trmm/bli_trmm_threading.h | 2 +- frame/3/trmm3/bli_trmm3_front.c | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frame/3/trmm/bli_trmm_front.c b/frame/3/trmm/bli_trmm_front.c index d8caba7dc..dea8b7771 100644 --- a/frame/3/trmm/bli_trmm_front.c +++ b/frame/3/trmm/bli_trmm_front.c @@ -125,7 +125,7 @@ void bli_trmm_front( side_t side, if ( bli_is_left( side ) ) cntl = l_cntl; else cntl = r_cntl; - trmm_thrinfo_t** infos = bli_create_trmm_thrinfo_paths(); + trmm_thrinfo_t** infos = bli_create_trmm_thrinfo_paths( !bli_is_left( side ) ); dim_t n_threads = thread_num_threads( infos[0] ); // Invoke the internal back-end. diff --git a/frame/3/trmm/bli_trmm_threading.c b/frame/3/trmm/bli_trmm_threading.c index 7c675bbb7..fd9fe8e44 100644 --- a/frame/3/trmm/bli_trmm_threading.c +++ b/frame/3/trmm/bli_trmm_threading.c @@ -108,15 +108,23 @@ void bli_trmm_thrinfo_free_paths( trmm_thrinfo_t** threads, dim_t num ) bli_free( threads ); } -trmm_thrinfo_t** bli_create_trmm_thrinfo_paths( ) +trmm_thrinfo_t** bli_create_trmm_thrinfo_paths( bool_t jc_dependency ) { #ifdef BLIS_ENABLE_MULTITHREADING - dim_t jc_way = bli_read_nway_from_env( "BLIS_JC_NT" ); // dim_t kc_way = bli_read_nway_from_env( "BLIS_KC_NT" ); dim_t kc_way = 1; dim_t ic_way = bli_read_nway_from_env( "BLIS_IC_NT" ); - dim_t jr_way = bli_read_nway_from_env( "BLIS_JR_NT" ); dim_t ir_way = bli_read_nway_from_env( "BLIS_IR_NT" ); + + if( !jc_dependency ){ + dim_t jc_way = bli_read_nway_from_env( "BLIS_JC_NT" ); + dim_t jr_way = bli_read_nway_from_env( "BLIS_JR_NT" ); + } + else + { + dim_t jc_way = 1; + dim_t jr_way = bli_read_nway_from_env( "BLIS_JC_NT" ) * bli_read_nway_from_env( "BLIS_JR_NT" ); + } #else dim_t jc_way = 1; dim_t kc_way = 1; diff --git a/frame/3/trmm/bli_trmm_threading.h b/frame/3/trmm/bli_trmm_threading.h index 3b4ebd743..dadc65912 100644 --- a/frame/3/trmm/bli_trmm_threading.h +++ b/frame/3/trmm/bli_trmm_threading.h @@ -58,7 +58,7 @@ typedef struct trmm_thrinfo_s trmm_thrinfo_t; #define trmm_l_ir_my_iter( index, thread ) ( index % thread->n_way == thread->work_id % thread->n_way ) #define trmm_l_jr_my_iter( index, thread ) ( index % thread->n_way == thread->work_id % thread->n_way ) -trmm_thrinfo_t** bli_create_trmm_thrinfo_paths( ); +trmm_thrinfo_t** bli_create_trmm_thrinfo_paths( bool_t jc_dependency ); void bli_trmm_thrinfo_free_paths( trmm_thrinfo_t** info, dim_t n_threads ); void bli_setup_trmm_thrinfo_node( trmm_thrinfo_t* thread, diff --git a/frame/3/trmm3/bli_trmm3_front.c b/frame/3/trmm3/bli_trmm3_front.c index 6f8757faa..16c41154d 100644 --- a/frame/3/trmm3/bli_trmm3_front.c +++ b/frame/3/trmm3/bli_trmm3_front.c @@ -127,7 +127,7 @@ void bli_trmm3_front( side_t side, if ( bli_is_left( side ) ) cntl = l_cntl; else cntl = r_cntl; - trmm_thrinfo_t** infos = bli_create_trmm_thrinfo_paths(); + trmm_thrinfo_t** infos = bli_create_trmm_thrinfo_paths( FALSE ); dim_t n_threads = thread_num_threads( infos[0] ); // Invoke the internal back-end.