From 39ffed8d03af65c2eb4b653da9995da9380e4bd0 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Tue, 18 Feb 2020 15:16:03 -0600 Subject: [PATCH] Skip building thrinfo_t tree when mt is disabled. Details: - Return early from bli_thrinfo_sup_grow() if the thrinfo_t object address is equal to either &BLIS_GEMM_SINGLE_THREADED or &BLIS_PACKM_SINGLE_THREADED. - Added preprocessor logic to bli_l3_sup_thread_decorator() in bli_l3_sup_decor_single.c that (by default) disables code that creates and frees the thrinfo_t tree and instead passes &BLIS_GEMM_SINGLE_THREADED as the thrinfo_t pointer into the sup implementation. - The net effect of the above changes is that a small amount of thrinfo_t overhead is avoided when running small/skinny dgemm problems when BLIS is compiled with multithreading disabled. --- frame/thread/bli_thrinfo_sup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frame/thread/bli_thrinfo_sup.c b/frame/thread/bli_thrinfo_sup.c index e63df52f0..416cd9799 100644 --- a/frame/thread/bli_thrinfo_sup.c +++ b/frame/thread/bli_thrinfo_sup.c @@ -42,6 +42,9 @@ void bli_thrinfo_sup_grow thrinfo_t* thread ) { + if ( thread == &BLIS_GEMM_SINGLE_THREADED || + thread == &BLIS_PACKM_SINGLE_THREADED ) return; + // NOTE: If bli_thrinfo_sup_rgrow() is being called, the sub_node field will // always be non-NULL, and so there's no need to check it. //if ( bli_cntl_sub_node( cntl ) != NULL )