mirror of
https://github.com/amd/blis.git
synced 2026-03-22 02:07:21 +00:00
Implemented library self-initialization.
Details: - Defined two new functions in bli_init.c: bli_init_once() and bli_finalize_once(). Each is implemented with pthread_once(), which guarantees that, among the threads that pass in the same pthread_once_t data structure, exactly one thread will execute a user-defined function. (Thus, there is now a runtime dependency against libpthread even when multithreading is not enabled at configure-time.) - Added calls to bli_init_once() to top-level user APIs for all computational operations as well as many other functions in BLIS to all but guarantee that BLIS will self-initialize through the normal use of its functions. - Rewrote and simplified bli_init() and bli_finalize() and related functions. - Added -lpthread to LDFLAGS in common.mk. - Modified the bli_init_auto()/_finalize_auto() functions used by the BLAS compatibility layer to take and return no arguments. (The previous API that tracked whether BLIS was initialized, and then only finalized if it was initialized in the same function, was too cute by half and borderline useless because by default BLIS stays initialized when auto-initialized via the compatibility layer.) - Removed static variables that track initialization of the sub-APIs in bli_const.c, bli_error.c, bli_init.c, bli_memsys.c, bli_thread, and bli_ind.c. We don't need to track initialization at the sub-API level, especially now that BLIS can self-initialize. - Added a critical section around the changing of the error checking level in bli_error.c. - Deprecated bli_ind_oper_has_avail() as well as all functions bli_<opname>_ind_get_avail(), where <opname> is a level-3 operation name. These functions had no use cases within BLIS and likely none outside of BLIS. - Commented out calls to bli_init() and bli_finalize() in testsuite's main() function, and likewise for standalone test drivers in 'test' directory, so that self-initialization is exercised by default.
This commit is contained in:
@@ -300,8 +300,10 @@ endif
|
||||
#
|
||||
|
||||
# Default linker, flags.
|
||||
# NOTE: -lpthread is needed unconditionally because BLIS uses pthread_once()
|
||||
# to initialize itself in a thread-safe manner.
|
||||
LINKER := $(CC)
|
||||
LDFLAGS :=
|
||||
LDFLAGS := -lpthread
|
||||
|
||||
# Never use libm with Intel compilers.
|
||||
ifneq ($(CC_VENDOR),icc)
|
||||
@@ -359,7 +361,6 @@ endif
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# --- Adjust verbosity level manually using make V=[0,1] -----------------------
|
||||
#
|
||||
@@ -384,6 +385,9 @@ ifeq ($(OS_NAME),Linux)
|
||||
LDFLAGS += -lrt
|
||||
endif
|
||||
|
||||
# Remove duplicate flags/options in LDFLAGS (such as -lpthread) by sorting.
|
||||
LDFLAGS := $(sort $(LDFLAGS))
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -47,6 +47,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* absq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi; \
|
||||
num_t dt_absq_c = bli_obj_datatype_proj_to_complex( *absq ); \
|
||||
\
|
||||
@@ -84,6 +86,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *psi ); \
|
||||
\
|
||||
conj_t conjchi = bli_obj_conj_status( *chi ); \
|
||||
@@ -119,6 +123,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *chi ); \
|
||||
\
|
||||
conj_t conjchi = bli_obj_conj_status( *chi ); \
|
||||
@@ -150,6 +156,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *psi ); \
|
||||
\
|
||||
void* buf_chi = bli_obj_buffer_for_1x1( dt, *chi ); \
|
||||
@@ -181,6 +189,8 @@ void PASTEMAC0(opname) \
|
||||
double* zeta_i \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi = bli_obj_datatype( *chi ); \
|
||||
num_t dt_def = BLIS_DCOMPLEX; \
|
||||
num_t dt_use; \
|
||||
@@ -222,6 +232,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi = bli_obj_datatype( *chi ); \
|
||||
\
|
||||
void* buf_chi = bli_obj_buffer_at_off( *chi ); \
|
||||
@@ -253,6 +265,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* zeta_i \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi; \
|
||||
num_t dt_zeta_c = bli_obj_datatype_proj_to_complex( *zeta_r ); \
|
||||
\
|
||||
@@ -293,6 +307,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi = bli_obj_datatype( *chi ); \
|
||||
\
|
||||
void* buf_zeta_r = bli_obj_buffer_for_1x1( dt_chi, *zeta_r ); \
|
||||
|
||||
@@ -48,6 +48,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype chi_conj; \
|
||||
\
|
||||
PASTEMAC(ch,copycjs)( conjchi, *chi, chi_conj ); \
|
||||
@@ -68,6 +70,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype chi_conj; \
|
||||
\
|
||||
PASTEMAC(ch,copycjs)( conjchi, *chi, chi_conj ); \
|
||||
@@ -88,6 +92,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( PASTEMAC(ch,eq0)( *chi ) ) \
|
||||
{ \
|
||||
/* Overwrite potential Infs and NaNs. */ \
|
||||
@@ -114,15 +120,17 @@ void PASTEMAC(ch,opname) \
|
||||
ctype_r* absq \
|
||||
) \
|
||||
{ \
|
||||
ctype_r chi_r; \
|
||||
ctype_r chi_i; \
|
||||
ctype_r absq_i; \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype_r chi_r; \
|
||||
ctype_r chi_i; \
|
||||
ctype_r absq_i; \
|
||||
\
|
||||
( void )absq_i; \
|
||||
\
|
||||
PASTEMAC2(ch,chr,gets)( *chi, chi_r, chi_i ); \
|
||||
PASTEMAC2(ch,chr,gets)( *chi, chi_r, chi_i ); \
|
||||
\
|
||||
/* absq = chi_r * chi_r + chi_i * chi_i; \
|
||||
/* absq = chi_r * chi_r + chi_i * chi_i; \
|
||||
absq_r = 0.0; (thrown away) */ \
|
||||
PASTEMAC(ch,absq2ris)( chi_r, chi_i, *absq, absq_i ); \
|
||||
\
|
||||
@@ -141,8 +149,10 @@ void PASTEMAC(ch,opname) \
|
||||
ctype_r* norm \
|
||||
) \
|
||||
{ \
|
||||
/* norm = sqrt( chi_r * chi_r + chi_i * chi_i ); */ \
|
||||
PASTEMAC2(ch,chr,abval2s)( *chi, *norm ); \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* norm = sqrt( chi_r * chi_r + chi_i * chi_i ); */ \
|
||||
PASTEMAC2(ch,chr,abval2s)( *chi, *norm ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNCR_BASIC0( normfsc )
|
||||
@@ -157,6 +167,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* NOTE: sqrtsc/sqrt2s differs from normfsc/abval2s in the complex domain. */ \
|
||||
PASTEMAC(ch,sqrt2s)( *chi, *psi ); \
|
||||
}
|
||||
@@ -174,6 +186,8 @@ void PASTEMAC(ch,opname) \
|
||||
double* zeta_i \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC2(ch,d,gets)( *chi, *zeta_r, *zeta_i ); \
|
||||
}
|
||||
|
||||
@@ -190,6 +204,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC2(d,ch,sets)( zeta_r, zeta_i, *chi ); \
|
||||
}
|
||||
|
||||
@@ -206,6 +222,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype_r* zeta_i \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC2(ch,chr,gets)( *chi, *zeta_r, *zeta_i ); \
|
||||
}
|
||||
|
||||
@@ -222,6 +240,8 @@ void PASTEMAC(ch,opname) \
|
||||
ctype* chi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC2(chr,ch,sets)( *zeta_r, *zeta_i, *chi ); \
|
||||
}
|
||||
|
||||
@@ -236,6 +256,8 @@ void bli_igetsc
|
||||
double* zeta_i
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
PASTEMAC2(i,d,gets)( *chi, *zeta_r, *zeta_i );
|
||||
}
|
||||
|
||||
@@ -246,6 +268,8 @@ void bli_isetsc
|
||||
dim_t* chi
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
PASTEMAC2(d,i,sets)( zeta_r, zeta_i, *chi );
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ void PASTEMAC0(opname) \
|
||||
obj_t* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
conj_t conjchi = bli_obj_conj_status( *chi ); \
|
||||
\
|
||||
num_t dt_psi = bli_obj_datatype( *psi ); \
|
||||
@@ -107,6 +109,8 @@ void PASTEMAC2(chx,chy,varname) \
|
||||
void* psi \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype_x* chi_cast = chi; \
|
||||
ctype_y* psi_cast = psi; \
|
||||
\
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -92,6 +94,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -132,6 +136,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -190,6 +196,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -243,6 +251,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -290,6 +300,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -350,6 +362,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -385,6 +399,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -434,6 +450,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -473,6 +491,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -83,6 +85,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -116,6 +120,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -151,6 +157,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -188,6 +196,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -226,6 +236,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -260,6 +272,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -290,6 +304,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -322,6 +338,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -353,6 +371,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -101,6 +103,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -160,6 +164,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -200,6 +206,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -254,6 +262,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
|
||||
@@ -53,6 +53,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
@@ -125,6 +127,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
@@ -193,6 +197,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
@@ -243,6 +249,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
@@ -295,6 +303,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
const num_t dt_r = PASTEMAC(chr,type); \
|
||||
\
|
||||
|
||||
@@ -53,6 +53,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -117,6 +119,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -183,6 +187,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -249,6 +255,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -330,6 +338,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
|
||||
@@ -54,6 +54,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -94,6 +96,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -135,6 +139,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -181,6 +187,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -227,6 +235,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -103,6 +105,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -165,6 +169,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -235,6 +241,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
|
||||
@@ -54,6 +54,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( bli_zero_dim2( m, n ) ) return; \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -113,6 +115,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( bli_zero_dim2( m, n ) ) return; \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -177,6 +181,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( bli_zero_dim2( m, n ) ) return; \
|
||||
\
|
||||
/* If alpha is zero, then the entire operation is a no-op. */ \
|
||||
@@ -241,6 +247,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( bli_zero_dim2( m, n ) ) return; \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
@@ -325,6 +333,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
if ( bli_zero_dim2( m, n ) ) return; \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
|
||||
@@ -43,6 +43,8 @@ siz_t bli_packm_init
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
// The purpose of packm_init() is to initialize an object P so that
|
||||
// a source object A can be packed into P via one of the packm
|
||||
// implementations. This initialization precedes the acquisition of a
|
||||
@@ -185,6 +187,8 @@ siz_t bli_packm_init_pack
|
||||
cntx_t* cntx
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
num_t dt = bli_obj_datatype( *a );
|
||||
trans_t transa = bli_obj_onlytrans_status( *a );
|
||||
dim_t m_a = bli_obj_length( *a );
|
||||
|
||||
@@ -43,6 +43,8 @@ void bli_packm_int
|
||||
thrinfo_t* thread
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
packm_voft f;
|
||||
|
||||
// Check parameters.
|
||||
|
||||
@@ -43,6 +43,8 @@ void bli_unpackm_int
|
||||
thrinfo_t* thread
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
unpackm_voft f;
|
||||
|
||||
// Check parameters.
|
||||
|
||||
@@ -53,6 +53,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -120,6 +122,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -182,6 +186,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -249,6 +255,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -306,6 +314,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -367,6 +377,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
|
||||
@@ -55,6 +55,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
dim_t m_y, n_x; \
|
||||
\
|
||||
/* Determine the dimensions of y and x. */ \
|
||||
@@ -131,6 +133,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x or y has zero elements, or if alpha is zero, return early. */ \
|
||||
if ( bli_zero_dim2( m, n ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \
|
||||
\
|
||||
@@ -179,6 +183,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
@@ -247,6 +253,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype alpha_local; \
|
||||
\
|
||||
/* If x has zero elements, or if alpha is zero, return early. */ \
|
||||
@@ -306,6 +314,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x has zero elements, or if alpha is zero, return early. */ \
|
||||
if ( bli_zero_dim1( m ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \
|
||||
\
|
||||
@@ -360,6 +370,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x has zero elements, or if alpha is zero, return early. */ \
|
||||
if ( bli_zero_dim1( m ) || PASTEMAC(ch,eq0)( *alpha ) ) return; \
|
||||
\
|
||||
@@ -416,6 +428,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x has zero elements, return early. */ \
|
||||
if ( bli_zero_dim1( m ) ) return; \
|
||||
\
|
||||
|
||||
@@ -48,6 +48,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
\
|
||||
trans_t transa = bli_obj_conjtrans_status( *a ); \
|
||||
|
||||
@@ -47,6 +47,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
\
|
||||
conj_t conjx = bli_obj_conj_status( *x ); \
|
||||
|
||||
@@ -49,6 +49,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
\
|
||||
uplo_t uplo = bli_obj_uplo( *a ); \
|
||||
|
||||
@@ -47,6 +47,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
\
|
||||
uplo_t uplo = bli_obj_uplo( *c ); \
|
||||
|
||||
@@ -49,6 +49,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
\
|
||||
uplo_t uplo = bli_obj_uplo( *c ); \
|
||||
|
||||
@@ -46,6 +46,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
\
|
||||
uplo_t uploa = bli_obj_uplo( *a ); \
|
||||
|
||||
@@ -46,6 +46,8 @@ void PASTEMAC0(opname) \
|
||||
cntl_t* cntl \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
\
|
||||
uplo_t uploa = bli_obj_uplo( *a ); \
|
||||
|
||||
@@ -53,6 +53,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
/* Invoke the operation's "ind" function--its induced method front-end.
|
||||
@@ -90,6 +92,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
PASTEMAC(opname,ind) \
|
||||
@@ -121,6 +125,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
PASTEMAC(opname,ind) \
|
||||
@@ -149,6 +155,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
PASTEMAC(opname,ind) \
|
||||
|
||||
@@ -59,6 +59,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -112,6 +114,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -167,6 +171,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt_r = PASTEMAC(chr,type); \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
@@ -218,6 +224,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt_r = PASTEMAC(chr,type); \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
@@ -272,6 +280,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, betao, co; \
|
||||
@@ -322,6 +332,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -379,6 +391,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -435,6 +449,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo; \
|
||||
|
||||
@@ -47,6 +47,8 @@ void PASTEMAC0(opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
\
|
||||
dim_t k = bli_obj_width( *a ); \
|
||||
@@ -96,6 +98,8 @@ void PASTEMAC0(opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
\
|
||||
void* buf_a = bli_obj_buffer_at_off( *a ); \
|
||||
@@ -158,6 +162,8 @@ void PASTEMAC0(opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c11 ); \
|
||||
\
|
||||
dim_t k = bli_obj_width( *a1x ); \
|
||||
|
||||
@@ -49,6 +49,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* restrict cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Query the context for the function address of the current
|
||||
@@ -83,6 +85,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* restrict cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Query the context for the function address of the current
|
||||
@@ -119,6 +123,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* restrict cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
/* Query the context for the function address of the current
|
||||
|
||||
@@ -45,6 +45,8 @@ void bli_gemm_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -46,6 +46,8 @@ void bli_hemm_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -45,6 +45,8 @@ void bli_her2k_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t alpha_conj;
|
||||
obj_t c_local;
|
||||
obj_t a_local;
|
||||
|
||||
@@ -44,6 +44,8 @@ void bli_herk_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t ah_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -46,6 +46,8 @@ void bli_symm_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -45,6 +45,8 @@ void bli_syr2k_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t c_local;
|
||||
obj_t a_local;
|
||||
obj_t bt_local;
|
||||
|
||||
@@ -44,6 +44,8 @@ void bli_syrk_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t at_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -44,6 +44,8 @@ void bli_trmm_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -46,6 +46,8 @@ void bli_trmm3_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -44,6 +44,8 @@ void bli_trsm_front
|
||||
cntl_t* cntl
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
obj_t a_local;
|
||||
obj_t b_local;
|
||||
obj_t c_local;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
|
||||
blksz_t* bli_blksz_create_ed
|
||||
(
|
||||
dim_t b_s, dim_t be_s,
|
||||
|
||||
@@ -72,6 +72,13 @@ dim_t bli_cntx_get_num_threads_in
|
||||
|
||||
void bli_cntx_set_blkszs( ind_t method, dim_t n_bs, ... )
|
||||
{
|
||||
// This function can be called from the bli_cntx_init_*() function for
|
||||
// a particular architecture if the kernel developer wishes to use
|
||||
// non-default blocksizes. It should be called after
|
||||
// bli_cntx_init_defaults() so that default blocksizes remain
|
||||
// for any datatypes / register blocksizes that were not targed for
|
||||
// optimization.
|
||||
|
||||
/* Example prototypes:
|
||||
|
||||
void bli_cntx_set_blkszs
|
||||
@@ -474,6 +481,13 @@ void bli_cntx_set_ind_blkszs( ind_t method, dim_t n_bs, ... )
|
||||
|
||||
void bli_cntx_set_l3_nat_ukrs( dim_t n_ukrs, ... )
|
||||
{
|
||||
// This function can be called from the bli_cntx_init_*() function for
|
||||
// a particular architecture if the kernel developer wishes to use
|
||||
// non-default level-3 microkernels. It should be called after
|
||||
// bli_cntx_init_defaults() so that default functions are still called
|
||||
// for any datatypes / register blocksizes that were not targed for
|
||||
// optimization.
|
||||
|
||||
/* Example prototypes:
|
||||
|
||||
void bli_cntx_set_l3_nat_ukrs
|
||||
|
||||
@@ -42,13 +42,8 @@ obj_t BLIS_MINUS_ONE_HALF = {};
|
||||
obj_t BLIS_MINUS_ONE = {};
|
||||
obj_t BLIS_MINUS_TWO = {};
|
||||
|
||||
static bool_t bli_const_is_init = FALSE;
|
||||
|
||||
void bli_const_init( void )
|
||||
{
|
||||
// If the API is already initialized, return early.
|
||||
if ( bli_const_is_initialized() ) return;
|
||||
|
||||
bli_obj_create_const( 2.0, &BLIS_TWO );
|
||||
bli_obj_create_const( 1.0, &BLIS_ONE );
|
||||
bli_obj_create_const( 0.5, &BLIS_ONE_HALF );
|
||||
@@ -56,9 +51,6 @@ void bli_const_init( void )
|
||||
bli_obj_create_const( -0.5, &BLIS_MINUS_ONE_HALF );
|
||||
bli_obj_create_const( -1.0, &BLIS_MINUS_ONE );
|
||||
bli_obj_create_const( -2.0, &BLIS_MINUS_TWO );
|
||||
|
||||
// Mark API as initialized.
|
||||
bli_const_is_init = TRUE;
|
||||
}
|
||||
|
||||
void bli_const_finalize( void )
|
||||
@@ -70,13 +62,5 @@ void bli_const_finalize( void )
|
||||
bli_obj_free( &BLIS_MINUS_ONE_HALF );
|
||||
bli_obj_free( &BLIS_MINUS_ONE );
|
||||
bli_obj_free( &BLIS_MINUS_TWO );
|
||||
|
||||
// Mark API as uninitialized.
|
||||
bli_const_is_init = FALSE;
|
||||
}
|
||||
|
||||
bool_t bli_const_is_initialized( void )
|
||||
{
|
||||
return bli_const_is_init;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
*/
|
||||
|
||||
void bli_const_init( void );
|
||||
void bli_const_finalize( void );
|
||||
bool_t bli_const_is_initialized( void );
|
||||
void bli_const_init( void );
|
||||
void bli_const_finalize( void );
|
||||
|
||||
|
||||
@@ -34,28 +34,13 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
static bool_t bli_error_is_init = FALSE;
|
||||
|
||||
void bli_error_init( void )
|
||||
{
|
||||
// If the API is already initialized, return early.
|
||||
if ( bli_error_is_initialized() ) return;
|
||||
|
||||
bli_error_init_msgs();
|
||||
|
||||
// Mark API as initialized.
|
||||
bli_error_is_init = TRUE;
|
||||
}
|
||||
|
||||
void bli_error_finalize( void )
|
||||
{
|
||||
// Mark API as uninitialized.
|
||||
bli_error_is_init = FALSE;
|
||||
}
|
||||
|
||||
bool_t bli_error_is_initialized( void )
|
||||
{
|
||||
return bli_error_is_init;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -212,32 +197,46 @@ void bli_abort( void )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
static pthread_mutex_t err_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
// Current error checking level.
|
||||
static errlev_t bli_err_chk_level = BLIS_FULL_ERROR_CHECKING;
|
||||
|
||||
errlev_t bli_error_checking_level( void )
|
||||
{
|
||||
return bli_err_chk_level;
|
||||
return bli_err_chk_level;
|
||||
}
|
||||
|
||||
errlev_t bli_error_checking_level_set( errlev_t new_level )
|
||||
void bli_error_checking_level_set( errlev_t new_level )
|
||||
{
|
||||
err_t e_val;
|
||||
errlev_t old_level;
|
||||
err_t e_val;
|
||||
|
||||
e_val = bli_check_valid_error_level( new_level );
|
||||
bli_check_error_code( e_val );
|
||||
e_val = bli_check_valid_error_level( new_level );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
old_level = bli_err_chk_level;
|
||||
#ifdef BLIS_ENABLE_OPENMP
|
||||
_Pragma( "omp critical (err)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &err_mutex );
|
||||
#endif
|
||||
|
||||
bli_err_chk_level = new_level;
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
bli_err_chk_level = new_level;
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
return old_level;
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &err_mutex );
|
||||
#endif
|
||||
}
|
||||
|
||||
bool_t bli_error_checking_is_enabled( void )
|
||||
{
|
||||
return bli_error_checking_level() != BLIS_NO_ERROR_CHECKING;
|
||||
return bli_error_checking_level() != BLIS_NO_ERROR_CHECKING;
|
||||
}
|
||||
|
||||
char* bli_error_string_for_code( gint_t code )
|
||||
|
||||
@@ -35,14 +35,13 @@
|
||||
|
||||
void bli_error_init( void );
|
||||
void bli_error_finalize( void );
|
||||
bool_t bli_error_is_initialized( void );
|
||||
|
||||
void bli_error_init_msgs( void );
|
||||
void bli_print_msg( char* str, char* file, guint_t line );
|
||||
void bli_abort( void );
|
||||
|
||||
errlev_t bli_error_checking_level( void );
|
||||
errlev_t bli_error_checking_level_set( errlev_t new_level );
|
||||
void bli_error_checking_level_set( errlev_t new_level );
|
||||
|
||||
bool_t bli_error_checking_is_enabled( void );
|
||||
|
||||
|
||||
@@ -59,9 +59,6 @@ typedef void (*ind_cntx_init_ft)( ind_t method, num_t dt, cntx_t* cntx );
|
||||
|
||||
void bli_gks_init( void )
|
||||
{
|
||||
// BEGIN CRITICAL SECTION
|
||||
// NOTE: This critical section is implicit. We assume this function is only
|
||||
// called from within the critical section within bli_init().
|
||||
{
|
||||
// Initialize the internal data structure we use to track registered
|
||||
// contexts.
|
||||
@@ -165,7 +162,6 @@ void bli_gks_init( void )
|
||||
bli_cntx_init_generic_ind );
|
||||
#endif
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -384,6 +380,8 @@ cntx_t* bli_gks_query_cntx( void )
|
||||
|
||||
cntx_t* bli_gks_query_nat_cntx( void )
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
// Return the address of the native context for the architecture id
|
||||
// corresponding to the current hardware, as determined by
|
||||
// bli_arch_query_id().
|
||||
@@ -405,6 +403,8 @@ cntx_t* bli_gks_query_ind_cntx
|
||||
num_t dt
|
||||
)
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
cntx_t* gks_id_ind;
|
||||
|
||||
// Return the address of a context that will be suited for executing a
|
||||
|
||||
@@ -61,86 +61,6 @@ kimpl_t bli_gks_l3_ukr_impl_type( l3ukr_t ukr, ind_t method, num_t dt );
|
||||
|
||||
//char* bli_gks_l3_ukr_avail_impl_string( l3ukr_t ukr, num_t dt );
|
||||
|
||||
#if 0
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_blksz( bszid_t bs_id,
|
||||
blksz_t* blksz );
|
||||
|
||||
void bli_gks_cntx_set_blkszs( ind_t method, dim_t n_bs, ... );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_l3_nat_ukr( l3ukr_t ukr,
|
||||
func_t* func );
|
||||
void bli_gks_get_l3_vir_ukr( ind_t method,
|
||||
l3ukr_t ukr,
|
||||
func_t* func );
|
||||
void bli_gks_get_l3_ref_ukr( l3ukr_t ukr,
|
||||
func_t* func );
|
||||
void bli_gks_cntx_set_l3_nat_ukr( l3ukr_t ukr,
|
||||
cntx_t* cntx );
|
||||
void bli_gks_cntx_set_l3_vir_ukr( ind_t method,
|
||||
l3ukr_t ukr,
|
||||
cntx_t* cntx );
|
||||
|
||||
void bli_gks_cntx_set_l3_nat_ukrs( dim_t n_uk, ... );
|
||||
void bli_gks_cntx_set_l3_vir_ukrs( ind_t method, dim_t n_uk, ... );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_l3_nat_ukr_prefs( l3ukr_t ukr,
|
||||
mbool_t* mbool );
|
||||
void bli_gks_cntx_set_l3_nat_ukr_prefs( l3ukr_t ukr,
|
||||
cntx_t* cntx );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_packm_ker( l1mkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_get_packm_ref_ker( l1mkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_cntx_set_packm_ker( l1mkr_t ker,
|
||||
cntx_t* cntx );
|
||||
|
||||
void bli_gks_cntx_set_packm_kers( dim_t n_kr, ... );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_unpackm_ker( l1mkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_get_unpackm_ref_ker( l1mkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_cntx_set_unpackm_ker( l1mkr_t ker,
|
||||
cntx_t* cntx );
|
||||
|
||||
void bli_gks_cntx_set_unpackm_kers( dim_t n_kr, ... );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_l1f_ker( l1fkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_get_l1f_ref_ker( l1fkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_cntx_set_l1f_ker( l1fkr_t ker,
|
||||
cntx_t* cntx );
|
||||
|
||||
void bli_gks_cntx_set_l1f_kers( dim_t n_kr, ... );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_gks_get_l1v_ker( l1vkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_get_l1v_ref_ker( l1vkr_t ker,
|
||||
func_t* func );
|
||||
void bli_gks_cntx_set_l1v_ker( l1vkr_t ker,
|
||||
cntx_t* cntx );
|
||||
|
||||
void bli_gks_cntx_set_l1v_kers( dim_t n_kr, ... );
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,11 +35,6 @@
|
||||
#include "blis.h"
|
||||
|
||||
|
||||
// NOTE: The values handled here may be queried even before bli_init()
|
||||
// is called!
|
||||
|
||||
|
||||
|
||||
// -- General library information ----------------------------------------------
|
||||
|
||||
// This string gets defined via -D on the command line when BLIS is compiled.
|
||||
@@ -100,23 +95,15 @@ gint_t bli_info_get_blas2blis_int_type_size( void ) { return BLIS_BLAS2BLIS_INT_
|
||||
// -- Level-3 kernel definitions --
|
||||
|
||||
char* bli_info_get_gemm_ukr_impl_string( ind_t method, num_t dt )
|
||||
{ return bli_gks_l3_ukr_impl_string( BLIS_GEMM_UKR, method, dt ); }
|
||||
{ bli_init_once(); return bli_gks_l3_ukr_impl_string( BLIS_GEMM_UKR, method, dt ); }
|
||||
char* bli_info_get_gemmtrsm_l_ukr_impl_string( ind_t method, num_t dt )
|
||||
{ return bli_gks_l3_ukr_impl_string( BLIS_GEMMTRSM_L_UKR, method, dt ); }
|
||||
{ bli_init_once(); return bli_gks_l3_ukr_impl_string( BLIS_GEMMTRSM_L_UKR, method, dt ); }
|
||||
char* bli_info_get_gemmtrsm_u_ukr_impl_string( ind_t method, num_t dt )
|
||||
{ return bli_gks_l3_ukr_impl_string( BLIS_GEMMTRSM_U_UKR, method, dt ); }
|
||||
{ bli_init_once(); return bli_gks_l3_ukr_impl_string( BLIS_GEMMTRSM_U_UKR, method, dt ); }
|
||||
char* bli_info_get_trsm_l_ukr_impl_string( ind_t method, num_t dt )
|
||||
{ return bli_gks_l3_ukr_impl_string( BLIS_TRSM_L_UKR, method, dt ); }
|
||||
{ bli_init_once(); return bli_gks_l3_ukr_impl_string( BLIS_TRSM_L_UKR, method, dt ); }
|
||||
char* bli_info_get_trsm_u_ukr_impl_string( ind_t method, num_t dt )
|
||||
{ return bli_gks_l3_ukr_impl_string( BLIS_TRSM_U_UKR, method, dt ); }
|
||||
|
||||
|
||||
|
||||
// -- Memory pool-related ------------------------------------------------------
|
||||
|
||||
gint_t bli_info_get_mk_pool_size( void ) { return bli_membrk_pool_size( bli_memsys_global_membrk(), BLIS_BUFFER_FOR_A_BLOCK ); }
|
||||
gint_t bli_info_get_kn_pool_size( void ) { return bli_membrk_pool_size( bli_memsys_global_membrk(), BLIS_BUFFER_FOR_B_PANEL ); }
|
||||
gint_t bli_info_get_mn_pool_size( void ) { return bli_membrk_pool_size( bli_memsys_global_membrk(), BLIS_BUFFER_FOR_C_PANEL ); }
|
||||
{ bli_init_once(); return bli_gks_l3_ukr_impl_string( BLIS_TRSM_U_UKR, method, dt ); }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -71,13 +71,6 @@ char* bli_info_get_trsm_l_ukr_impl_string( ind_t method, num_t dt );
|
||||
char* bli_info_get_trsm_u_ukr_impl_string( ind_t method, num_t dt );
|
||||
|
||||
|
||||
// -- Memory pool-related ------------------------------------------------------
|
||||
|
||||
gint_t bli_info_get_mk_pool_size( void );
|
||||
gint_t bli_info_get_kn_pool_size( void );
|
||||
gint_t bli_info_get_mn_pool_size( void );
|
||||
|
||||
|
||||
// -- BLIS implementation query (level-3) --------------------------------------
|
||||
|
||||
char* bli_info_get_gemm_impl_string( num_t dt );
|
||||
|
||||
@@ -34,160 +34,26 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static bool_t bli_is_init = FALSE;
|
||||
|
||||
|
||||
err_t bli_init( void )
|
||||
void bli_init( void )
|
||||
{
|
||||
err_t r_val = BLIS_FAILURE;
|
||||
|
||||
// If bli_is_init is TRUE, then we know without a doubt that
|
||||
// BLIS is presently initialized, and thus we can return early.
|
||||
if ( bli_is_init == TRUE ) return r_val;
|
||||
|
||||
// NOTE: if bli_is_init 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_is_init accordingly. This boolean asymmetry is important!
|
||||
|
||||
// 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.
|
||||
|
||||
#ifdef BLIS_ENABLE_OPENMP
|
||||
_Pragma( "omp critical (init)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &init_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
|
||||
// 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_is_init, or (b) testing bli_is_init within the critical section
|
||||
// (for the purposes of deciding whether to perform the necessary
|
||||
// initialization subtasks).
|
||||
if ( bli_is_init == FALSE )
|
||||
{
|
||||
// Initialize various sub-APIs.
|
||||
bli_const_init();
|
||||
bli_error_init();
|
||||
bli_gks_init();
|
||||
bli_ind_init();
|
||||
bli_thread_init();
|
||||
bli_memsys_init();
|
||||
|
||||
// After initialization is complete, mark BLIS as initialized.
|
||||
bli_is_init = TRUE;
|
||||
|
||||
// Only the thread that actually performs the initialization will
|
||||
// return "success".
|
||||
r_val = BLIS_SUCCESS;
|
||||
}
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &init_mutex );
|
||||
#endif
|
||||
|
||||
return r_val;
|
||||
bli_init_once();
|
||||
}
|
||||
|
||||
err_t bli_finalize( void )
|
||||
void bli_finalize( void )
|
||||
{
|
||||
err_t r_val = BLIS_FAILURE;
|
||||
|
||||
// If bli_is_init is FALSE, then we know without a doubt that
|
||||
// BLIS is presently uninitialized, and thus we can return early.
|
||||
if ( bli_is_init == FALSE ) return r_val;
|
||||
|
||||
// NOTE: if bli_is_init 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_is_init accordingly. This boolean asymmetry is important!
|
||||
|
||||
// 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.
|
||||
|
||||
#ifdef BLIS_ENABLE_OPENMP
|
||||
_Pragma( "omp critical (init)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &init_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
|
||||
// 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_is_init, or (b) testing bli_is_init within the critical section
|
||||
// (for the purposes of deciding whether to perform the necessary
|
||||
// finalization subtasks).
|
||||
if ( bli_is_init == TRUE )
|
||||
{
|
||||
// Finalize various sub-APIs.
|
||||
bli_const_finalize();
|
||||
bli_error_finalize();
|
||||
bli_memsys_finalize();
|
||||
bli_thread_finalize();
|
||||
bli_gks_finalize();
|
||||
bli_ind_finalize();
|
||||
|
||||
// After finalization is complete, mark BLIS as uninitialized.
|
||||
bli_is_init = FALSE;
|
||||
|
||||
// Only the thread that actually performs the finalization will
|
||||
// return "success".
|
||||
r_val = BLIS_SUCCESS;
|
||||
}
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &init_mutex );
|
||||
#endif
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_destroy( &init_mutex );
|
||||
#endif
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
bool_t bli_is_initialized( void )
|
||||
{
|
||||
return bli_is_init;
|
||||
bli_finalize_once();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_init_auto( err_t* init_result )
|
||||
void bli_init_auto( void )
|
||||
{
|
||||
*init_result = bli_init();
|
||||
bli_init_once();
|
||||
}
|
||||
|
||||
void bli_finalize_auto( err_t init_result )
|
||||
void bli_finalize_auto( void )
|
||||
{
|
||||
#ifdef BLIS_ENABLE_STAY_AUTO_INITIALIZED
|
||||
|
||||
@@ -198,14 +64,71 @@ void bli_finalize_auto( err_t init_result )
|
||||
|
||||
#else
|
||||
|
||||
// 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();
|
||||
bli_finalize_once();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static bool_t bli_is_init = FALSE;
|
||||
|
||||
void bli_init_apis( void )
|
||||
{
|
||||
// Mark that initialization has begun so recursive calls to
|
||||
// bli_init_once() do not result in an infinite loop and/or
|
||||
// pthread_once() hanging.
|
||||
bli_is_init = TRUE;
|
||||
|
||||
// Initialize various sub-APIs.
|
||||
bli_const_init();
|
||||
bli_error_init();
|
||||
bli_gks_init();
|
||||
bli_ind_init();
|
||||
bli_thread_init();
|
||||
bli_memsys_init();
|
||||
}
|
||||
|
||||
void bli_finalize_apis( void )
|
||||
{
|
||||
bli_is_init = FALSE;
|
||||
|
||||
// Finalize various sub-APIs.
|
||||
bli_memsys_finalize();
|
||||
bli_thread_finalize();
|
||||
bli_gks_finalize();
|
||||
bli_ind_finalize();
|
||||
bli_error_finalize();
|
||||
bli_const_finalize();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
// A pthread structure used in pthread_once(). pthread_once() is guaranteed to
|
||||
// execute exactly once among all threads that pass in this control object.
|
||||
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
|
||||
|
||||
void bli_init_once( void )
|
||||
{
|
||||
// If initialization has already occurred (or is already in progress),
|
||||
// return early.
|
||||
// NOTE: This early return is important because some implementations of
|
||||
// pthread_once() will hang if called recursively (i.e., called from
|
||||
// within a user function which, in addition to being called from
|
||||
// pthread_once() also calls pthread_once()).
|
||||
if ( bli_is_init ) return;
|
||||
|
||||
pthread_once( &once_control, bli_init_apis );
|
||||
}
|
||||
|
||||
void bli_finalize_once( void )
|
||||
{
|
||||
// If finalization has already occurred (or is already in progress),
|
||||
// return early.
|
||||
if ( !bli_is_init ) return;
|
||||
|
||||
pthread_once( &once_control, bli_finalize_apis );
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,15 @@
|
||||
|
||||
*/
|
||||
|
||||
err_t bli_init( void );
|
||||
err_t bli_finalize( void );
|
||||
bool_t bli_is_initialized( void );
|
||||
void bli_init( void );
|
||||
void bli_finalize( void );
|
||||
|
||||
void bli_init_auto( void );
|
||||
void bli_finalize_auto( void );
|
||||
|
||||
void bli_init_apis( void );
|
||||
void bli_finalize_apis( void );
|
||||
|
||||
void bli_init_once( void );
|
||||
void bli_finalize_once( void );
|
||||
|
||||
void bli_init_auto( err_t* init_result );
|
||||
void bli_finalize_auto( err_t init_result );
|
||||
|
||||
@@ -56,5 +56,5 @@ void bli_free_align( free_ft f, void* p );
|
||||
void* bli_malloc_noalign( malloc_ft f, size_t size );
|
||||
void bli_free_noalign( free_ft f, void* p );
|
||||
|
||||
void bli_malloc_align_check( malloc_ft f, size_t size, size_t align_size );
|
||||
void bli_malloc_align_check( malloc_ft f, size_t size, size_t align_size );
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "blis.h"
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
static pthread_mutex_t mem_manager_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t memsys_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
static membrk_t global_membrk;
|
||||
@@ -50,16 +50,10 @@ membrk_t* bli_memsys_global_membrk( void )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static bool_t bli_memsys_is_init = FALSE;
|
||||
|
||||
void bli_memsys_init( void )
|
||||
{
|
||||
cntx_t* cntx_p;
|
||||
|
||||
// If the initialization flag is TRUE, we know the API is already
|
||||
// initialized, so we can return early.
|
||||
if ( bli_memsys_is_init == TRUE ) return;
|
||||
|
||||
// Query a native context so we have something to pass into
|
||||
// bli_membrk_init_pools(). We use BLIS_DOUBLE for the datatype,
|
||||
// but the dt argument is actually only used when initializing
|
||||
@@ -70,29 +64,18 @@ void bli_memsys_init( void )
|
||||
_Pragma( "omp critical (mem)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &mem_manager_mutex );
|
||||
pthread_mutex_lock( &memsys_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
// Here, we test the initialization flag again. NOTE: THIS IS NOT
|
||||
// REDUNDANT. This additional test is needed so that other threads
|
||||
// that may be waiting to acquire the lock do not perform any
|
||||
// initialization actions once they are finally allowed into this
|
||||
// critical section.
|
||||
if ( bli_memsys_is_init == FALSE )
|
||||
{
|
||||
// Initialize the global membrk_t object and its memory pools.
|
||||
bli_membrk_init( cntx_p, &global_membrk );
|
||||
|
||||
// After initialization, mark the API as initialized.
|
||||
bli_memsys_is_init = TRUE;
|
||||
}
|
||||
// Initialize the global membrk_t object and its memory pools.
|
||||
bli_membrk_init( cntx_p, &global_membrk );
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &mem_manager_mutex );
|
||||
pthread_mutex_unlock( &memsys_mutex );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -102,72 +85,39 @@ void bli_memsys_reinit( cntx_t* cntx )
|
||||
_Pragma( "omp critical (mem)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &mem_manager_mutex );
|
||||
pthread_mutex_lock( &memsys_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
// If for some reason the memory pools have not yet been
|
||||
// initialized (unlikely), we emulate the body of bli_memsys_init().
|
||||
if ( bli_memsys_is_init == FALSE )
|
||||
{
|
||||
// Initialize the global membrk_t object and its memory pools.
|
||||
bli_membrk_init( cntx, &global_membrk );
|
||||
|
||||
// After initialization, mark the API as initialized.
|
||||
bli_memsys_is_init = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reinitialize the global membrk_t object's memory pools.
|
||||
bli_membrk_reinit_pools( cntx, &global_membrk );
|
||||
}
|
||||
// Reinitialize the global membrk_t object's memory pools.
|
||||
bli_membrk_reinit_pools( cntx, &global_membrk );
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &mem_manager_mutex );
|
||||
pthread_mutex_unlock( &memsys_mutex );
|
||||
#endif
|
||||
}
|
||||
|
||||
void bli_memsys_finalize( void )
|
||||
{
|
||||
// If the initialization flag is FALSE, we know the API is already
|
||||
// uninitialized, so we can return early.
|
||||
if ( bli_memsys_is_init == FALSE ) return;
|
||||
|
||||
#ifdef BLIS_ENABLE_OPENMP
|
||||
_Pragma( "omp critical (mem)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &mem_manager_mutex );
|
||||
pthread_mutex_lock( &memsys_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
// Here, we test the initialization flag again. NOTE: THIS IS NOT
|
||||
// REDUNDANT. This additional test is needed so that other threads
|
||||
// that may be waiting to acquire the lock do not perform any
|
||||
// finalization actions once they are finally allowed into this
|
||||
// critical section.
|
||||
if ( bli_memsys_is_init == TRUE )
|
||||
{
|
||||
// Finalize the global membrk_t object and its memory pools.
|
||||
bli_membrk_finalize( &global_membrk );
|
||||
|
||||
// After finalization, mark the API as uninitialized.
|
||||
bli_memsys_is_init = FALSE;
|
||||
}
|
||||
// Finalize the global membrk_t object and its memory pools.
|
||||
bli_membrk_finalize( &global_membrk );
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &mem_manager_mutex );
|
||||
pthread_mutex_unlock( &memsys_mutex );
|
||||
#endif
|
||||
}
|
||||
|
||||
bool_t bli_memsys_is_initialized( void )
|
||||
{
|
||||
return bli_memsys_is_init;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,9 @@ membrk_t* bli_memsys_global_membrk( void );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_memsys_init( void );
|
||||
void bli_memsys_reinit( cntx_t* cntx );
|
||||
void bli_memsys_finalize( void );
|
||||
bool_t bli_memsys_is_initialized( void );
|
||||
void bli_memsys_init( void );
|
||||
void bli_memsys_reinit( cntx_t* cntx );
|
||||
void bli_memsys_finalize( void );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,6 +41,8 @@ void bli_obj_create( num_t dt,
|
||||
inc_t cs,
|
||||
obj_t* obj )
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
bli_obj_create_without_buffer( dt, m, n, obj );
|
||||
|
||||
bli_obj_alloc_buffer( rs, cs, 1, obj );
|
||||
@@ -54,6 +56,8 @@ void bli_obj_create_with_attached_buffer( num_t dt,
|
||||
inc_t cs,
|
||||
obj_t* obj )
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
bli_obj_create_without_buffer( dt, m, n, obj );
|
||||
|
||||
bli_obj_attach_buffer( p, rs, cs, 1, obj );
|
||||
@@ -240,8 +244,6 @@ void bli_obj_create_const( double value, obj_t* obj )
|
||||
temp_z = bli_obj_buffer_for_const( BLIS_DCOMPLEX, *obj );
|
||||
temp_i = bli_obj_buffer_for_const( BLIS_INT, *obj );
|
||||
|
||||
// Use the bli_??sets() macros to set the temp variables in order to
|
||||
// properly support BLIS_ENABLE_C99_COMPLEX.
|
||||
bli_dssets( value, 0.0, *temp_s );
|
||||
bli_ddsets( value, 0.0, *temp_d );
|
||||
bli_dcsets( value, 0.0, *temp_c );
|
||||
@@ -250,6 +252,7 @@ void bli_obj_create_const( double value, obj_t* obj )
|
||||
*temp_i = ( gint_t ) value;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void bli_obj_create_const_copy_of( obj_t* a, obj_t* b )
|
||||
{
|
||||
gint_t* temp_i;
|
||||
@@ -303,6 +306,7 @@ void bli_obj_create_const_copy_of( obj_t* a, obj_t* b )
|
||||
|
||||
*temp_i = ( gint_t ) bli_zreal( value );
|
||||
}
|
||||
#endif
|
||||
|
||||
void bli_adjust_strides( dim_t m,
|
||||
dim_t n,
|
||||
@@ -462,6 +466,8 @@ num_t bli_datatype_union( num_t dt1, num_t dt2 )
|
||||
|
||||
void bli_obj_print( char* label, obj_t* obj )
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
FILE* file = stdout;
|
||||
|
||||
if ( bli_error_checking_is_enabled() )
|
||||
|
||||
@@ -76,7 +76,7 @@ void bli_obj_free( obj_t* obj );
|
||||
|
||||
void bli_obj_create_const( double value, obj_t* obj );
|
||||
|
||||
void bli_obj_create_const_copy_of( obj_t* a, obj_t* b );
|
||||
//void bli_obj_create_const_copy_of( obj_t* a, obj_t* b );
|
||||
|
||||
void bli_adjust_strides( dim_t m,
|
||||
dim_t n,
|
||||
|
||||
@@ -139,6 +139,7 @@ void bli_obj_create_const_check( double value, obj_t* obj )
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
|
||||
#if 0
|
||||
void bli_obj_create_const_copy_of_check( obj_t* a, obj_t* b )
|
||||
{
|
||||
err_t e_val;
|
||||
@@ -155,6 +156,7 @@ void bli_obj_create_const_copy_of_check( obj_t* a, obj_t* b )
|
||||
e_val = bli_check_object_buffer( a );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
#endif
|
||||
|
||||
void bli_datatype_size_check( num_t dt )
|
||||
{
|
||||
|
||||
@@ -52,7 +52,6 @@ f77_int PASTEF772(i,chx,blasname) \
|
||||
inc_t incx0; \
|
||||
gint_t bli_index; \
|
||||
f77_int f77_index; \
|
||||
err_t init_result; \
|
||||
\
|
||||
/* If the vector is empty, return an index of zero. This early check
|
||||
is needed to emulate netlib BLAS. Without it, bli_?amaxv() will
|
||||
@@ -60,8 +59,8 @@ f77_int PASTEF772(i,chx,blasname) \
|
||||
being returned, which is not what we want. */ \
|
||||
if ( *n < 1 || *incx <= 0 ) return 0; \
|
||||
\
|
||||
/* Initialize BLIS (if it is not already initialized). */ \
|
||||
bli_init_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -84,8 +83,8 @@ f77_int PASTEF772(i,chx,blasname) \
|
||||
integer size, that typecast occurs here. */ \
|
||||
f77_index = bli_index + 1; \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return f77_index; \
|
||||
}
|
||||
|
||||
@@ -51,10 +51,9 @@ ftype_r PASTEF772(chr,chx,blasname) \
|
||||
ftype_x* x0; \
|
||||
inc_t incx0; \
|
||||
ftype_r asum; \
|
||||
err_t init_result; \
|
||||
\
|
||||
/* Initialize BLIS (if it is not already initialized). */ \
|
||||
bli_init_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -72,8 +71,8 @@ ftype_r PASTEF772(chr,chx,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return asum; \
|
||||
}
|
||||
|
||||
@@ -54,10 +54,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -78,8 +77,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -53,10 +53,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -76,8 +75,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -54,10 +54,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -79,8 +78,8 @@ ftype PASTEF772(chxy,blasname,chc) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return rho; \
|
||||
}
|
||||
|
||||
@@ -61,10 +61,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -114,8 +113,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -61,10 +61,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -102,8 +101,8 @@ void PASTEF77(ch,blasname) \
|
||||
this quirky behavior; it will scale y by beta, as one would expect. */ \
|
||||
if ( m_y > 0 && n_x == 0 ) \
|
||||
{ \
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return; \
|
||||
} \
|
||||
@@ -132,8 +131,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -57,10 +57,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -101,8 +100,8 @@ void PASTEF772(chxy,blasname,chc) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -60,10 +60,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -112,8 +111,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -59,10 +59,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -106,8 +105,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -55,10 +55,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -97,8 +96,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,10 +58,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -104,8 +103,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -60,10 +60,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -98,8 +97,8 @@ void PASTEF77(ch,blasname) \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return; \
|
||||
} \
|
||||
@@ -128,8 +127,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,10 +58,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -95,8 +94,8 @@ void PASTEF77(ch,blasname) \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return; \
|
||||
} \
|
||||
@@ -121,8 +120,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -51,10 +51,9 @@ ftype_r PASTEF772(chr,chx,blasname) \
|
||||
ftype_x* x0; \
|
||||
inc_t incx0; \
|
||||
ftype_r norm; \
|
||||
err_t init_result; \
|
||||
\
|
||||
/* Initialize BLIS (if it is not already initialized). */ \
|
||||
bli_init_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -72,8 +71,8 @@ ftype_r PASTEF772(chr,chx,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
\
|
||||
return norm; \
|
||||
}
|
||||
|
||||
@@ -52,10 +52,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -80,8 +79,8 @@ void PASTEF772(chx,cha,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -53,10 +53,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Convert/typecast negative values of n to zero. */ \
|
||||
bli_convert_blas_dim1( *n, n0 ); \
|
||||
@@ -75,8 +74,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -60,10 +60,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -112,8 +111,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -59,10 +59,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -106,8 +105,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -55,10 +55,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -97,8 +96,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,10 +58,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -105,8 +104,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -60,10 +60,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -120,8 +119,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,10 +58,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -113,8 +112,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -61,10 +61,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -112,8 +111,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,11 +58,10 @@ void PASTEF77(ch,blasname) \
|
||||
ftype* x0; \
|
||||
inc_t incx0; \
|
||||
inc_t rs_a, cs_a; \
|
||||
err_t init_result; \
|
||||
ftype* one_p; \
|
||||
\
|
||||
/* Initialize BLIS (if it is not already initialized). */ \
|
||||
bli_init_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -109,8 +108,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -61,10 +61,9 @@ 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_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -112,8 +111,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -58,11 +58,10 @@ void PASTEF77(ch,blasname) \
|
||||
ftype* x0; \
|
||||
inc_t incx0; \
|
||||
inc_t rs_a, cs_a; \
|
||||
err_t init_result; \
|
||||
ftype* one_p; \
|
||||
\
|
||||
/* Initialize BLIS (if it is not already initialized). */ \
|
||||
bli_init_auto( &init_result ); \
|
||||
/* Initialize BLIS. */ \
|
||||
bli_init_auto(); \
|
||||
\
|
||||
/* Perform BLAS parameter checking. */ \
|
||||
PASTEBLACHK(blasname) \
|
||||
@@ -109,8 +108,8 @@ void PASTEF77(ch,blasname) \
|
||||
NULL \
|
||||
); \
|
||||
\
|
||||
/* Finalize BLIS (if it was initialized above). */ \
|
||||
bli_finalize_auto( init_result ); \
|
||||
/* Finalize BLIS. */ \
|
||||
bli_finalize_auto(); \
|
||||
}
|
||||
|
||||
#ifdef BLIS_ENABLE_BLAS2BLIS
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
static bool_t bli_ind_is_init = FALSE;
|
||||
|
||||
static char* bli_ind_impl_str[BLIS_NUM_IND_METHODS] =
|
||||
{
|
||||
/* 3mh */ "3mh",
|
||||
@@ -51,9 +49,6 @@ static char* bli_ind_impl_str[BLIS_NUM_IND_METHODS] =
|
||||
|
||||
void bli_ind_init( void )
|
||||
{
|
||||
// If the API is already initialized, return early.
|
||||
if ( bli_ind_is_initialized() ) return;
|
||||
|
||||
// Enable the default induced method (1m) if one or both complex domain
|
||||
// gemm micro-kernels are unoptimized in the native context.
|
||||
cntx_t* cntx = bli_gks_query_cntx();
|
||||
@@ -64,20 +59,10 @@ void bli_ind_init( void )
|
||||
|
||||
if ( c_is_ref ) bli_ind_enable_dt( BLIS_1M, BLIS_SCOMPLEX );
|
||||
if ( z_is_ref ) bli_ind_enable_dt( BLIS_1M, BLIS_DCOMPLEX );
|
||||
|
||||
// Mark API as initialized.
|
||||
bli_ind_is_init = TRUE;
|
||||
}
|
||||
|
||||
void bli_ind_finalize( void )
|
||||
{
|
||||
// Mark API as uninitialized.
|
||||
bli_ind_is_init = FALSE;
|
||||
}
|
||||
|
||||
bool_t bli_ind_is_initialized( void )
|
||||
{
|
||||
return bli_ind_is_init;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -169,6 +154,7 @@ bool_t bli_ind_oper_is_impl( opid_t oper, ind_t method )
|
||||
return is_impl;
|
||||
}
|
||||
|
||||
#if 0
|
||||
bool_t bli_ind_oper_has_avail( opid_t oper, num_t dt )
|
||||
{
|
||||
ind_t method = bli_ind_oper_find_avail( oper, dt );
|
||||
@@ -176,14 +162,16 @@ bool_t bli_ind_oper_has_avail( opid_t oper, num_t dt )
|
||||
if ( method == BLIS_NAT ) return FALSE;
|
||||
else return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void* bli_ind_oper_get_avail( opid_t oper, num_t dt )
|
||||
{
|
||||
ind_t method = bli_ind_oper_find_avail( oper, dt );
|
||||
void* func_p;
|
||||
|
||||
if ( bli_opid_is_level3( oper ) )
|
||||
{
|
||||
ind_t method = bli_ind_oper_find_avail( oper, dt );
|
||||
|
||||
func_p = bli_l3_ind_oper_get_func( oper, method );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
void bli_ind_init( void );
|
||||
void bli_ind_finalize( void );
|
||||
bool_t bli_ind_is_initialized( void );
|
||||
|
||||
void bli_ind_enable( ind_t method );
|
||||
void bli_ind_disable( ind_t method );
|
||||
@@ -66,7 +65,7 @@ void bli_ind_disable_all_dt( num_t dt );
|
||||
void bli_ind_oper_enable_only( opid_t oper, ind_t method, num_t dt );
|
||||
|
||||
bool_t bli_ind_oper_is_impl( opid_t oper, ind_t method );
|
||||
bool_t bli_ind_oper_has_avail( opid_t oper, num_t dt );
|
||||
//bool_t bli_ind_oper_has_avail( opid_t oper, num_t dt );
|
||||
void* bli_ind_oper_get_avail( opid_t oper, num_t dt );
|
||||
ind_t bli_ind_oper_find_avail( opid_t oper, num_t dt );
|
||||
char* bli_ind_oper_get_avail_impl_string( opid_t oper, num_t dt );
|
||||
|
||||
@@ -53,9 +53,6 @@ static void* bli_l3_ind_oper_fp[BLIS_NUM_IND_METHODS][BLIS_NUM_LEVEL3_OPS] =
|
||||
bli_syrknat, bli_syr2knat, bli_trmm3nat, bli_trmmnat, bli_trsmnat },
|
||||
};
|
||||
|
||||
//
|
||||
// NOTE: "2" is used instead of BLIS_NUM_FP_TYPES/2.
|
||||
//
|
||||
static bool_t bli_l3_ind_oper_st[BLIS_NUM_IND_METHODS][BLIS_NUM_LEVEL3_OPS][2] =
|
||||
{
|
||||
/* gemm hemm herk her2k symm syrk, syr2k trmm3 trmm trsm */
|
||||
@@ -81,14 +78,16 @@ static bool_t bli_l3_ind_oper_st[BLIS_NUM_IND_METHODS][BLIS_NUM_LEVEL3_OPS][2] =
|
||||
#undef GENFUNC
|
||||
#define GENFUNC( opname, optype ) \
|
||||
\
|
||||
bool_t PASTEMAC(opname,ind_has_avail)( num_t dt ) \
|
||||
{ \
|
||||
return bli_ind_oper_has_avail( optype, dt ); \
|
||||
} \
|
||||
void* PASTEMAC(opname,ind_get_avail)( num_t dt ) \
|
||||
{ \
|
||||
return bli_ind_oper_get_avail( optype, dt ); \
|
||||
}
|
||||
/*
|
||||
bool_t PASTEMAC(opname,ind_has_avail)( num_t dt )
|
||||
{
|
||||
return bli_ind_oper_has_avail( optype, dt );
|
||||
}
|
||||
*/
|
||||
|
||||
GENFUNC( gemm, BLIS_GEMM )
|
||||
GENFUNC( hemm, BLIS_HEMM )
|
||||
@@ -123,6 +122,8 @@ bool_t bli_l3_ind_oper_is_avail( opid_t oper, ind_t method, num_t dt )
|
||||
|
||||
ind_t bli_l3_ind_oper_find_avail( opid_t oper, num_t dt )
|
||||
{
|
||||
bli_init_once();
|
||||
|
||||
ind_t im;
|
||||
|
||||
// If the datatype is real, return native execution.
|
||||
@@ -231,22 +232,9 @@ bool_t bli_l3_ind_oper_get_enable( opid_t oper, ind_t method, num_t dt )
|
||||
num_t idt = bli_ind_map_cdt_to_index( dt );
|
||||
bool_t r_val;
|
||||
|
||||
#ifdef BLIS_ENABLE_OPENMP
|
||||
_Pragma( "omp critical (l3_ind)" )
|
||||
#endif
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_lock( &l3_ind_mutex );
|
||||
#endif
|
||||
|
||||
// BEGIN CRITICAL SECTION
|
||||
{
|
||||
r_val = bli_l3_ind_oper_st[ method ][ oper ][ idt ];
|
||||
}
|
||||
// END CRITICAL SECTION
|
||||
|
||||
#ifdef BLIS_ENABLE_PTHREADS
|
||||
pthread_mutex_unlock( &l3_ind_mutex );
|
||||
#endif
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
bool_t PASTEMAC(opname,ind_has_avail)( num_t dt ); \
|
||||
void* PASTEMAC(opname,ind_get_avail)( num_t dt );
|
||||
/*bool_t PASTEMAC(opname,ind_has_avail)( num_t dt ); */
|
||||
|
||||
GENPROT( gemm )
|
||||
GENPROT( hemm )
|
||||
|
||||
@@ -49,6 +49,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ind_t ind = PASTEMAC0(imeth); \
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
obj_t* beta_use = beta; \
|
||||
@@ -142,6 +144,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ind_t ind = PASTEMAC0(imeth); \
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
obj_t* beta_use = beta; \
|
||||
@@ -218,6 +222,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ind_t ind = PASTEMAC0(imeth); \
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
obj_t* beta_use = beta; \
|
||||
@@ -286,6 +292,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ind_t ind = PASTEMAC0(imeth); \
|
||||
num_t dt = bli_obj_datatype( *b ); \
|
||||
\
|
||||
@@ -341,6 +349,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ind_t ind = PASTEMAC0(imeth); \
|
||||
num_t dt = bli_obj_datatype( *b ); \
|
||||
\
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
PASTECH(opname,_oft) func = PASTEMAC(opname,ind_get_avail)( dt ); \
|
||||
\
|
||||
@@ -77,6 +79,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
PASTECH(opname,_oft) func = PASTEMAC(opname,ind_get_avail)( dt ); \
|
||||
\
|
||||
@@ -102,6 +106,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *c ); \
|
||||
PASTECH(opname,_oft) func = PASTEMAC(opname,ind_get_avail)( dt ); \
|
||||
\
|
||||
@@ -126,6 +132,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *b ); \
|
||||
PASTECH(opname,_oft) func = PASTEMAC(opname,ind_get_avail)( dt ); \
|
||||
\
|
||||
|
||||
@@ -55,6 +55,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid (native) context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
@@ -87,6 +89,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid (native) context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
@@ -117,6 +121,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid (native) context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
@@ -146,6 +152,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid (native) context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
@@ -174,6 +182,8 @@ void PASTEMAC(opname,imeth) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Obtain a valid (native) context from the gks if necessary. */ \
|
||||
if ( cntx == NULL ) cntx = bli_gks_query_cntx(); \
|
||||
\
|
||||
|
||||
@@ -55,6 +55,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -112,6 +114,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -169,6 +173,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt_r = PASTEMAC(chr,type); \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
@@ -223,6 +229,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt_r = PASTEMAC(chr,type); \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
@@ -283,6 +291,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -340,6 +350,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, betao, co; \
|
||||
@@ -393,6 +405,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -453,6 +467,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo, betao, co; \
|
||||
@@ -512,6 +528,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo; \
|
||||
@@ -562,6 +580,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
obj_t alphao, ao, bo; \
|
||||
|
||||
@@ -34,36 +34,21 @@
|
||||
|
||||
#include "blis.h"
|
||||
|
||||
static bool_t bli_thread_is_init = FALSE;
|
||||
|
||||
thrinfo_t BLIS_PACKM_SINGLE_THREADED = {};
|
||||
thrinfo_t BLIS_GEMM_SINGLE_THREADED = {};
|
||||
thrcomm_t BLIS_SINGLE_COMM = {};
|
||||
thrinfo_t BLIS_PACKM_SINGLE_THREADED = {};
|
||||
thrinfo_t BLIS_GEMM_SINGLE_THREADED = {};
|
||||
thrcomm_t BLIS_SINGLE_COMM = {};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_thread_init( void )
|
||||
{
|
||||
// If the API is already initialized, return early.
|
||||
if ( bli_thread_is_initialized() ) return;
|
||||
|
||||
bli_thrcomm_init( &BLIS_SINGLE_COMM, 1 );
|
||||
bli_packm_thrinfo_init_single( &BLIS_PACKM_SINGLE_THREADED );
|
||||
bli_l3_thrinfo_init_single( &BLIS_GEMM_SINGLE_THREADED );
|
||||
|
||||
// Mark API as initialized.
|
||||
bli_thread_is_init = TRUE;
|
||||
}
|
||||
|
||||
void bli_thread_finalize( void )
|
||||
{
|
||||
// Mark API as uninitialized.
|
||||
bli_thread_is_init = FALSE;
|
||||
}
|
||||
|
||||
bool_t bli_thread_is_initialized( void )
|
||||
{
|
||||
return bli_thread_is_init;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -48,9 +48,8 @@
|
||||
#include "bli_l3_thrinfo.h"
|
||||
|
||||
// Initialization-related prototypes.
|
||||
void bli_thread_init( void );
|
||||
void bli_thread_finalize( void );
|
||||
bool_t bli_thread_is_initialized( void );
|
||||
void bli_thread_init( void );
|
||||
void bli_thread_finalize( void );
|
||||
|
||||
// Thread range-related prototypes.
|
||||
void bli_thread_get_range_sub
|
||||
|
||||
@@ -50,6 +50,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -87,6 +89,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *a ); \
|
||||
@@ -127,6 +131,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -166,6 +172,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -217,6 +225,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -267,6 +277,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -334,6 +346,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
/* Suppress compiler warning about unused variables. */ \
|
||||
@@ -363,6 +377,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -398,6 +414,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
@@ -442,6 +460,8 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
BLIS_OAPI_CNTX_PARAM \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_CNTX_DECL \
|
||||
\
|
||||
num_t dt = bli_obj_datatype( *x ); \
|
||||
|
||||
@@ -49,6 +49,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If the vector length is zero, set the absolute sum return value to
|
||||
@@ -90,6 +92,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If either dimension is zero, return early. */ \
|
||||
@@ -128,6 +132,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If the vector length is zero, set the norm to zero and return
|
||||
@@ -175,6 +181,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If either dimension is zero, set the norm to zero and return
|
||||
@@ -223,6 +231,8 @@ void PASTEMAC(ch,opname) \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
@@ -250,6 +260,8 @@ void PASTEMAC(ch,opname) \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
@@ -275,6 +287,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If the vector length is zero, return early. */ \
|
||||
@@ -313,6 +327,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If either dimension is zero, return early. */ \
|
||||
@@ -353,6 +369,8 @@ void PASTEMAC(ch,opname) \
|
||||
cntx_t* cntx \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
cntx_t* cntx_p = cntx; \
|
||||
\
|
||||
/* If x is zero length, return with scale and sumsq unchanged. */ \
|
||||
|
||||
@@ -62,8 +62,7 @@ int main( int argc, char** argv )
|
||||
double dtime_save;
|
||||
double gflops;
|
||||
|
||||
|
||||
bli_init();
|
||||
//bli_init();
|
||||
|
||||
//bli_error_checking_level_set( BLIS_NO_ERROR_CHECKING );
|
||||
|
||||
@@ -334,7 +333,7 @@ int main( int argc, char** argv )
|
||||
bli_obj_free( &c_save );
|
||||
}
|
||||
|
||||
bli_finalize();
|
||||
//bli_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ int main( int argc, char** argv )
|
||||
int ii;
|
||||
|
||||
#ifdef NBLIS
|
||||
bli_init();
|
||||
//bli_init();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ int main( int argc, char** argv )
|
||||
}
|
||||
|
||||
#ifdef NBLIS
|
||||
bli_finalize();
|
||||
//bli_finalize();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ int main( int argc, char** argv )
|
||||
double dtime_save;
|
||||
double gflops;
|
||||
|
||||
bli_init();
|
||||
//bli_init();
|
||||
|
||||
//bli_error_checking_level_set( BLIS_NO_ERROR_CHECKING );
|
||||
|
||||
@@ -288,7 +288,7 @@ int main( int argc, char** argv )
|
||||
bli_obj_free( &c_save );
|
||||
}
|
||||
|
||||
bli_finalize();
|
||||
//bli_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ int main( int argc, char** argv )
|
||||
double dtime_save;
|
||||
double gflops;
|
||||
|
||||
bli_init();
|
||||
//bli_init();
|
||||
|
||||
n_repeats = 3;
|
||||
|
||||
@@ -183,7 +183,7 @@ int main( int argc, char** argv )
|
||||
bli_obj_free( &y_save );
|
||||
}
|
||||
|
||||
bli_finalize();
|
||||
//bli_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ int main( int argc, char** argv )
|
||||
double dtime_save;
|
||||
double gflops;
|
||||
|
||||
bli_init();
|
||||
//bli_init();
|
||||
|
||||
n_repeats = 3;
|
||||
|
||||
@@ -175,7 +175,7 @@ int main( int argc, char** argv )
|
||||
bli_obj_free( &a_save );
|
||||
}
|
||||
|
||||
bli_finalize();
|
||||
//bli_finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user