From 12dbd2f33455e9384fe2070cbdd660fd4a7fceb5 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Thu, 8 Aug 2013 14:39:35 -0500 Subject: [PATCH] Moved init_safe(), finalize_safe() to BLAS compat. Details: - Moved the bli_init_safe() and bli_finalize_safe() function calls from the BLAS-like BLIS layer to the BLAS compatibility layer. Having these auto- initializers in the BLIS layer wasn't buying us anything because the user could still call the library with uninitialized global scalar constants, for example. Thus, we will just have to live with the constraint that bli_init() MUST be called before calling ANY routine with a bli_ prefix. - Added the missing _init_safe() and finalize_safe() calls to the level-1 BLAS compatibility wrappers. --- frame/2/gemv/bli_gemv.c | 5 ----- frame/2/ger/bli_ger.c | 5 ----- frame/2/hemv/bli_hemv.c | 5 ----- frame/2/her/bli_her.c | 5 ----- frame/2/her2/bli_her2.c | 5 ----- frame/2/symv/bli_symv.c | 5 ----- frame/2/syr/bli_syr.c | 5 ----- frame/2/syr2/bli_syr2.c | 5 ----- frame/2/trmv/bli_trmv.c | 5 ----- frame/2/trsv/bli_trsv.c | 5 ----- frame/3/gemm/bli_gemm.c | 5 ----- frame/3/hemm/bli_hemm.c | 5 ----- frame/3/her2k/bli_her2k.c | 5 ----- frame/3/herk/bli_herk.c | 5 ----- frame/3/symm/bli_symm.c | 5 ----- frame/3/syr2k/bli_syr2k.c | 5 ----- frame/3/syrk/bli_syrk.c | 5 ----- frame/3/trmm/bli_trmm.c | 5 ----- frame/3/trmm3/bli_trmm3.c | 5 ----- frame/3/trsm/bli_trsm.c | 5 ----- frame/compat/bla_amax.c | 7 +++++++ frame/compat/bla_asum.c | 7 +++++++ frame/compat/bla_axpy.c | 7 +++++++ frame/compat/bla_copy.c | 7 +++++++ frame/compat/bla_dot.c | 7 +++++++ frame/compat/bla_gemm.c | 7 +++++++ frame/compat/bla_gemv.c | 7 +++++++ frame/compat/bla_ger.c | 7 +++++++ frame/compat/bla_hemm.c | 7 +++++++ frame/compat/bla_hemv.c | 7 +++++++ frame/compat/bla_her.c | 7 +++++++ frame/compat/bla_her2.c | 7 +++++++ frame/compat/bla_her2k.c | 7 +++++++ frame/compat/bla_herk.c | 7 +++++++ frame/compat/bla_nrm2.c | 7 +++++++ frame/compat/bla_scal.c | 7 +++++++ frame/compat/bla_swap.c | 7 +++++++ frame/compat/bla_symm.c | 7 +++++++ frame/compat/bla_symv.c | 7 +++++++ frame/compat/bla_syr.c | 7 +++++++ frame/compat/bla_syr2.c | 7 +++++++ frame/compat/bla_syr2k.c | 7 +++++++ frame/compat/bla_syrk.c | 7 +++++++ frame/compat/bla_trmm.c | 7 +++++++ frame/compat/bla_trmv.c | 7 +++++++ frame/compat/bla_trsm.c | 7 +++++++ frame/compat/bla_trsv.c | 7 +++++++ 47 files changed, 189 insertions(+), 100 deletions(-) diff --git a/frame/2/gemv/bli_gemv.c b/frame/2/gemv/bli_gemv.c index 038ee4ffd..d8377e3f2 100644 --- a/frame/2/gemv/bli_gemv.c +++ b/frame/2/gemv/bli_gemv.c @@ -181,9 +181,6 @@ void PASTEMAC(ch,opname)( \ dim_t m_y; \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( BLIS_NO_TRANSPOSE, m, n, m_a, n_a ); \ bli_set_dims_with_trans( transa, m, n, m_y, m_x ); \ @@ -206,8 +203,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &betao, \ &yo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( gemv, gemv ) diff --git a/frame/2/ger/bli_ger.c b/frame/2/ger/bli_ger.c index 8c748ce13..4003837f0 100644 --- a/frame/2/ger/bli_ger.c +++ b/frame/2/ger/bli_ger.c @@ -142,9 +142,6 @@ void PASTEMAC(ch,opname)( \ dim_t m_y; \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( BLIS_NO_TRANSPOSE, m, n, m_x, m_y ); \ \ @@ -164,8 +161,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &yo, \ &ao ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( ger, ger ) diff --git a/frame/2/hemv/bli_hemv.c b/frame/2/hemv/bli_hemv.c index 817bb4f34..cae2ffb71 100644 --- a/frame/2/hemv/bli_hemv.c +++ b/frame/2/hemv/bli_hemv.c @@ -176,9 +176,6 @@ void PASTEMAC(ch,opname)( \ \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ rs_y = incy; cs_y = m * incy; \ @@ -201,8 +198,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &betao, \ &yo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( hemv, hemv ) diff --git a/frame/2/her/bli_her.c b/frame/2/her/bli_her.c index 7f4dfc4c6..c376f10d6 100644 --- a/frame/2/her/bli_her.c +++ b/frame/2/her/bli_her.c @@ -148,9 +148,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, xo, co; \ \ inc_t rs_x, cs_x; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ \ @@ -167,8 +164,6 @@ void PASTEMAC(ch,opname)( \ PASTEMAC0(opname)( &alphao, \ &xo, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNCR_BASIC( her, her ) diff --git a/frame/2/her2/bli_her2.c b/frame/2/her2/bli_her2.c index 992f34222..e33c3a5e9 100644 --- a/frame/2/her2/bli_her2.c +++ b/frame/2/her2/bli_her2.c @@ -167,9 +167,6 @@ void PASTEMAC(ch,opname)( \ \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ rs_y = incy; cs_y = m * incy; \ @@ -190,8 +187,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &yo, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( her2, her2 ) diff --git a/frame/2/symv/bli_symv.c b/frame/2/symv/bli_symv.c index 46536183c..be40e4913 100644 --- a/frame/2/symv/bli_symv.c +++ b/frame/2/symv/bli_symv.c @@ -176,9 +176,6 @@ void PASTEMAC(ch,opname)( \ \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ rs_y = incy; cs_y = m * incy; \ @@ -201,8 +198,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &betao, \ &yo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( symv, symv ) diff --git a/frame/2/syr/bli_syr.c b/frame/2/syr/bli_syr.c index e3cd31070..2e0a55c94 100644 --- a/frame/2/syr/bli_syr.c +++ b/frame/2/syr/bli_syr.c @@ -149,9 +149,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, xo, co; \ \ inc_t rs_x, cs_x; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ \ @@ -168,8 +165,6 @@ void PASTEMAC(ch,opname)( \ PASTEMAC0(opname)( &alphao, \ &xo, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( syr, syr ) diff --git a/frame/2/syr2/bli_syr2.c b/frame/2/syr2/bli_syr2.c index 260d71bc0..4debf609e 100644 --- a/frame/2/syr2/bli_syr2.c +++ b/frame/2/syr2/bli_syr2.c @@ -160,9 +160,6 @@ void PASTEMAC(ch,opname)( \ \ inc_t rs_x, cs_x; \ inc_t rs_y, cs_y; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ rs_y = incy; cs_y = m * incy; \ @@ -183,8 +180,6 @@ void PASTEMAC(ch,opname)( \ &xo, \ &yo, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( syr2, syr2 ) diff --git a/frame/2/trmv/bli_trmv.c b/frame/2/trmv/bli_trmv.c index 1eb4a799d..6d85e042a 100644 --- a/frame/2/trmv/bli_trmv.c +++ b/frame/2/trmv/bli_trmv.c @@ -147,9 +147,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, xo; \ \ inc_t rs_x, cs_x; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ \ @@ -167,8 +164,6 @@ void PASTEMAC(ch,opname)( \ PASTEMAC0(opname)( &alphao, \ &ao, \ &xo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( trmv, trmv ) diff --git a/frame/2/trsv/bli_trsv.c b/frame/2/trsv/bli_trsv.c index 3d044a311..2be95de33 100644 --- a/frame/2/trsv/bli_trsv.c +++ b/frame/2/trsv/bli_trsv.c @@ -144,9 +144,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, xo; \ \ inc_t rs_x, cs_x; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ rs_x = incx; cs_x = m * incx; \ \ @@ -164,8 +161,6 @@ void PASTEMAC(ch,opname)( \ PASTEMAC0(opname)( &alphao, \ &ao, \ &xo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( trsv, trsv ) diff --git a/frame/3/gemm/bli_gemm.c b/frame/3/gemm/bli_gemm.c index 802dd4cbe..c9ff2fb33 100644 --- a/frame/3/gemm/bli_gemm.c +++ b/frame/3/gemm/bli_gemm.c @@ -155,9 +155,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t m_a, n_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ bli_set_dims_with_trans( transb, k, n, m_b, n_b ); \ @@ -177,8 +174,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( gemm, gemm ) diff --git a/frame/3/hemm/bli_hemm.c b/frame/3/hemm/bli_hemm.c index 0f7bc3b52..1973b24ab 100644 --- a/frame/3/hemm/bli_hemm.c +++ b/frame/3/hemm/bli_hemm.c @@ -151,9 +151,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t mn_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dim_with_side( side, m, n, mn_a ); \ bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ @@ -177,8 +174,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( hemm, hemm ) diff --git a/frame/3/her2k/bli_her2k.c b/frame/3/her2k/bli_her2k.c index dfc8a823e..bca1351f4 100644 --- a/frame/3/her2k/bli_her2k.c +++ b/frame/3/her2k/bli_her2k.c @@ -190,9 +190,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t m_a, n_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ bli_set_dims_with_trans( transb, m, k, m_b, n_b ); \ @@ -215,8 +212,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNCR_BASIC( her2k, her2k ) diff --git a/frame/3/herk/bli_herk.c b/frame/3/herk/bli_herk.c index a79f3d81c..4969e796c 100644 --- a/frame/3/herk/bli_herk.c +++ b/frame/3/herk/bli_herk.c @@ -145,9 +145,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, betao, co; \ \ dim_t m_a, n_a; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ \ @@ -166,8 +163,6 @@ void PASTEMAC(ch,opname)( \ &ao, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNCR_BASIC( herk, herk ) diff --git a/frame/3/symm/bli_symm.c b/frame/3/symm/bli_symm.c index 3f8c8e36c..e95f71b8f 100644 --- a/frame/3/symm/bli_symm.c +++ b/frame/3/symm/bli_symm.c @@ -151,9 +151,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t mn_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dim_with_side( side, m, n, mn_a ); \ bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ @@ -177,8 +174,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( symm, symm ) diff --git a/frame/3/syr2k/bli_syr2k.c b/frame/3/syr2k/bli_syr2k.c index f5b5a0b1f..15fd5f761 100644 --- a/frame/3/syr2k/bli_syr2k.c +++ b/frame/3/syr2k/bli_syr2k.c @@ -171,9 +171,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t m_a, n_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ bli_set_dims_with_trans( transb, m, k, m_b, n_b ); \ @@ -196,8 +193,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( syr2k, syr2k ) diff --git a/frame/3/syrk/bli_syrk.c b/frame/3/syrk/bli_syrk.c index 5d0239948..af3956ccb 100644 --- a/frame/3/syrk/bli_syrk.c +++ b/frame/3/syrk/bli_syrk.c @@ -141,9 +141,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, betao, co; \ \ dim_t m_a, n_a; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dims_with_trans( transa, m, k, m_a, n_a ); \ \ @@ -162,8 +159,6 @@ void PASTEMAC(ch,opname)( \ &ao, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( syrk, syrk ) diff --git a/frame/3/trmm/bli_trmm.c b/frame/3/trmm/bli_trmm.c index 84928e178..9c5331eee 100644 --- a/frame/3/trmm/bli_trmm.c +++ b/frame/3/trmm/bli_trmm.c @@ -176,9 +176,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, bo; \ \ dim_t mn_a; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dim_with_side( side, m, n, mn_a ); \ \ @@ -197,8 +194,6 @@ void PASTEMAC(ch,opname)( \ &alphao, \ &ao, \ &bo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( trmm, trmm ) diff --git a/frame/3/trmm3/bli_trmm3.c b/frame/3/trmm3/bli_trmm3.c index e9f767760..73a3795a7 100644 --- a/frame/3/trmm3/bli_trmm3.c +++ b/frame/3/trmm3/bli_trmm3.c @@ -171,9 +171,6 @@ void PASTEMAC(ch,opname)( \ \ dim_t mn_a; \ dim_t m_b, n_b; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dim_with_side( side, m, n, mn_a ); \ bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \ @@ -198,8 +195,6 @@ void PASTEMAC(ch,opname)( \ &bo, \ &betao, \ &co ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( trmm3, trmm3 ) diff --git a/frame/3/trsm/bli_trsm.c b/frame/3/trsm/bli_trsm.c index 43575341b..26db05344 100644 --- a/frame/3/trsm/bli_trsm.c +++ b/frame/3/trsm/bli_trsm.c @@ -182,9 +182,6 @@ void PASTEMAC(ch,opname)( \ obj_t alphao, ao, bo; \ \ dim_t mn_a; \ - err_t init_result; \ -\ - bli_init_safe( &init_result ); \ \ bli_set_dim_with_side( side, m, n, mn_a ); \ \ @@ -203,8 +200,6 @@ void PASTEMAC(ch,opname)( \ &alphao, \ &ao, \ &bo ); \ -\ - bli_finalize_safe( init_result ); \ } INSERT_GENTFUNC_BASIC( trsm, trsm ) diff --git a/frame/compat/bla_amax.c b/frame/compat/bla_amax.c index c6699a7b4..7dd08c75c 100644 --- a/frame/compat/bla_amax.c +++ b/frame/compat/bla_amax.c @@ -51,6 +51,10 @@ f77_int PASTEF772(i,chx,blasname)( \ inc_t incx0; \ gint_t bli_index; \ f77_int f77_index; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -67,6 +71,9 @@ f77_int PASTEF772(i,chx,blasname)( \ /* Convert zero-based BLIS (C) index to one-based BLAS (Fortran) index. */ \ f77_index = bli_index + 1; \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ \ return f77_index; \ } diff --git a/frame/compat/bla_asum.c b/frame/compat/bla_asum.c index 081190cf1..1832efd6e 100644 --- a/frame/compat/bla_asum.c +++ b/frame/compat/bla_asum.c @@ -50,6 +50,10 @@ ftype_r PASTEF772(chr,chx,blasname)( \ ftype_x* x0; \ inc_t incx0; \ ftype_r absum; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -62,6 +66,9 @@ ftype_r PASTEF772(chr,chx,blasname)( \ PASTEMAC(chx,absumv)( n0, \ x0, incx0, \ &absum ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ \ return absum; \ } diff --git a/frame/compat/bla_axpy.c b/frame/compat/bla_axpy.c index a91d4b5dc..447e4dcc3 100644 --- a/frame/compat/bla_axpy.c +++ b/frame/compat/bla_axpy.c @@ -53,6 +53,10 @@ void PASTEF77(ch,blasname)( \ ftype* y0; \ inc_t incx0; \ inc_t incy0; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -68,6 +72,9 @@ void PASTEF77(ch,blasname)( \ alpha, \ x0, incx0, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_copy.c b/frame/compat/bla_copy.c index 1f53a449f..5627a391d 100644 --- a/frame/compat/bla_copy.c +++ b/frame/compat/bla_copy.c @@ -52,6 +52,10 @@ void PASTEF77(ch,blasname)( \ ftype* y0; \ inc_t incx0; \ inc_t incy0; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -66,6 +70,9 @@ void PASTEF77(ch,blasname)( \ n0, \ x0, incx0, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_dot.c b/frame/compat/bla_dot.c index 355f15fac..0b979ae0c 100644 --- a/frame/compat/bla_dot.c +++ b/frame/compat/bla_dot.c @@ -53,6 +53,10 @@ ftype PASTEF772(chxy,blasname,chc)( \ inc_t incx0; \ inc_t incy0; \ ftype rho; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -69,6 +73,9 @@ ftype PASTEF772(chxy,blasname,chc)( \ x0, incx0, \ y0, incy0, \ &rho ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ \ return rho; \ } diff --git a/frame/compat/bla_gemm.c b/frame/compat/bla_gemm.c index a37c56eba..02d11d746 100644 --- a/frame/compat/bla_gemm.c +++ b/frame/compat/bla_gemm.c @@ -60,6 +60,10 @@ void PASTEF77(ch,blasname)( \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -101,6 +105,9 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_gemv.c b/frame/compat/bla_gemv.c index 0678cc801..b5e09bb86 100644 --- a/frame/compat/bla_gemv.c +++ b/frame/compat/bla_gemv.c @@ -60,6 +60,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -101,6 +105,9 @@ void PASTEF77(ch,blasname)( \ x0, incx0, \ beta, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_ger.c b/frame/compat/bla_ger.c index 625f1e7ff..06f97901a 100644 --- a/frame/compat/bla_ger.c +++ b/frame/compat/bla_ger.c @@ -56,6 +56,10 @@ void PASTEF772(chxy,blasname,chc)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -88,6 +92,9 @@ void PASTEF772(chxy,blasname,chc)( \ x0, incx0, \ y0, incy0, \ a, rs_a, cs_a ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_hemm.c b/frame/compat/bla_hemm.c index 81b0bf7e2..eed34bf02 100644 --- a/frame/compat/bla_hemm.c +++ b/frame/compat/bla_hemm.c @@ -59,6 +59,10 @@ void PASTEF77(ch,blasname)( \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,6 +103,9 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_hemv.c b/frame/compat/bla_hemv.c index f77c0c0a9..46e4bf052 100644 --- a/frame/compat/bla_hemv.c +++ b/frame/compat/bla_hemv.c @@ -58,6 +58,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -93,6 +97,9 @@ void PASTEF77(ch,blasname)( \ x0, incx0, \ beta, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her.c b/frame/compat/bla_her.c index 55d55eee1..39d9059e2 100644 --- a/frame/compat/bla_her.c +++ b/frame/compat/bla_her.c @@ -54,6 +54,10 @@ void PASTEF77(ch,blasname)( \ ftype* x0; \ inc_t incx0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -84,6 +88,9 @@ void PASTEF77(ch,blasname)( \ alpha, \ x0, incx0, \ a, rs_a, cs_a ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her2.c b/frame/compat/bla_her2.c index 945dcc12b..e9187bbb8 100644 --- a/frame/compat/bla_her2.c +++ b/frame/compat/bla_her2.c @@ -57,6 +57,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -91,6 +95,9 @@ void PASTEF77(ch,blasname)( \ x0, incx0, \ y0, incy0, \ a, rs_a, cs_a ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_her2k.c b/frame/compat/bla_her2k.c index a14507bbf..1956d86ee 100644 --- a/frame/compat/bla_her2k.c +++ b/frame/compat/bla_her2k.c @@ -59,6 +59,10 @@ void PASTEF77(ch,blasname)( \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -98,6 +102,9 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_herk.c b/frame/compat/bla_herk.c index a99f928de..246b0b3df 100644 --- a/frame/compat/bla_herk.c +++ b/frame/compat/bla_herk.c @@ -57,6 +57,10 @@ void PASTEF77(ch,blasname)( \ dim_t m0, k0; \ inc_t rs_a, cs_a; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -91,6 +95,9 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_nrm2.c b/frame/compat/bla_nrm2.c index fcc820c4d..7f6f7c286 100644 --- a/frame/compat/bla_nrm2.c +++ b/frame/compat/bla_nrm2.c @@ -50,6 +50,10 @@ ftype_r PASTEF772(chr,chx,blasname)( \ ftype_x* x0; \ inc_t incx0; \ ftype_r absum; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -62,6 +66,9 @@ ftype_r PASTEF772(chr,chx,blasname)( \ PASTEMAC(chx,fnormv)( n0, \ x0, incx0, \ &absum ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ \ return absum; \ } diff --git a/frame/compat/bla_scal.c b/frame/compat/bla_scal.c index 229559b7b..66e842e5e 100644 --- a/frame/compat/bla_scal.c +++ b/frame/compat/bla_scal.c @@ -51,6 +51,10 @@ void PASTEF772(chx,cha,blasname)( \ ftype_x* x0; \ inc_t incx0; \ ftype_x alpha_cast; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -72,6 +76,9 @@ void PASTEF772(chx,cha,blasname)( \ n0, \ &alpha_cast, \ x0, incx0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_swap.c b/frame/compat/bla_swap.c index 389e772a9..854345886 100644 --- a/frame/compat/bla_swap.c +++ b/frame/compat/bla_swap.c @@ -52,6 +52,10 @@ void PASTEF77(ch,blasname)( \ ftype* y0; \ inc_t incx0; \ inc_t incy0; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Convert negative values of n to zero. */ \ bli_convert_blas_dim1( *n, n0 ); \ @@ -65,6 +69,9 @@ void PASTEF77(ch,blasname)( \ PASTEMAC2(ch,ch,blisname)( n0, \ x0, incx0, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_symm.c b/frame/compat/bla_symm.c index 7178a0e86..8c8190fbf 100644 --- a/frame/compat/bla_symm.c +++ b/frame/compat/bla_symm.c @@ -59,6 +59,10 @@ void PASTEF77(ch,blasname)( \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,6 +103,9 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_symv.c b/frame/compat/bla_symv.c index de8472490..cfeda8a22 100644 --- a/frame/compat/bla_symv.c +++ b/frame/compat/bla_symv.c @@ -58,6 +58,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -93,6 +97,9 @@ void PASTEF77(ch,blasname)( \ x0, incx0, \ beta, \ y0, incy0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr.c b/frame/compat/bla_syr.c index 4899e7869..7a1c44d0f 100644 --- a/frame/compat/bla_syr.c +++ b/frame/compat/bla_syr.c @@ -54,6 +54,10 @@ void PASTEF77(ch,blasname)( \ ftype* x0; \ inc_t incx0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -84,6 +88,9 @@ void PASTEF77(ch,blasname)( \ alpha, \ x0, incx0, \ a, rs_a, cs_a ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr2.c b/frame/compat/bla_syr2.c index eaa764400..d97ee07da 100644 --- a/frame/compat/bla_syr2.c +++ b/frame/compat/bla_syr2.c @@ -57,6 +57,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t incy0; \ inc_t rs_a, cs_a; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -91,6 +95,9 @@ void PASTEF77(ch,blasname)( \ x0, incx0, \ y0, incy0, \ a, rs_a, cs_a ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syr2k.c b/frame/compat/bla_syr2k.c index 4e017f8ce..6fc91539b 100644 --- a/frame/compat/bla_syr2k.c +++ b/frame/compat/bla_syr2k.c @@ -59,6 +59,10 @@ void PASTEF77(ch,blasname)( \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -98,6 +102,9 @@ void PASTEF77(ch,blasname)( \ b, rs_b, cs_b, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_syrk.c b/frame/compat/bla_syrk.c index 6ed24a2df..d02c565f9 100644 --- a/frame/compat/bla_syrk.c +++ b/frame/compat/bla_syrk.c @@ -57,6 +57,10 @@ void PASTEF77(ch,blasname)( \ dim_t m0, k0; \ inc_t rs_a, cs_a; \ inc_t rs_c, cs_c; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -91,6 +95,9 @@ void PASTEF77(ch,blasname)( \ a, rs_a, cs_a, \ beta, \ c, rs_c, cs_c ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trmm.c b/frame/compat/bla_trmm.c index bc28cd83a..0535f4b25 100644 --- a/frame/compat/bla_trmm.c +++ b/frame/compat/bla_trmm.c @@ -60,6 +60,10 @@ void PASTEF77(ch,blasname)( \ dim_t m0, n0; \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,6 +103,9 @@ void PASTEF77(ch,blasname)( \ alpha, \ a, rs_a, cs_a, \ b, rs_b, cs_b ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trmv.c b/frame/compat/bla_trmv.c index bbbd8e985..a8c955a21 100644 --- a/frame/compat/bla_trmv.c +++ b/frame/compat/bla_trmv.c @@ -58,6 +58,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t rs_a, cs_a; \ ftype one; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -97,6 +101,9 @@ void PASTEF77(ch,blasname)( \ &one, \ a, rs_a, cs_a, \ x0, incx0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trsm.c b/frame/compat/bla_trsm.c index 998bacb31..37c751c4e 100644 --- a/frame/compat/bla_trsm.c +++ b/frame/compat/bla_trsm.c @@ -60,6 +60,10 @@ void PASTEF77(ch,blasname)( \ dim_t m0, n0; \ inc_t rs_a, cs_a; \ inc_t rs_b, cs_b; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -99,6 +103,9 @@ void PASTEF77(ch,blasname)( \ alpha, \ a, rs_a, cs_a, \ b, rs_b, cs_b ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS diff --git a/frame/compat/bla_trsv.c b/frame/compat/bla_trsv.c index 5df81a8f2..5bf8445f7 100644 --- a/frame/compat/bla_trsv.c +++ b/frame/compat/bla_trsv.c @@ -58,6 +58,10 @@ void PASTEF77(ch,blasname)( \ inc_t incx0; \ inc_t rs_a, cs_a; \ ftype one; \ + err_t init_result; \ +\ + /* Initialize BLIS (if it is not already initialized). */ \ + bli_init_safe( &init_result ); \ \ /* Perform BLAS parameter checking. */ \ PASTEBLACHK(blasname)( MKSTR(ch), \ @@ -97,6 +101,9 @@ void PASTEF77(ch,blasname)( \ &one, \ a, rs_a, cs_a, \ x0, incx0 ); \ +\ + /* Finalize BLIS (if it was initialized above). */ \ + bli_finalize_safe( init_result ); \ } #ifdef BLIS_ENABLE_BLAS2BLIS