diff --git a/frame/base/bli_init.c b/frame/base/bli_init.c index a718f9f79..fb46e4ae1 100644 --- a/frame/base/bli_init.c +++ b/frame/base/bli_init.c @@ -51,35 +51,125 @@ gemm_thrinfo_t BLIS_GEMM_SINGLE_THREADED; herk_thrinfo_t BLIS_HERK_SINGLE_THREADED; thread_comm_t BLIS_SINGLE_COMM; -void bli_init( void ) +err_t bli_init( void ) { - bli_initialized = TRUE; + err_t r_val = BLIS_FAILURE; - bli_init_const(); + // If bli_initialized is TRUE, then we know without a doubt that + // BLIS is presently initialized, and thus we can return early. + if ( bli_initialized == TRUE ) return r_val; - bli_cntl_init(); + // NOTE: if bli_initialized is FALSE, we cannot be certain that BLIS + // is ready to be initialized; it may be the case that a thread is + // inside the critical section below and is already in the process + // of initializing BLIS, but has not yet finished and updated + // bli_initialized accordingly. This boolean asymmetry is important! - bli_error_msgs_init(); + // We enclose the bodies of bli_init() and bli_finalize() in a + // critical section (both with the same name) so that they can be + // safely called from multiple external (application) threads. + // Note that while the conditional test for early return may reside + // outside the critical section (as it should, for efficiency + // reasons), the conditional test below MUST be within the critical + // section to prevent a race condition of the type described above. - bli_mem_init(); + // BEGIN CRITICAL SECTION +#ifdef BLIS_ENABLE_OPENMP + _Pragma( "omp critical (init)" ) +#endif + { + + // Proceed with initialization only if BLIS is presently uninitialized. + // Since we bli_init() and bli_finalize() use the same named critical + // section, we can be sure that no other thread is either (a) updating + // bli_initialized, or (b) testing bli_initialized within the critical + // section (for the purposes of deciding whether to perform the + // necessary initialization subtasks). + if ( bli_initialized == FALSE ) + { + bli_init_const(); + + bli_cntl_init(); + + bli_error_msgs_init(); + + bli_mem_init(); - bli_setup_communicator( &BLIS_SINGLE_COMM, 1 ); - bli_setup_packm_single_threaded_info( &BLIS_PACKM_SINGLE_THREADED ); - bli_setup_gemm_single_threaded_info( &BLIS_GEMM_SINGLE_THREADED ); - bli_setup_herk_single_threaded_info( &BLIS_HERK_SINGLE_THREADED ); + bli_setup_communicator( &BLIS_SINGLE_COMM, 1 ); + bli_setup_packm_single_threaded_info( &BLIS_PACKM_SINGLE_THREADED ); + bli_setup_gemm_single_threaded_info( &BLIS_GEMM_SINGLE_THREADED ); + bli_setup_herk_single_threaded_info( &BLIS_HERK_SINGLE_THREADED ); + + // After initialization is complete, mark BLIS as initialized. + bli_initialized = TRUE; + + // Only the thread that actually performs the initialization will + // return "success". + r_val = BLIS_SUCCESS; + } + + // END CRITICAL SECTION + } + + return r_val; } -void bli_finalize( void ) +err_t bli_finalize( void ) { - bli_initialized = FALSE; + err_t r_val = BLIS_FAILURE; - bli_finalize_const(); + // If bli_initialized is FALSE, then we know without a doubt that + // BLIS is presently uninitialized, and thus we can return early. + if ( bli_initialized == FALSE ) return r_val; - bli_cntl_finalize(); + // NOTE: if bli_initialized is TRUE, we cannot be certain that BLIS + // is ready to be finalized; it may be the case that a thread is + // inside the critical section below and is already in the process + // of finalizing BLIS, but has not yet finished and updated + // bli_initialized accordingly. This boolean asymmetry is important! - // Don't need to do anything to finalize error messages. + // We enclose the bodies of bli_init() and bli_finalize() in a + // critical section (both with the same name) so that they can be + // safely called from multiple external (application) threads. + // Note that while the conditional test for early return may reside + // outside the critical section (as it should, for efficiency + // reasons), the conditional test below MUST be within the critical + // section to prevent a race condition of the type described above. - bli_mem_finalize(); + // BEGIN CRITICAL SECTION +#ifdef BLIS_ENABLE_OPENMP + _Pragma( "omp critical (init)" ) +#endif + { + + // Proceed with finalization only if BLIS is presently initialized. + // Since we bli_init() and bli_finalize() use the same named critical + // section, we can be sure that no other thread is either (a) updating + // bli_initialized, or (b) testing bli_initialized within the critical + // section (for the purposes of deciding whether to perform the + // necessary finalization subtasks). + if ( bli_initialized == TRUE ) + { + bli_finalize_const(); + + bli_cntl_finalize(); + + // Don't need to do anything to finalize error messages. + + bli_mem_finalize(); + + // After finalization is complete, mark BLIS as uninitialized. + bli_initialized = FALSE; + + // Only the thread that actually performs the finalization will + // return "success". + r_val = BLIS_SUCCESS; + } + + // END CRITICAL SECTION + } + + return r_val; } void bli_init_const( void ) @@ -104,20 +194,12 @@ void bli_finalize_const( void ) bli_obj_free( &BLIS_MINUS_TWO ); } -void bli_init_safe( err_t* init_result ) +void bli_init_auto( err_t* init_result ) { - if ( bli_initialized ) - { - *init_result = BLIS_FAILURE; - } - else - { - bli_init(); - *init_result = BLIS_SUCCESS; - } + *init_result = bli_init(); } -void bli_finalize_safe( err_t init_result ) +void bli_finalize_auto( err_t init_result ) { #ifdef BLIS_ENABLE_STAY_AUTO_INITIALIZED @@ -127,11 +209,15 @@ void bli_finalize_safe( err_t init_result ) // calls bli_finalize(). #else - // Only finalize if the corresponding bli_init_safe() actually - // resulted in BLIS being initialized; if it did nothing, we - // similarly do nothing here. + + // If BLIS was NOT configured to stay initialized after being automatically + // initialized, we call bli_finalize() only if the corresponding call to + // bli_init_auto() actually resulted in BLIS being initialized (indicated + // by it returning BLIS_SUCCESS); if it did nothing, we similarly do + // nothing here. if ( init_result == BLIS_SUCCESS ) bli_finalize(); + #endif } diff --git a/frame/base/bli_init.h b/frame/base/bli_init.h index 040325eac..670d776c8 100644 --- a/frame/base/bli_init.h +++ b/frame/base/bli_init.h @@ -32,11 +32,11 @@ */ -void bli_init( void ); -void bli_finalize( void ); +err_t bli_init( void ); +err_t bli_finalize( void ); -void bli_init_const( void ); -void bli_finalize_const( void ); +void bli_init_const( void ); +void bli_finalize_const( void ); -void bli_init_safe( err_t* init_result ); -void bli_finalize_safe( err_t init_result ); +void bli_init_auto( err_t* init_result ); +void bli_finalize_auto( err_t init_result ); diff --git a/frame/compat/bla_amax.c b/frame/compat/bla_amax.c index 086a2ef14..9e32e2177 100644 --- a/frame/compat/bla_amax.c +++ b/frame/compat/bla_amax.c @@ -60,7 +60,7 @@ f77_int PASTEF772(i,chx,blasname)( \ if ( *n < 1 || *incx <= 0 ) return 0; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -79,7 +79,7 @@ f77_int PASTEF772(i,chx,blasname)( \ f77_index = bli_index + 1; \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ \ return f77_index; \ } diff --git a/frame/compat/bla_asum.c b/frame/compat/bla_asum.c index 2e7cc8322..33e6ad31b 100644 --- a/frame/compat/bla_asum.c +++ b/frame/compat/bla_asum.c @@ -53,7 +53,7 @@ ftype_r PASTEF772(chr,chx,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -68,7 +68,7 @@ ftype_r PASTEF772(chr,chx,blasname)( \ &asum ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ \ return asum; \ } diff --git a/frame/compat/bla_axpy.c b/frame/compat/bla_axpy.c index 46937f57b..a4f75d026 100644 --- a/frame/compat/bla_axpy.c +++ b/frame/compat/bla_axpy.c @@ -56,7 +56,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -74,7 +74,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_copy.c b/frame/compat/bla_copy.c index 52d709bec..79140a2ce 100644 --- a/frame/compat/bla_copy.c +++ b/frame/compat/bla_copy.c @@ -55,7 +55,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -72,7 +72,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_dot.c b/frame/compat/bla_dot.c index d725ae0e7..a9df2114e 100644 --- a/frame/compat/bla_dot.c +++ b/frame/compat/bla_dot.c @@ -56,7 +56,7 @@ ftype PASTEF772(chxy,blasname,chc)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -75,7 +75,7 @@ ftype PASTEF772(chxy,blasname,chc)( \ &rho ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ \ return rho; \ } diff --git a/frame/compat/bla_gemm.c b/frame/compat/bla_gemm.c index 7f6da67c5..c50a58f3c 100644 --- a/frame/compat/bla_gemm.c +++ b/frame/compat/bla_gemm.c @@ -63,7 +63,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -107,7 +107,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_gemv.c b/frame/compat/bla_gemv.c index b0e64d618..a77d23dc2 100644 --- a/frame/compat/bla_gemv.c +++ b/frame/compat/bla_gemv.c @@ -63,7 +63,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,7 +99,7 @@ void PASTEF77(ch,blasname)( \ if ( m_y > 0 && n_x == 0 ) \ { \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ \ return; \ } \ @@ -125,7 +125,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_ger.c b/frame/compat/bla_ger.c index d5724367b..a575841ad 100644 --- a/frame/compat/bla_ger.c +++ b/frame/compat/bla_ger.c @@ -59,7 +59,7 @@ void PASTEF772(chxy,blasname,chc)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -94,7 +94,7 @@ void PASTEF772(chxy,blasname,chc)( \ a, rs_a, cs_a ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_hemm.c b/frame/compat/bla_hemm.c index b78f24441..ff2730887 100644 --- a/frame/compat/bla_hemm.c +++ b/frame/compat/bla_hemm.c @@ -62,7 +62,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -105,7 +105,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_hemv.c b/frame/compat/bla_hemv.c index d68f07712..978c85de3 100644 --- a/frame/compat/bla_hemv.c +++ b/frame/compat/bla_hemv.c @@ -61,7 +61,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,7 +99,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her.c b/frame/compat/bla_her.c index 85a282877..9efe297ed 100644 --- a/frame/compat/bla_her.c +++ b/frame/compat/bla_her.c @@ -57,7 +57,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -90,7 +90,7 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her2.c b/frame/compat/bla_her2.c index 82b92bf6f..130b5f33c 100644 --- a/frame/compat/bla_her2.c +++ b/frame/compat/bla_her2.c @@ -60,7 +60,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -97,7 +97,7 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her2k.c b/frame/compat/bla_her2k.c index 43279e682..2c6289d21 100644 --- a/frame/compat/bla_her2k.c +++ b/frame/compat/bla_her2k.c @@ -62,7 +62,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -104,7 +104,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_herk.c b/frame/compat/bla_herk.c index c3b6de5c5..d0c0accf1 100644 --- a/frame/compat/bla_herk.c +++ b/frame/compat/bla_herk.c @@ -60,7 +60,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -97,7 +97,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_nrm2.c b/frame/compat/bla_nrm2.c index 7b1e544d8..0021b1a68 100644 --- a/frame/compat/bla_nrm2.c +++ b/frame/compat/bla_nrm2.c @@ -53,7 +53,7 @@ ftype_r PASTEF772(chr,chx,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -68,7 +68,7 @@ ftype_r PASTEF772(chr,chx,blasname)( \ &norm ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ \ return norm; \ } diff --git a/frame/compat/bla_scal.c b/frame/compat/bla_scal.c index a1058f4af..b108e9692 100644 --- a/frame/compat/bla_scal.c +++ b/frame/compat/bla_scal.c @@ -54,7 +54,7 @@ void PASTEF772(chx,cha,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -78,7 +78,7 @@ void PASTEF772(chx,cha,blasname)( \ x0, incx0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_swap.c b/frame/compat/bla_swap.c index 1e06afb83..af350f2c6 100644 --- a/frame/compat/bla_swap.c +++ b/frame/compat/bla_swap.c @@ -55,7 +55,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Convert/typecast negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -71,7 +71,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_symm.c b/frame/compat/bla_symm.c index b5ac8a935..3fd5f81d7 100644 --- a/frame/compat/bla_symm.c +++ b/frame/compat/bla_symm.c @@ -62,7 +62,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -105,7 +105,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_symv.c b/frame/compat/bla_symv.c index 2ebd784c7..38b61658f 100644 --- a/frame/compat/bla_symv.c +++ b/frame/compat/bla_symv.c @@ -61,7 +61,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,7 +99,7 @@ void PASTEF77(ch,blasname)( \ y0, incy0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr.c b/frame/compat/bla_syr.c index 5a86e456d..676d8d319 100644 --- a/frame/compat/bla_syr.c +++ b/frame/compat/bla_syr.c @@ -57,7 +57,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -90,7 +90,7 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr2.c b/frame/compat/bla_syr2.c index 2532874de..b4e76dd2f 100644 --- a/frame/compat/bla_syr2.c +++ b/frame/compat/bla_syr2.c @@ -60,7 +60,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -97,7 +97,7 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr2k.c b/frame/compat/bla_syr2k.c index 2a6bcc68f..854637301 100644 --- a/frame/compat/bla_syr2k.c +++ b/frame/compat/bla_syr2k.c @@ -62,7 +62,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -113,7 +113,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syrk.c b/frame/compat/bla_syrk.c index 02c8b5b01..0cb926153 100644 --- a/frame/compat/bla_syrk.c +++ b/frame/compat/bla_syrk.c @@ -60,7 +60,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -106,7 +106,7 @@ void PASTEF77(ch,blasname)( \ c, rs_c, cs_c ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trmm.c b/frame/compat/bla_trmm.c index 714f46d49..8bbb2322a 100644 --- a/frame/compat/bla_trmm.c +++ b/frame/compat/bla_trmm.c @@ -63,7 +63,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -105,7 +105,7 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trmv.c b/frame/compat/bla_trmv.c index 15b978a42..239bf9781 100644 --- a/frame/compat/bla_trmv.c +++ b/frame/compat/bla_trmv.c @@ -61,7 +61,7 @@ void PASTEF77(ch,blasname)( \ ftype* one_p; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -102,7 +102,7 @@ void PASTEF77(ch,blasname)( \ x0, incx0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trsm.c b/frame/compat/bla_trsm.c index 105bb318e..5e2c8a2c1 100644 --- a/frame/compat/bla_trsm.c +++ b/frame/compat/bla_trsm.c @@ -63,7 +63,7 @@ void PASTEF77(ch,blasname)( \ err_t init_result; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -105,7 +105,7 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trsv.c b/frame/compat/bla_trsv.c index 040d9d4ce..b46406c55 100644 --- a/frame/compat/bla_trsv.c +++ b/frame/compat/bla_trsv.c @@ -61,7 +61,7 @@ void PASTEF77(ch,blasname)( \ ftype* one_p; \ \ /* Initialize BLIS (if it is not already initialized). */ \ - bli_init_safe( &init_result ); \ + bli_init_auto( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -102,7 +102,7 @@ void PASTEF77(ch,blasname)( \ x0, incx0 ); \ \ /* Finalize BLIS (if it was initialized above). */ \ - bli_finalize_safe( init_result ); \ + bli_finalize_auto( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS