From eac7d267a017d646a2c5b4fa565f4637ebfd9da7 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Mon, 22 Oct 2018 18:10:59 -0500 Subject: [PATCH] Unconditionally define bli_l3_thread_entry(). Details: - Define a dummy bli_l3_thread_entry() function when multithreading is disabled altogether, or enabled via OpenMP. This function was originally necessary when multithreading is enabled via pthreads. By defining the function no matter the threading options given, it is less likely that an AppVeyor Windows build will complain due to a missing symbol in the DLL. (To be clear: AppVeyor was working fine before, but a problem may have arisen if it were switched to an OpenMP build.) - Removed the prototype for bli_l3_thread_entry() from bli_thrcomm_pthreads.c and placed it in bli_thrcomm.h. - Regenerated the symbols list file build/libblis-symbols.def. --- build/libblis-symbols.def | 1 + frame/thread/bli_thrcomm.h | 4 ++++ frame/thread/bli_thrcomm_openmp.c | 5 +++++ frame/thread/bli_thrcomm_pthreads.c | 2 -- frame/thread/bli_thrcomm_single.c | 5 +++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build/libblis-symbols.def b/build/libblis-symbols.def index 152e1a9a0..e15f688aa 100644 --- a/build/libblis-symbols.def +++ b/build/libblis-symbols.def @@ -1281,6 +1281,7 @@ bli_l3_prune_unref_mparts_k bli_l3_prune_unref_mparts_m bli_l3_prune_unref_mparts_n bli_l3_thread_decorator +bli_l3_thread_entry bli_l3_thrinfo_create_root bli_l3_thrinfo_free bli_l3_thrinfo_free_paths diff --git a/frame/thread/bli_thrcomm.h b/frame/thread/bli_thrcomm.h index 575703391..fcab115cd 100644 --- a/frame/thread/bli_thrcomm.h +++ b/frame/thread/bli_thrcomm.h @@ -42,6 +42,10 @@ #include "bli_thrcomm_pthreads.h" +// thread entry point prototype. +void* bli_l3_thread_entry( void* data_void ); + + // thrcomm_t query (field only) static dim_t bli_thrcomm_num_threads( thrcomm_t* comm ) diff --git a/frame/thread/bli_thrcomm_openmp.c b/frame/thread/bli_thrcomm_openmp.c index 3b1ef94ce..9be8682f8 100644 --- a/frame/thread/bli_thrcomm_openmp.c +++ b/frame/thread/bli_thrcomm_openmp.c @@ -202,6 +202,11 @@ void bli_thrcomm_tree_barrier( barrier_t* barack ) #endif +// Define a dummy function bli_l3_thread_entry(), which is needed in the +// pthreads version, so that when building Windows DLLs (with OpenMP enabled +// or no multithreading) we don't risk having an unresolved symbol. +void* bli_l3_thread_entry( void* data_void ) { return NULL; } + //#define PRINT_THRINFO void bli_l3_thread_decorator diff --git a/frame/thread/bli_thrcomm_pthreads.c b/frame/thread/bli_thrcomm_pthreads.c index 88845b5b6..ac6305e30 100644 --- a/frame/thread/bli_thrcomm_pthreads.c +++ b/frame/thread/bli_thrcomm_pthreads.c @@ -126,8 +126,6 @@ void bli_thrcomm_barrier( thrcomm_t* comm, dim_t t_id ) #endif -void* bli_l3_thread_entry( void* data_void ); - // A data structure to assist in passing operands to additional threads. typedef struct thread_data { diff --git a/frame/thread/bli_thrcomm_single.c b/frame/thread/bli_thrcomm_single.c index b244b3fcc..1d34cfc5a 100644 --- a/frame/thread/bli_thrcomm_single.c +++ b/frame/thread/bli_thrcomm_single.c @@ -71,6 +71,11 @@ void bli_thrcomm_barrier( thrcomm_t* comm, dim_t t_id ) return; } +// Define a dummy function bli_l3_thread_entry(), which is needed in the +// pthreads version, so that when building Windows DLLs (with OpenMP enabled +// or no multithreading) we don't risk having an unresolved symbol. +void* bli_l3_thread_entry( void* data_void ) { return NULL; } + void bli_l3_thread_decorator ( l3int_t func,