Skip to content

blas_thread_init is not called for OS_WINNT #2106

Description

@cg31

When using VS2019 to build OpenBlas, blas_thread_init needs to be called to initialize blas server. But current code only calls it for OS_CYGWIN_NT, this patch will fix it:

--- a/driver/others/blas_server_win32.c
+++ b/driver/others/blas_server_win32.c
@@ -348,9 +348,9 @@ int blas_thread_init(void){

 int exec_blas_async(BLASLONG pos, blas_queue_t *queue){

-#if defined(SMP_SERVER) && defined(OS_CYGWIN_NT)
+#if defined(SMP_SERVER) && (defined(OS_CYGWIN_NT) || defined(OS_WINNT))
   // Handle lazy re-init of the thread-pool after a POSIX fork
-  if (unlikely(blas_server_avail == 0)) blas_thread_init();
+  if (blas_server_avail == 0) blas_thread_init();
 #endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions