This commit is contained in:
Tyler Smith
2014-03-20 16:54:35 -05:00
153 changed files with 2816 additions and 1074 deletions

View File

@@ -72,7 +72,7 @@ void bli_absqsc_unb_var1( obj_t* chi,
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
void* chi, \
@@ -95,5 +95,5 @@ void PASTEMAC(chx,varname)( \
PASTEMAC2(chxr,chxr,copys)( chi_r, *absq_cast ); \
}
INSERT_GENTFUNCR_BASIC( absqsc, absqsc_unb_var1 )
INSERT_GENTFUNCR_BASIC0( absqsc_unb_var1 )

View File

@@ -38,12 +38,12 @@ void bli_absqsc_unb_var1( obj_t* chi,
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,opname)( \
void* chi, \
void* absq \
);
void PASTEMAC(chx,varname)( \
void* chi, \
void* absq \
);
INSERT_GENTPROTR_BASIC( absqsc_unb_var1 )

View File

@@ -85,7 +85,7 @@ void bli_addsc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
@@ -105,13 +105,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( addsc, addsc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( addsc_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( addsc, addsc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( addsc_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( addsc, addsc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( addsc_unb_var1 )
#endif

View File

@@ -38,13 +38,13 @@ void bli_addsc_unb_var1( obj_t* chi,
#undef GENTPROT2
#define GENTPROT2( ctype_x, ctype_y, chx, chy, opname ) \
#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,opname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
INSERT_GENTPROT2_BASIC( addsc_unb_var1 )

View File

@@ -91,7 +91,7 @@ void bli_copysc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
@@ -114,13 +114,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Enable all datatype combinations even when only basic datatype support
// is requested.
INSERT_GENTFUNC2_BASIC( copysc, copysc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( copysc_unb_var1 )
//#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( copysc, copysc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( copysc_unb_var1 )
//#endif
//#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( copysc, copysc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( copysc_unb_var1 )
//#endif

View File

@@ -85,7 +85,7 @@ void bli_divsc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
@@ -105,13 +105,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( divsc, divsc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( divsc_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( divsc, divsc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( divsc_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( divsc, divsc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( divsc_unb_var1 )
#endif

View File

@@ -38,13 +38,13 @@ void bli_divsc_unb_var1( obj_t* chi,
#undef GENTPROT2
#define GENTPROT2( ctype_x, ctype_y, chx, chy, opname ) \
#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,opname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
INSERT_GENTPROT2_BASIC( divsc_unb_var1 )

View File

@@ -85,7 +85,7 @@ void bli_mulsc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
@@ -111,13 +111,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( mulsc, mulsc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( mulsc_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( mulsc, mulsc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( mulsc_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( mulsc, mulsc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( mulsc_unb_var1 )
#endif

View File

@@ -38,13 +38,13 @@ void bli_mulsc_unb_var1( obj_t* chi,
#undef GENTPROT2
#define GENTPROT2( ctype_x, ctype_y, chx, chy, opname ) \
#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,opname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
INSERT_GENTPROT2_BASIC( mulsc_unb_var1 )

View File

@@ -38,13 +38,13 @@
//
// Define object-based interface.
//
void bli_fnormsc( obj_t* chi,
void bli_normfsc( obj_t* chi,
obj_t* norm )
{
if ( bli_error_checking_is_enabled() )
bli_fnormsc_check( chi, norm );
bli_normfsc_check( chi, norm );
bli_fnormsc_unb_var1( chi, norm );
bli_normfsc_unb_var1( chi, norm );
}
@@ -63,5 +63,5 @@ void PASTEMAC2(chx,chxr,opname)( \
norm ); \
}
INSERT_GENTFUNCR_BASIC( fnormsc, fnormsc_unb_var1 )
INSERT_GENTFUNCR_BASIC( normfsc, normfsc_unb_var1 )

View File

@@ -32,14 +32,14 @@
*/
#include "bli_fnormsc_check.h"
#include "bli_fnormsc_unb_var1.h"
#include "bli_normfsc_check.h"
#include "bli_normfsc_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_fnormsc( obj_t* chi,
void bli_normfsc( obj_t* chi,
obj_t* norm );
@@ -54,5 +54,5 @@ void PASTEMAC2(chx,chxr,opname)( \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( fnormsc )
INSERT_GENTPROTR_BASIC( normfsc )

View File

@@ -34,7 +34,7 @@
#include "blis.h"
void bli_fnormsc_check( obj_t* chi,
void bli_normfsc_check( obj_t* chi,
obj_t* norm )
{
err_t e_val;

View File

@@ -32,5 +32,5 @@
*/
void bli_fnormsc_check( obj_t* chi,
void bli_normfsc_check( obj_t* chi,
obj_t* norm );

View File

@@ -34,17 +34,17 @@
#include "blis.h"
#define FUNCPTR_T fnormsc_fp
#define FUNCPTR_T normfsc_fp
typedef void (*FUNCPTR_T)(
void* chi,
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,fnormsc_unb_var1);
static FUNCPTR_T GENARRAY(ftypes,normfsc_unb_var1);
void bli_fnormsc_unb_var1( obj_t* chi,
void bli_normfsc_unb_var1( obj_t* chi,
obj_t* norm )
{
num_t dt_chi;
@@ -72,7 +72,7 @@ void bli_fnormsc_unb_var1( obj_t* chi,
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
void* chi, \
@@ -81,27 +81,9 @@ void PASTEMAC(chx,varname)( \
{ \
ctype_x* chi_cast = chi; \
ctype_xr* norm_cast = norm; \
ctype_xr chi_r; \
ctype_xr chi_i; \
\
PASTEMAC2(chx,chxr,gets)( *chi_cast, \
chi_r, \
chi_i ); \
\
if ( bli_is_real( PASTEMAC(chx,type) ) ) \
{ \
/* norm = abs( chi_r ); */ \
*norm_cast = bli_fabs( chi_r ); \
} \
else \
{ \
/* norm = sqrt( chi_r * chi_r + chi_i * chi_i ); */ \
PASTEMAC2(chxr,chxr,scals)( chi_r, chi_r ); \
PASTEMAC2(chxr,chxr,scals)( chi_i, chi_i ); \
PASTEMAC2(chxr,chxr,adds)( chi_i, chi_r ); \
PASTEMAC2(chxr,chxr,sqrt2s)( chi_r, *norm_cast ); \
} \
PASTEMAC2(chx,chxr,abval2s)( *chi_cast, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC( fnormsc, fnormsc_unb_var1 )
INSERT_GENTFUNCR_BASIC0( normfsc_unb_var1 )

View File

@@ -33,17 +33,17 @@
*/
void bli_fnormsc_unb_var1( obj_t* chi,
void bli_normfsc_unb_var1( obj_t* chi,
obj_t* norm );
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,opname)( \
void* chi, \
void* norm \
);
void PASTEMAC(chx,varname)( \
void* chi, \
void* norm \
);
INSERT_GENTPROTR_BASIC( fnormsc_unb_var1 )
INSERT_GENTPROTR_BASIC( normfsc_unb_var1 )

View File

@@ -81,7 +81,7 @@ void bli_sqrtsc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
void* chi, \
@@ -96,13 +96,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( sqrtsc, sqrtsc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( sqrtsc_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( sqrtsc, sqrtsc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( sqrtsc_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( sqrtsc, sqrtsc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( sqrtsc_unb_var1 )
#endif

View File

@@ -85,7 +85,7 @@ void bli_subsc_unb_var1( obj_t* chi,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
@@ -105,13 +105,13 @@ void PASTEMAC2(chx,chy,varname)( \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( subsc, subsc_unb_var1 )
INSERT_GENTFUNC2_BASIC0( subsc_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( subsc, subsc_unb_var1 )
INSERT_GENTFUNC2_MIX_D0( subsc_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( subsc, subsc_unb_var1 )
INSERT_GENTFUNC2_MIX_P0( subsc_unb_var1 )
#endif

View File

@@ -38,13 +38,13 @@ void bli_subsc_unb_var1( obj_t* chi,
#undef GENTPROT2
#define GENTPROT2( ctype_x, ctype_y, chx, chy, opname ) \
#define GENTPROT2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,opname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
void PASTEMAC2(chx,chy,varname)( \
conj_t conjchi, \
void* chi, \
void* psi \
);
INSERT_GENTPROT2_BASIC( subsc_unb_var1 )

View File

@@ -76,7 +76,7 @@ void bli_unzipsc_unb_var1( obj_t* beta,
#undef GENTFUNCR
#define GENTFUNCR( ctype_b, ctype_br, chb, chbr, opname, varname ) \
#define GENTFUNCR( ctype_b, ctype_br, chb, chbr, varname ) \
\
void PASTEMAC(chb,varname)( \
void* beta, \
@@ -93,5 +93,5 @@ void PASTEMAC(chb,varname)( \
*chi_i_cast ); \
}
INSERT_GENTFUNCR_BASIC( unzipsc, unzipsc_unb_var1 )
INSERT_GENTFUNCR_BASIC0( unzipsc_unb_var1 )

View File

@@ -39,13 +39,13 @@ void bli_unzipsc_unb_var1( obj_t* beta,
#undef GENTPROTR
#define GENTPROTR( ctype_b, ctype_br, chb, chbr, opname ) \
#define GENTPROTR( ctype_b, ctype_br, chb, chbr, varname ) \
\
void PASTEMAC(chb,opname)( \
void* beta, \
void* chi_r, \
void* chi_i \
);
void PASTEMAC(chb,varname)( \
void* beta, \
void* chi_r, \
void* chi_i \
);
INSERT_GENTPROTR_BASIC( unzipsc_unb_var1 )

View File

@@ -79,7 +79,7 @@ void bli_zipsc_unb_var1( obj_t* beta_r,
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
void* beta_r, \
@@ -98,5 +98,5 @@ void PASTEMAC(chx,varname)( \
*chi_cast ); \
}
INSERT_GENTFUNCR_BASIC( zipsc, zipsc_unb_var1 )
INSERT_GENTFUNCR_BASIC0( zipsc_unb_var1 )

View File

@@ -39,13 +39,13 @@ void bli_zipsc_unb_var1( obj_t* beta_r,
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,opname)( \
void* beta_r, \
void* beta_i, \
void* chi \
);
void PASTEMAC(chx,varname)( \
void* beta_r, \
void* beta_i, \
void* chi \
);
INSERT_GENTPROTR_BASIC( zipsc_unb_var1 )

View File

@@ -88,7 +88,7 @@ void bli_addv_ref( obj_t* x,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname) \
( \
@@ -133,13 +133,13 @@ void PASTEMAC2(chx,chy,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( addv, addv_ref )
INSERT_GENTFUNC2_BASIC0( addv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( addv, addv_ref )
INSERT_GENTFUNC2_MIX_D0( addv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( addv, addv_ref )
INSERT_GENTFUNC2_MIX_P0( addv_ref )
#endif

View File

@@ -88,7 +88,7 @@ void bli_copyv_ref( obj_t* x,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname) \
( \
@@ -133,13 +133,13 @@ void PASTEMAC2(chx,chy,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( copyv, copyv_ref )
INSERT_GENTFUNC2_BASIC0( copyv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( copyv, copyv_ref )
INSERT_GENTFUNC2_MIX_D0( copyv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( copyv, copyv_ref )
INSERT_GENTFUNC2_MIX_P0( copyv_ref )
#endif

View File

@@ -96,7 +96,7 @@ void bli_dotv_ref( obj_t* x,
*/
#undef GENTFUNC3
#define GENTFUNC3( ctype_x, ctype_y, ctype_r, chx, chy, chr, opname, varname ) \
#define GENTFUNC3( ctype_x, ctype_y, ctype_r, chx, chy, chr, varname ) \
\
void PASTEMAC3(chx,chy,chr,varname) \
( \
@@ -165,13 +165,13 @@ void PASTEMAC3(chx,chy,chr,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC3_BASIC( dotv, dotv_ref )
INSERT_GENTFUNC3_BASIC0( dotv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC3_MIX_D( dotv, dotv_ref )
INSERT_GENTFUNC3_MIX_D0( dotv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC3_MIX_P( dotv, dotv_ref )
INSERT_GENTFUNC3_MIX_P0( dotv_ref )
#endif

View File

@@ -118,7 +118,7 @@ void bli_dotxv_ref( obj_t* alpha,
#undef GENTFUNC3U12
#define GENTFUNC3U12( ctype_x, ctype_y, ctype_r, ctype_xy, chx, chy, chr, chxy, opname, varname ) \
#define GENTFUNC3U12( ctype_x, ctype_y, ctype_r, ctype_xy, chx, chy, chr, chxy, varname ) \
\
void PASTEMAC3(chx,chy,chr,varname) \
( \
@@ -197,13 +197,13 @@ void PASTEMAC3(chx,chy,chr,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC3U12_BASIC( dotxv, dotxv_ref )
INSERT_GENTFUNC3U12_BASIC0( dotxv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC3U12_MIX_D( dotxv, dotxv_ref )
INSERT_GENTFUNC3U12_MIX_D0( dotxv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC3U12_MIX_P( dotxv, dotxv_ref )
INSERT_GENTFUNC3U12_MIX_P0( dotxv_ref )
#endif

View File

@@ -68,7 +68,7 @@ void bli_invertv_ref( obj_t* x )
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname) \
( \
@@ -92,5 +92,5 @@ void PASTEMAC(ch,varname) \
} \
}
INSERT_GENTFUNC_BASIC( invertv, invertv_ref )
INSERT_GENTFUNC_BASIC0( invertv_ref )

View File

@@ -88,7 +88,7 @@ void bli_setv_ref( obj_t* beta,
*/
#undef GENTFUNC2
#define GENTFUNC2( ctype_b, ctype_x, chb, chx, opname, varname ) \
#define GENTFUNC2( ctype_b, ctype_x, chb, chx, varname ) \
\
void PASTEMAC2(chb,chx,varname) \
( \
@@ -125,12 +125,12 @@ void PASTEMAC2(chb,chx,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( setv, setv_ref )
INSERT_GENTFUNC2_BASIC0( setv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( setv, setv_ref )
INSERT_GENTFUNC2_MIX_D0( setv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( setv, setv_ref )
INSERT_GENTFUNC2_MIX_P0( setv_ref )
#endif

View File

@@ -88,7 +88,7 @@ void bli_subv_ref( obj_t* x,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname) \
( \
@@ -133,13 +133,13 @@ void PASTEMAC2(chx,chy,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( subv, subv_ref )
INSERT_GENTFUNC2_BASIC0( subv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( subv, subv_ref )
INSERT_GENTFUNC2_MIX_D0( subv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( subv, subv_ref )
INSERT_GENTFUNC2_MIX_P0( subv_ref )
#endif

View File

@@ -85,7 +85,7 @@ void bli_swapv_ref( obj_t* x,
#undef GENTFUNC2
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, opname, varname ) \
#define GENTFUNC2( ctype_x, ctype_y, chx, chy, varname ) \
\
void PASTEMAC2(chx,chy,varname) \
( \
@@ -116,13 +116,13 @@ void PASTEMAC2(chx,chy,varname) \
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC2_BASIC( swapv, swapv_ref )
INSERT_GENTFUNC2_BASIC0( swapv_ref )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC2_MIX_D( swapv, swapv_ref )
INSERT_GENTFUNC2_MIX_D0( swapv_ref )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC2_MIX_P( swapv, swapv_ref )
INSERT_GENTFUNC2_MIX_P0( swapv_ref )
#endif

View File

@@ -125,7 +125,7 @@ void bli_packm_blk_var1( obj_t* c,
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname )( \
struc_t strucc, \
@@ -409,5 +409,5 @@ void PASTEMAC(ch,varname )( \
\
}
INSERT_GENTFUNC_BASIC( packm, packm_blk_var1 )
INSERT_GENTFUNC_BASIC0( packm_blk_var1 )

View File

@@ -150,16 +150,16 @@ static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] =
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, scal2vker ) \
#define GENTFUNC( ctype, ch, varname, scal2vker ) \
\
void PASTEMAC(ch,opname)( \
conj_t conja, \
dim_t m, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t ldp \
) \
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t m, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t ldp \
) \
{ \
dim_t panel_dim; \
num_t dt; \

View File

@@ -150,16 +150,16 @@ static FUNCPTR_T ftypes[FUNCPTR_ARRAY_LENGTH][BLIS_NUM_FP_TYPES] =
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, opname, scal2vker ) \
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,opname)( \
conj_t conja, \
dim_t m, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t psp, inc_t ldp \
) \
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t m, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t psp, inc_t ldp \
) \
{ \
dim_t panel_dim; \
dim_t i, j; \
@@ -253,5 +253,5 @@ void PASTEMAC(ch,opname)( \
} \
}
INSERT_GENTFUNCCO_BASIC( packm_cxk_ri3, SCAL2V_KERNEL )
INSERT_GENTFUNCCO_BASIC0( packm_cxk_ri3 )

View File

@@ -227,14 +227,15 @@ void PASTEMAC(ch,varname)( \
\
/* If there is a zero region above where the diagonal of A intersects the
left edge of the block, adjust the pointer to C and treat this case as
if the diagonal offset were zero. This skips over the region (in
increments of MR) that was not packed. (Note we skip in increments of
MR since that is how the region would have been skipped by packm.) */ \
if the diagonal offset were zero. This skips over the region that was
not packed. (Note we assume the diagonal offset is a multiple of MR;
this assumption will hold as long as the cache blocksizes are each a
multiple of MR and NR.) */ \
if ( diagoffa < 0 ) \
{ \
i = ( -diagoffa / MR ) * MR; \
i = -diagoffa; \
m = m - i; \
diagoffa = -diagoffa % MR; \
diagoffa = 0; \
c_cast = c_cast + (i )*rs_c; \
} \
\

View File

@@ -228,14 +228,14 @@ void PASTEMAC(ch,varname)( \
/* If there is a zero region to the left of where the diagonal of B
intersects the top edge of the panel, adjust the pointer to C and
treat this case as if the diagonal offset were zero. This skips over
the region (in increments of NR) that was not packed. (Note we skip
in increments of NR since that is how the region would have been
skipped by packm.) */ \
the region that was not packed. (Note we assume the diagonal offset
is a multiple of MR; this assumption will hold as long as the cache
blocksizes are each a multiple of MR and NR.) */ \
if ( diagoffb > 0 ) \
{ \
j = ( diagoffb / NR ) * NR; \
j = diagoffb; \
n = n - j; \
diagoffb = diagoffb % NR; \
diagoffb = 0; \
c_cast = c_cast + (j )*cs_c; \
} \
\

View File

@@ -236,14 +236,15 @@ void PASTEMAC(ch,varname)( \
\
/* If there is a zero region above where the diagonal of A intersects the
left edge of the block, adjust the pointer to C and treat this case as
if the diagonal offset were zero. This skips over the region (in
increments of MR) that was not packed. (Note we skip in increments of
MR since that is how the region would have been skipped by packm.) */ \
if the diagonal offset were zero. This skips over the region that was
not packed. (Note we assume the diagonal offset is a multiple of MR;
this assumption will hold as long as the cache blocksizes are each a
multiple of MR and NR.) */ \
if ( diagoffa < 0 ) \
{ \
i = ( -diagoffa / MR ) * MR; \
i = -diagoffa; \
m = m - i; \
diagoffa = -diagoffa % MR; \
diagoffa = 0; \
c_cast = c_cast + (i )*rs_c; \
} \
\

View File

@@ -333,7 +333,8 @@ void PASTEMAC(ch,varname)( \
\
n_cur = ( bli_is_not_edge_b( jb, n_iter, n_left ) ? NR : n_left ); \
\
/* Compute various offsets into and lengths of parts of B. */ \
/* Determine the offset to and length of the panel that was packed
so we can index into the corresponding location in A. */ \
off_b11 = bli_max( -diagoffb_j, 0 ); \
k_b1121 = k - off_b11; \
k_b11 = NR; \

View File

@@ -245,14 +245,14 @@ void PASTEMAC(ch,varname)( \
/* If there is a zero region to the left of where the diagonal of B
intersects the top edge of the panel, adjust the pointer to C and
treat this case as if the diagonal offset were zero. This skips over
the region (in increments of NR) that was not packed. (Note we skip
in increments of NR since that is how the region would have been
skipped by packm.) */ \
the region that was not packed. (Note we assume the diagonal offset
is a multiple of MR; this assumption will hold as long as the cache
blocksizes are each a multiple of MR and NR.) */ \
if ( diagoffb > 0 ) \
{ \
j = ( diagoffb / NR ) * NR; \
j = diagoffb; \
n = n - j; \
diagoffb = diagoffb % NR; \
diagoffb = 0; \
c_cast = c_cast + (j )*cs_c; \
} \
\

View File

@@ -64,9 +64,9 @@ f77_int PASTEF772(i,chx,blasname)( \
bli_convert_blas_incv( n0, x, *incx, x0, incx0 ); \
\
/* Call BLIS interface. */ \
PASTEMAC(chx,abmaxv)( n0, \
x0, incx0, \
&bli_index ); \
PASTEMAC(chx,blisname)( n0, \
x0, incx0, \
&bli_index ); \
\
/* Convert zero-based BLIS (C) index to one-based BLAS (Fortran)
index. */ \
@@ -79,6 +79,6 @@ f77_int PASTEF772(i,chx,blasname)( \
}
#ifdef BLIS_ENABLE_BLAS2BLIS
INSERT_GENTFUNC_BLAS( amax, abmaxv )
INSERT_GENTFUNC_BLAS( amax, amaxv )
#endif

View File

@@ -49,7 +49,7 @@ ftype_r PASTEF772(chr,chx,blasname)( \
dim_t n0; \
ftype_x* x0; \
inc_t incx0; \
ftype_r absum; \
ftype_r asum; \
err_t init_result; \
\
/* Initialize BLIS (if it is not already initialized). */ \
@@ -63,17 +63,17 @@ ftype_r PASTEF772(chr,chx,blasname)( \
bli_convert_blas_incv( n0, x, *incx, x0, incx0 ); \
\
/* Call BLIS interface. */ \
PASTEMAC(chx,absumv)( n0, \
x0, incx0, \
&absum ); \
PASTEMAC(chx,blisname)( n0, \
x0, incx0, \
&asum ); \
\
/* Finalize BLIS (if it was initialized above). */ \
bli_finalize_safe( init_result ); \
\
return absum; \
return asum; \
}
#ifdef BLIS_ENABLE_BLAS2BLIS
INSERT_GENTFUNCR2_BLAS( asum, absumv )
INSERT_GENTFUNCR2_BLAS( asum, asumv )
#endif

View File

@@ -63,9 +63,9 @@ ftype_r PASTEF772(chr,chx,blasname)( \
bli_convert_blas_incv( n0, x, *incx, x0, incx0 ); \
\
/* Call BLIS interface. */ \
PASTEMAC(chx,fnormv)( n0, \
x0, incx0, \
&norm ); \
PASTEMAC(chx,blisname)( n0, \
x0, incx0, \
&norm ); \
\
/* Finalize BLIS (if it was initialized above). */ \
bli_finalize_safe( init_result ); \
@@ -74,6 +74,6 @@ ftype_r PASTEF772(chr,chx,blasname)( \
}
#ifdef BLIS_ENABLE_BLAS2BLIS
INSERT_GENTFUNCR2_BLAS( nrm2, fnormv )
INSERT_GENTFUNCR2_BLAS( nrm2, normfv )
#endif

View File

@@ -127,8 +127,9 @@ GENTFUNCSCAL( double, dcomplex, d, z, blasname, blisname )
// -- Macros for functions with one operand ------------------------------------
// -- Basic one-operand macro (with no auxiliary arguments) --
// -- Basic one-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC_BASIC0( tfuncname ) \
\
@@ -137,9 +138,7 @@ GENTFUNC( double, d, tfuncname ) \
GENTFUNC( scomplex, c, tfuncname ) \
GENTFUNC( dcomplex, z, tfuncname )
// -- Basic one-operand macro (with one auxiliary argument) --
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC_BASIC( tfuncname, varname ) \
\
@@ -148,9 +147,7 @@ GENTFUNC( double, d, tfuncname, varname ) \
GENTFUNC( scomplex, c, tfuncname, varname ) \
GENTFUNC( dcomplex, z, tfuncname, varname )
// -- Basic one-operand macro (with two auxiliary arguments) --
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC_BASIC2( tfuncname, varname1, varname2 ) \
\
@@ -160,8 +157,57 @@ GENTFUNC( scomplex, c, tfuncname, varname1, varname2 ) \
GENTFUNC( dcomplex, z, tfuncname, varname1, varname2 )
// -- Basic one-operand with real projection --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNCR_BASIC0( tfuncname ) \
\
GENTFUNCR( float, float, s, s, tfuncname ) \
GENTFUNCR( double, double, d, d, tfuncname ) \
GENTFUNCR( scomplex, float, c, s, tfuncname ) \
GENTFUNCR( dcomplex, double, z, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNCR_BASIC( tfuncname, varname ) \
\
GENTFUNCR( float, float, s, s, tfuncname, varname ) \
GENTFUNCR( double, double, d, d, tfuncname, varname ) \
GENTFUNCR( scomplex, float, c, s, tfuncname, varname ) \
GENTFUNCR( dcomplex, double, z, d, tfuncname, varname )
// -- Basic one-operand macro with complex domain only and real projection --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNCCO_BASIC0( tfuncname ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNCCO_BASIC( tfuncname, varname ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname, varname ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname )
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNCCO_BASIC2( tfuncname, varname1, varname2 ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname, varname1, varname2 ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname1, varname2 )
// -- Basic one-operand macro with integer instance --
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC_BASIC_I( tfuncname, varname ) \
\
@@ -172,8 +218,10 @@ GENTFUNC( dcomplex, z, tfuncname, varname ) \
GENTFUNC( gint_t, i, tfuncname, varname )
// -- Basic one-operand with integer projection --
// -- (one auxiliary argument) --
#define INSERT_GENTFUNCI_BASIC( tfuncname, varname ) \
\
@@ -183,53 +231,17 @@ GENTFUNCI( scomplex, gint_t, c, i, tfuncname, varname ) \
GENTFUNCI( dcomplex, gint_t, z, i, tfuncname, varname )
// -- Basic one-operand with real projection --
#define INSERT_GENTFUNCR_BASIC( tfuncname, varname ) \
\
GENTFUNCR( float, float, s, s, tfuncname, varname ) \
GENTFUNCR( double, double, d, d, tfuncname, varname ) \
GENTFUNCR( scomplex, float, c, s, tfuncname, varname ) \
GENTFUNCR( dcomplex, double, z, d, tfuncname, varname )
// -- Basic one-operand macro with complex domain only and real projection (with no auxiliary arguments) --
#define INSERT_GENTFUNCCO_BASIC0( tfuncname ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname )
// -- Basic one-operand macro with complex domain only and real projection --
#define INSERT_GENTFUNCCO_BASIC( tfuncname, varname ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname, varname ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname )
// -- Basic one-operand macro with complex domain only and real projection (with two auxiliary arguments) --
#define INSERT_GENTFUNCCO_BASIC2( tfuncname, varname1, varname2 ) \
\
GENTFUNCCO( scomplex, float, c, s, tfuncname, varname1, varname2 ) \
GENTFUNCCO( dcomplex, double, z, d, tfuncname, varname1, varname2 )
// -- Basic one-operand with real and integer projections --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNCRI_BASIC( tfuncname, varname ) \
#define INSERT_GENTFUNCRI_BASIC0( tfuncname ) \
\
GENTFUNCRI( float, float, gint_t, s, s, i, tfuncname, varname ) \
GENTFUNCRI( double, double, gint_t, d, d, i, tfuncname, varname ) \
GENTFUNCRI( scomplex, float, gint_t, c, s, i, tfuncname, varname ) \
GENTFUNCRI( dcomplex, double, gint_t, z, d, i, tfuncname, varname )
GENTFUNCRI( float, float, gint_t, s, s, i, tfuncname ) \
GENTFUNCRI( double, double, gint_t, d, d, i, tfuncname ) \
GENTFUNCRI( scomplex, float, gint_t, c, s, i, tfuncname ) \
GENTFUNCRI( dcomplex, double, gint_t, z, d, i, tfuncname )
@@ -239,6 +251,16 @@ GENTFUNCRI( dcomplex, double, gint_t, z, d, i, tfuncname, varname )
// -- Basic two-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2_BASIC0( tfuncname ) \
\
GENTFUNC2( float, float, s, s, tfuncname ) \
GENTFUNC2( double, double, d, d, tfuncname ) \
GENTFUNC2( scomplex, scomplex, c, c, tfuncname ) \
GENTFUNC2( dcomplex, dcomplex, z, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2_BASIC( tfuncname, varname ) \
\
@@ -248,8 +270,20 @@ GENTFUNC2( scomplex, scomplex, c, c, tfuncname, varname ) \
GENTFUNC2( dcomplex, dcomplex, z, z, tfuncname, varname )
// -- Mixed domain two-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2_MIX_D0( tfuncname ) \
\
GENTFUNC2( float, scomplex, s, c, tfuncname ) \
GENTFUNC2( scomplex, float, c, s, tfuncname ) \
\
GENTFUNC2( double, dcomplex, d, z, tfuncname ) \
GENTFUNC2( dcomplex, double, z, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2_MIX_D( tfuncname, varname ) \
\
@@ -260,8 +294,26 @@ GENTFUNC2( double, dcomplex, d, z, tfuncname, varname ) \
GENTFUNC2( dcomplex, double, z, d, tfuncname, varname )
// -- Mixed precision two-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2_MIX_P0( tfuncname ) \
\
GENTFUNC2( float, double, s, d, tfuncname ) \
GENTFUNC2( float, dcomplex, s, z, tfuncname ) \
\
GENTFUNC2( double, float, d, s, tfuncname ) \
GENTFUNC2( double, scomplex, d, c, tfuncname ) \
\
GENTFUNC2( scomplex, double, c, d, tfuncname ) \
GENTFUNC2( scomplex, dcomplex, c, z, tfuncname ) \
\
GENTFUNC2( dcomplex, float, z, s, tfuncname ) \
GENTFUNC2( dcomplex, scomplex, z, c, tfuncname ) \
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2_MIX_P( tfuncname, varname ) \
\
@@ -281,6 +333,16 @@ GENTFUNC2( dcomplex, scomplex, z, c, tfuncname, varname ) \
// -- Basic two-operand with union of operands --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2U_BASIC0( tfuncname ) \
\
GENTFUNC2U( float, float, float, s, s, s, tfuncname ) \
GENTFUNC2U( double, double, double, d, d, d, tfuncname ) \
GENTFUNC2U( scomplex, scomplex, scomplex, c, c, c, tfuncname ) \
GENTFUNC2U( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2U_BASIC( tfuncname, varname ) \
\
@@ -290,8 +352,20 @@ GENTFUNC2U( scomplex, scomplex, scomplex, c, c, c, tfuncname, varname ) \
GENTFUNC2U( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname, varname )
// -- Mixed domain two-operand with union of operands --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2U_MIX_D0( tfuncname ) \
\
GENTFUNC2U( float, scomplex, scomplex, s, c, c, tfuncname ) \
GENTFUNC2U( scomplex, float, scomplex, c, s, c, tfuncname ) \
\
GENTFUNC2U( double, dcomplex, dcomplex, d, z, z, tfuncname ) \
GENTFUNC2U( dcomplex, double, dcomplex, z, d, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2U_MIX_D( tfuncname, varname ) \
\
@@ -302,8 +376,26 @@ GENTFUNC2U( double, dcomplex, dcomplex, d, z, z, tfuncname, varname ) \
GENTFUNC2U( dcomplex, double, dcomplex, z, d, z, tfuncname, varname )
// -- Mixed precision two-operand with union of operands --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2U_MIX_P0( tfuncname ) \
\
GENTFUNC2U( float, double, double, s, d, d, tfuncname ) \
GENTFUNC2U( float, dcomplex, dcomplex, s, z, z, tfuncname ) \
\
GENTFUNC2U( double, float, double, d, s, d, tfuncname ) \
GENTFUNC2U( double, scomplex, dcomplex, d, c, z, tfuncname ) \
\
GENTFUNC2U( scomplex, double, dcomplex, c, d, z, tfuncname ) \
GENTFUNC2U( scomplex, dcomplex, dcomplex, c, z, z, tfuncname ) \
\
GENTFUNC2U( dcomplex, float, dcomplex, z, s, z, tfuncname ) \
GENTFUNC2U( dcomplex, scomplex, dcomplex, z, c, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2U_MIX_P( tfuncname, varname ) \
\
@@ -323,6 +415,16 @@ GENTFUNC2U( dcomplex, scomplex, dcomplex, z, c, z, tfuncname, varname )
// -- Basic two-operand with real projection of first operand --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2R_BASIC0( tfuncname ) \
\
GENTFUNC2R( float, float, float, s, s, s, tfuncname ) \
GENTFUNC2R( double, double, double, d, d, d, tfuncname ) \
GENTFUNC2R( scomplex, scomplex, float, c, c, s, tfuncname ) \
GENTFUNC2R( dcomplex, dcomplex, double, z, z, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2R_BASIC( tfuncname, varname ) \
\
@@ -332,8 +434,20 @@ GENTFUNC2R( scomplex, scomplex, float, c, c, s, tfuncname, varname ) \
GENTFUNC2R( dcomplex, dcomplex, double, z, z, d, tfuncname, varname )
// -- Mixed domain two-operand with real projection of first operand --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2R_MIX_D0( tfuncname ) \
\
GENTFUNC2R( float, scomplex, float, s, c, s, tfuncname ) \
GENTFUNC2R( scomplex, float, float, c, s, s, tfuncname ) \
\
GENTFUNC2R( double, dcomplex, double, d, z, d, tfuncname ) \
GENTFUNC2R( dcomplex, double, double, z, d, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2R_MIX_D( tfuncname, varname ) \
\
@@ -344,8 +458,26 @@ GENTFUNC2R( double, dcomplex, double, d, z, d, tfuncname, varname ) \
GENTFUNC2R( dcomplex, double, double, z, d, d, tfuncname, varname )
// -- Mixed precision two-operand with real projection of first operand --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC2R_MIX_P0( tfuncname ) \
\
GENTFUNC2R( float, double, float, s, d, s, tfuncname ) \
GENTFUNC2R( float, dcomplex, float, s, z, s, tfuncname ) \
\
GENTFUNC2R( double, float, double, d, s, d, tfuncname ) \
GENTFUNC2R( double, scomplex, double, d, c, d, tfuncname ) \
\
GENTFUNC2R( scomplex, double, float, c, d, s, tfuncname ) \
GENTFUNC2R( scomplex, dcomplex, float, c, z, s, tfuncname ) \
\
GENTFUNC2R( dcomplex, float, double, z, s, d, tfuncname ) \
GENTFUNC2R( dcomplex, scomplex, double, z, c, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC2R_MIX_P( tfuncname, varname ) \
\
@@ -368,6 +500,16 @@ GENTFUNC2R( dcomplex, scomplex, double, z, c, d, tfuncname, varname )
// -- Basic three-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3_BASIC0( tfuncname ) \
\
GENTFUNC3( float, float, float, s, s, s, tfuncname ) \
GENTFUNC3( double, double, double, d, d, d, tfuncname ) \
GENTFUNC3( scomplex, scomplex, scomplex, c, c, c, tfuncname ) \
GENTFUNC3( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3_BASIC( tfuncname, varname ) \
\
@@ -375,19 +517,41 @@ GENTFUNC3( float, float, float, s, s, s, tfuncname, varname ) \
GENTFUNC3( double, double, double, d, d, d, tfuncname, varname ) \
GENTFUNC3( scomplex, scomplex, scomplex, c, c, c, tfuncname, varname ) \
GENTFUNC3( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname, varname )
/*
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3_BASIC2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, float, float, s, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, double, double, d, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, scomplex, scomplex, c, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, dcomplex, dcomplex, z, z, z, tfuncname, varname1, varname2 )
*/
// -- Mixed domain three-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3_MIX_D0( tfuncname ) \
\
GENTFUNC3( float, float, scomplex, s, s, c, tfuncname ) \
GENTFUNC3( float, scomplex, float, s, c, s, tfuncname ) \
GENTFUNC3( float, scomplex, scomplex, s, c, c, tfuncname ) \
\
GENTFUNC3( double, double, dcomplex, d, d, z, tfuncname ) \
GENTFUNC3( double, dcomplex, double, d, z, d, tfuncname ) \
GENTFUNC3( double, dcomplex, dcomplex, d, z, z, tfuncname ) \
\
GENTFUNC3( scomplex, float, float, c, s, s, tfuncname ) \
GENTFUNC3( scomplex, float, scomplex, c, s, c, tfuncname ) \
GENTFUNC3( scomplex, scomplex, float, c, c, s, tfuncname ) \
\
GENTFUNC3( dcomplex, double, double, z, d, d, tfuncname ) \
GENTFUNC3( dcomplex, double, dcomplex, z, d, z, tfuncname ) \
GENTFUNC3( dcomplex, dcomplex, double, z, z, d, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3_MIX_D( tfuncname, varname ) \
\
@@ -407,9 +571,102 @@ GENTFUNC3( dcomplex, double, double, z, d, d, tfuncname, varname ) \
GENTFUNC3( dcomplex, double, dcomplex, z, d, z, tfuncname, varname ) \
GENTFUNC3( dcomplex, dcomplex, double, z, z, d, tfuncname, varname )
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3_MIX_D2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, float, scomplex, s, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, scomplex, float, s, c, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, scomplex, scomplex, s, c, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( double, double, dcomplex, d, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, dcomplex, double, d, z, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, dcomplex, dcomplex, d, z, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( scomplex, float, float, c, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, float, scomplex, c, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, scomplex, float, c, c, s, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( dcomplex, double, double, z, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, double, dcomplex, z, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, dcomplex, double, z, z, d, tfuncname, varname1, varname2 )
// -- Mixed precision three-operand macro --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3_MIX_P0( tfuncname ) \
\
GENTFUNC3( float, float, double, s, s, d, tfuncname ) \
GENTFUNC3( float, float, dcomplex, s, s, z, tfuncname ) \
\
GENTFUNC3( float, double, float, s, d, s, tfuncname ) \
GENTFUNC3( float, double, double, s, d, d, tfuncname ) \
GENTFUNC3( float, double, scomplex, s, d, c, tfuncname ) \
GENTFUNC3( float, double, dcomplex, s, d, z, tfuncname ) \
\
GENTFUNC3( float, scomplex, double, s, c, d, tfuncname ) \
GENTFUNC3( float, scomplex, dcomplex, s, c, z, tfuncname ) \
\
GENTFUNC3( float, dcomplex, float, s, z, s, tfuncname ) \
GENTFUNC3( float, dcomplex, double, s, z, d, tfuncname ) \
GENTFUNC3( float, dcomplex, scomplex, s, z, c, tfuncname ) \
GENTFUNC3( float, dcomplex, dcomplex, s, z, z, tfuncname ) \
\
\
GENTFUNC3( double, float, float, d, s, s, tfuncname ) \
GENTFUNC3( double, float, double, d, s, d, tfuncname ) \
GENTFUNC3( double, float, scomplex, d, s, c, tfuncname ) \
GENTFUNC3( double, float, dcomplex, d, s, z, tfuncname ) \
\
GENTFUNC3( double, double, float, d, d, s, tfuncname ) \
GENTFUNC3( double, double, scomplex, d, d, c, tfuncname ) \
\
GENTFUNC3( double, scomplex, float, d, c, s, tfuncname ) \
GENTFUNC3( double, scomplex, double, d, c, d, tfuncname ) \
GENTFUNC3( double, scomplex, scomplex, d, c, c, tfuncname ) \
GENTFUNC3( double, scomplex, dcomplex, d, c, z, tfuncname ) \
\
GENTFUNC3( double, dcomplex, float, d, z, s, tfuncname ) \
GENTFUNC3( double, dcomplex, scomplex, d, z, c, tfuncname ) \
\
\
GENTFUNC3( scomplex, float, double, c, s, d, tfuncname ) \
GENTFUNC3( scomplex, float, dcomplex, c, s, z, tfuncname ) \
\
GENTFUNC3( scomplex, double, float, c, d, s, tfuncname ) \
GENTFUNC3( scomplex, double, double, c, d, d, tfuncname ) \
GENTFUNC3( scomplex, double, scomplex, c, d, c, tfuncname ) \
GENTFUNC3( scomplex, double, dcomplex, c, d, z, tfuncname ) \
\
GENTFUNC3( scomplex, scomplex, double, c, c, d, tfuncname ) \
GENTFUNC3( scomplex, scomplex, dcomplex, c, c, z, tfuncname ) \
\
GENTFUNC3( scomplex, dcomplex, float, c, z, s, tfuncname ) \
GENTFUNC3( scomplex, dcomplex, double, c, z, d, tfuncname ) \
GENTFUNC3( scomplex, dcomplex, scomplex, c, z, c, tfuncname ) \
GENTFUNC3( scomplex, dcomplex, dcomplex, c, z, z, tfuncname ) \
\
\
GENTFUNC3( dcomplex, float, float, z, s, s, tfuncname ) \
GENTFUNC3( dcomplex, float, double, z, s, d, tfuncname ) \
GENTFUNC3( dcomplex, float, scomplex, z, s, c, tfuncname ) \
GENTFUNC3( dcomplex, float, dcomplex, z, s, z, tfuncname ) \
\
GENTFUNC3( dcomplex, double, float, z, d, s, tfuncname ) \
GENTFUNC3( dcomplex, double, scomplex, z, d, c, tfuncname ) \
\
GENTFUNC3( dcomplex, scomplex, float, z, c, s, tfuncname ) \
GENTFUNC3( dcomplex, scomplex, double, z, c, d, tfuncname ) \
GENTFUNC3( dcomplex, scomplex, scomplex, z, c, c, tfuncname ) \
GENTFUNC3( dcomplex, scomplex, dcomplex, z, c, z, tfuncname ) \
\
GENTFUNC3( dcomplex, dcomplex, float, z, z, s, tfuncname ) \
GENTFUNC3( dcomplex, dcomplex, scomplex, z, z, c, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3_MIX_P( tfuncname, varname ) \
\
@@ -480,10 +737,91 @@ GENTFUNC3( dcomplex, scomplex, dcomplex, z, c, z, tfuncname, varname ) \
GENTFUNC3( dcomplex, dcomplex, float, z, z, s, tfuncname, varname ) \
GENTFUNC3( dcomplex, dcomplex, scomplex, z, z, c, tfuncname, varname )
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3_MIX_P2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, float, double, s, s, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, float, dcomplex, s, s, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, double, float, s, d, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, double, double, s, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, double, scomplex, s, d, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, double, dcomplex, s, d, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, scomplex, double, s, c, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, scomplex, dcomplex, s, c, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( float, dcomplex, float, s, z, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, dcomplex, double, s, z, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, dcomplex, scomplex, s, z, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( float, dcomplex, dcomplex, s, z, z, tfuncname, varname1, varname2 ) \
\
\
GENTFUNC3( double, float, float, d, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, float, double, d, s, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, float, scomplex, d, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, float, dcomplex, d, s, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( double, double, float, d, d, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, double, scomplex, d, d, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( double, scomplex, float, d, c, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, scomplex, double, d, c, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, scomplex, scomplex, d, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, scomplex, dcomplex, d, c, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( double, dcomplex, float, d, z, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( double, dcomplex, scomplex, d, z, c, tfuncname, varname1, varname2 ) \
\
\
GENTFUNC3( scomplex, float, double, c, s, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, float, dcomplex, c, s, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( scomplex, double, float, c, d, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, double, double, c, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, double, scomplex, c, d, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, double, dcomplex, c, d, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( scomplex, scomplex, double, c, c, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, scomplex, dcomplex, c, c, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( scomplex, dcomplex, float, c, z, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, dcomplex, double, c, z, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, dcomplex, scomplex, c, z, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( scomplex, dcomplex, dcomplex, c, z, z, tfuncname, varname1, varname2 ) \
\
\
GENTFUNC3( dcomplex, float, float, z, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, float, double, z, s, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, float, scomplex, z, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, float, dcomplex, z, s, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( dcomplex, double, float, z, d, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, double, scomplex, z, d, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( dcomplex, scomplex, float, z, c, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, scomplex, double, z, c, d, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, scomplex, scomplex, z, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, scomplex, dcomplex, z, c, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3( dcomplex, dcomplex, float, z, z, s, tfuncname, varname1, varname2 ) \
GENTFUNC3( dcomplex, dcomplex, scomplex, z, z, c, tfuncname, varname1, varname2 )
// -- Basic three-operand with union of operands 1 and 2 --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3U12_BASIC0( tfuncname ) \
\
GENTFUNC3U12( float, float, float, float, s, s, s, s, tfuncname ) \
GENTFUNC3U12( double, double, double, double, d, d, d, d, tfuncname ) \
GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, tfuncname ) \
GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3U12_BASIC( tfuncname, varname ) \
\
@@ -492,9 +830,40 @@ GENTFUNC3U12( double, double, double, double, d, d, d, d, tfuncname, var
GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, tfuncname, varname ) \
GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, tfuncname, varname )
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3U12_BASIC2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( float, float, float, float, s, s, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, double, double, double, d, d, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, tfuncname, varname1, varname2 )
// -- Mixed domain three-operand with union of operands 1 and 2 --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3U12_MIX_D0( tfuncname ) \
\
GENTFUNC3U12( float, float, scomplex, float, s, s, c, s, tfuncname ) \
GENTFUNC3U12( float, scomplex, float, scomplex, s, c, s, c, tfuncname ) \
GENTFUNC3U12( float, scomplex, scomplex, scomplex, s, c, c, c, tfuncname ) \
\
GENTFUNC3U12( double, double, dcomplex, double, d, d, z, d, tfuncname ) \
GENTFUNC3U12( double, dcomplex, double, dcomplex, d, z, d, z, tfuncname ) \
GENTFUNC3U12( double, dcomplex, dcomplex, dcomplex, d, z, z, z, tfuncname ) \
\
GENTFUNC3U12( scomplex, float, float, scomplex, c, s, s, c, tfuncname ) \
GENTFUNC3U12( scomplex, float, scomplex, scomplex, c, s, c, c, tfuncname ) \
GENTFUNC3U12( scomplex, scomplex, float, scomplex, c, c, s, c, tfuncname ) \
\
GENTFUNC3U12( dcomplex, double, double, dcomplex, z, d, d, z, tfuncname ) \
GENTFUNC3U12( dcomplex, double, dcomplex, dcomplex, z, d, z, z, tfuncname ) \
GENTFUNC3U12( dcomplex, dcomplex, double, dcomplex, z, z, d, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3U12_MIX_D( tfuncname, varname ) \
\
@@ -514,9 +883,102 @@ GENTFUNC3U12( dcomplex, double, double, dcomplex, z, d, d, z, tfuncname, var
GENTFUNC3U12( dcomplex, double, dcomplex, dcomplex, z, d, z, z, tfuncname, varname ) \
GENTFUNC3U12( dcomplex, dcomplex, double, dcomplex, z, z, d, z, tfuncname, varname )
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3U12_MIX_D2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( float, float, scomplex, float, s, s, c, s, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( float, scomplex, float, scomplex, s, c, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( float, scomplex, scomplex, scomplex, s, c, c, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( double, double, dcomplex, double, d, d, z, d, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, dcomplex, double, dcomplex, d, z, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, dcomplex, dcomplex, dcomplex, d, z, z, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( scomplex, float, float, scomplex, c, s, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, float, scomplex, scomplex, c, s, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, scomplex, float, scomplex, c, c, s, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( dcomplex, double, double, dcomplex, z, d, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, double, dcomplex, dcomplex, z, d, z, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, dcomplex, double, dcomplex, z, z, d, z, tfuncname, varname1, varname2 )
// -- Mixed precision three-operand with union of operands 1 and 2 --
// -- (no auxiliary arguments) --
#define INSERT_GENTFUNC3U12_MIX_P0( tfuncname ) \
\
GENTFUNC3U12( float, float, double, float, s, s, d, s, tfuncname ) \
GENTFUNC3U12( float, float, dcomplex, float, s, s, z, s, tfuncname ) \
\
GENTFUNC3U12( float, double, float, double, s, d, s, d, tfuncname ) \
GENTFUNC3U12( float, double, double, double, s, d, d, d, tfuncname ) \
GENTFUNC3U12( float, double, scomplex, double, s, d, c, d, tfuncname ) \
GENTFUNC3U12( float, double, dcomplex, double, s, d, z, d, tfuncname ) \
\
GENTFUNC3U12( float, scomplex, double, scomplex, s, c, d, c, tfuncname ) \
GENTFUNC3U12( float, scomplex, dcomplex, scomplex, s, c, z, c, tfuncname ) \
\
GENTFUNC3U12( float, dcomplex, float, dcomplex, s, z, s, z, tfuncname ) \
GENTFUNC3U12( float, dcomplex, double, dcomplex, s, z, d, z, tfuncname ) \
GENTFUNC3U12( float, dcomplex, scomplex, dcomplex, s, z, c, z, tfuncname ) \
GENTFUNC3U12( float, dcomplex, dcomplex, dcomplex, s, z, z, z, tfuncname ) \
\
\
GENTFUNC3U12( double, float, float, double, d, s, s, d, tfuncname ) \
GENTFUNC3U12( double, float, double, double, d, s, d, d, tfuncname ) \
GENTFUNC3U12( double, float, scomplex, double, d, s, c, d, tfuncname ) \
GENTFUNC3U12( double, float, dcomplex, double, d, s, z, d, tfuncname ) \
\
GENTFUNC3U12( double, double, float, double, d, d, s, d, tfuncname ) \
GENTFUNC3U12( double, double, scomplex, double, d, d, c, d, tfuncname ) \
\
GENTFUNC3U12( double, scomplex, float, dcomplex, d, c, s, z, tfuncname ) \
GENTFUNC3U12( double, scomplex, double, dcomplex, d, c, d, z, tfuncname ) \
GENTFUNC3U12( double, scomplex, scomplex, dcomplex, d, c, c, z, tfuncname ) \
GENTFUNC3U12( double, scomplex, dcomplex, dcomplex, d, c, z, z, tfuncname ) \
\
GENTFUNC3U12( double, dcomplex, float, dcomplex, d, z, s, z, tfuncname ) \
GENTFUNC3U12( double, dcomplex, scomplex, dcomplex, d, z, c, z, tfuncname ) \
\
\
GENTFUNC3U12( scomplex, float, double, scomplex, c, s, d, c, tfuncname ) \
GENTFUNC3U12( scomplex, float, dcomplex, scomplex, c, s, z, c, tfuncname ) \
\
GENTFUNC3U12( scomplex, double, float, dcomplex, c, d, s, z, tfuncname ) \
GENTFUNC3U12( scomplex, double, double, dcomplex, c, d, d, z, tfuncname ) \
GENTFUNC3U12( scomplex, double, scomplex, dcomplex, c, d, c, z, tfuncname ) \
GENTFUNC3U12( scomplex, double, dcomplex, dcomplex, c, d, z, z, tfuncname ) \
\
GENTFUNC3U12( scomplex, scomplex, double, scomplex, c, c, d, c, tfuncname ) \
GENTFUNC3U12( scomplex, scomplex, dcomplex, scomplex, c, c, z, c, tfuncname ) \
\
GENTFUNC3U12( scomplex, dcomplex, float, dcomplex, c, z, s, z, tfuncname ) \
GENTFUNC3U12( scomplex, dcomplex, double, dcomplex, c, z, d, z, tfuncname ) \
GENTFUNC3U12( scomplex, dcomplex, scomplex, dcomplex, c, z, c, z, tfuncname ) \
GENTFUNC3U12( scomplex, dcomplex, dcomplex, dcomplex, c, z, z, z, tfuncname ) \
\
\
GENTFUNC3U12( dcomplex, float, float, dcomplex, z, s, s, z, tfuncname ) \
GENTFUNC3U12( dcomplex, float, double, dcomplex, z, s, d, z, tfuncname ) \
GENTFUNC3U12( dcomplex, float, scomplex, dcomplex, z, s, c, z, tfuncname ) \
GENTFUNC3U12( dcomplex, float, dcomplex, dcomplex, z, s, z, z, tfuncname ) \
\
GENTFUNC3U12( dcomplex, double, float, dcomplex, z, d, s, z, tfuncname ) \
GENTFUNC3U12( dcomplex, double, scomplex, dcomplex, z, d, c, z, tfuncname ) \
\
GENTFUNC3U12( dcomplex, scomplex, float, dcomplex, z, c, s, z, tfuncname ) \
GENTFUNC3U12( dcomplex, scomplex, double, dcomplex, z, c, d, z, tfuncname ) \
GENTFUNC3U12( dcomplex, scomplex, scomplex, dcomplex, z, c, c, z, tfuncname ) \
GENTFUNC3U12( dcomplex, scomplex, dcomplex, dcomplex, z, c, z, z, tfuncname ) \
\
GENTFUNC3U12( dcomplex, dcomplex, float, dcomplex, z, z, s, z, tfuncname ) \
GENTFUNC3U12( dcomplex, dcomplex, scomplex, dcomplex, z, z, c, z, tfuncname )
// -- (one auxiliary argument) --
#define INSERT_GENTFUNC3U12_MIX_P( tfuncname, varname ) \
\
@@ -587,46 +1049,7 @@ GENTFUNC3U12( dcomplex, scomplex, dcomplex, dcomplex, z, c, z, z, tfuncname, var
GENTFUNC3U12( dcomplex, dcomplex, float, dcomplex, z, z, s, z, tfuncname, varname ) \
GENTFUNC3U12( dcomplex, dcomplex, scomplex, dcomplex, z, z, c, z, tfuncname, varname )
// -- Basic three-operand with union of operands 1 and 2 --
// -- (with two auxiliary arguments) --
#define INSERT_GENTFUNC3U12_BASIC2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( float, float, float, float, s, s, s, s, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, double, double, double, d, d, d, d, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, scomplex, scomplex, scomplex, c, c, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, dcomplex, dcomplex, dcomplex, z, z, z, z, tfuncname, varname1, varname2 )
// -- Mixed domain three-operand with union of operands 1 and 2 --
// -- (with two auxiliary arguments) --
#define INSERT_GENTFUNC3U12_MIX_D2( tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( float, float, scomplex, float, s, s, c, s, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( float, scomplex, float, scomplex, s, c, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( float, scomplex, scomplex, scomplex, s, c, c, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( double, double, dcomplex, double, d, d, z, d, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, dcomplex, double, dcomplex, d, z, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( double, dcomplex, dcomplex, dcomplex, d, z, z, z, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( scomplex, float, float, scomplex, c, s, s, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, float, scomplex, scomplex, c, s, c, c, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( scomplex, scomplex, float, scomplex, c, c, s, c, tfuncname, varname1, varname2 ) \
\
GENTFUNC3U12( dcomplex, double, double, dcomplex, z, d, d, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, double, dcomplex, dcomplex, z, d, z, z, tfuncname, varname1, varname2 ) \
GENTFUNC3U12( dcomplex, dcomplex, double, dcomplex, z, z, d, z, tfuncname, varname1, varname2 )
// -- Mixed precision three-operand with union of operands 1 and 2 --
// -- (with two auxiliary arguments) --
// -- (two auxiliary arguments) --
#define INSERT_GENTFUNC3U12_MIX_P2( tfuncname, varname1, varname2 ) \
\

View File

@@ -659,6 +659,86 @@
} \
}
// Set dimensions, increments, effective uplo/diagoff, etc for ONE matrix
// argument (without column-wise stride optimization).
#define bli_set_dims_incs_uplo_1m_noswap( \
diagoffa, diaga, \
uploa, m, n, rs_a, cs_a, \
uplo_eff, n_elem_max, n_iter, inca, lda, \
ij0, n_shift \
) \
{ \
/* If matrix A is entirely "unstored", that is, if either:
- A is lower-stored and entirely above the diagonal, or
- A is upper-stored and entirely below the diagonal
then we mark the storage as implicitly zero. */ \
if ( bli_is_unstored_subpart( diagoffa, BLIS_NO_TRANSPOSE, uploa, m, n ) ) \
{ \
uplo_eff = BLIS_ZEROS; \
} \
else \
{ \
doff_t diagoffa_use = diagoffa; \
doff_t diagoff_eff; \
dim_t n_iter_max; \
\
if ( bli_is_unit_diag( diaga ) ) \
bli_shift_diag_offset_to_shrink_uplo( uploa, diagoffa_use ); \
\
/* If matrix A is entirely "stored", that is, if either:
- A is upper-stored and entirely above the diagonal, or
- A is lower-stored and entirely below the diagonal
then we mark the storage as dense. */ \
if ( bli_is_stored_subpart( diagoffa_use, BLIS_NO_TRANSPOSE, uploa, m, n ) ) \
uploa = BLIS_DENSE; \
\
n_iter_max = n; \
n_elem_max = m; \
inca = rs_a; \
lda = cs_a; \
uplo_eff = uploa; \
diagoff_eff = diagoffa_use; \
\
if ( bli_is_dense( uplo_eff ) ) \
{ \
n_iter = n_iter_max; \
} \
else if ( bli_is_upper( uplo_eff ) ) \
{ \
if ( diagoff_eff < 0 ) \
{ \
ij0 = 0; \
n_shift = -diagoff_eff; \
n_elem_max = bli_min( n_elem_max, n_shift + bli_min( m, n ) ); \
n_iter = n_iter_max; \
} \
else \
{ \
ij0 = diagoff_eff; \
n_shift = 0; \
n_iter = n_iter_max - diagoff_eff; \
} \
} \
else /* if ( bli_is_lower( uplo_eff ) ) */ \
{ \
if ( diagoff_eff < 0 ) \
{ \
ij0 = -diagoff_eff; \
n_shift = 0; \
n_elem_max = n_elem_max + diagoff_eff; \
n_iter = bli_min( n_elem_max, bli_min( m, n ) ); \
} \
else \
{ \
ij0 = 0; \
n_shift = diagoff_eff; \
n_iter = bli_min( n_iter_max, n_shift + bli_min( m, n ) ); \
} \
} \
} \
}
// Set dimensions, increments, effective uplo/diagoff, etc for TWO matrix
// arguments.

View File

@@ -198,6 +198,7 @@
#define bli_fabs( a ) ( (a) <= 0.0 ? -(a) : (a) )
// fminabs, fmaxabs
#define bli_fminabs( a, b ) \
\
bli_fmin( bli_fabs( a ), \
@@ -208,6 +209,11 @@
bli_fmax( bli_fabs( a ), \
bli_fabs( b ) )
// isnan, isinf
#define bli_isinf( a ) isinf( a )
#define bli_isnan( a ) isnan( a )
// swap_types
#define bli_swap_types( type1, type2 ) \

View File

@@ -121,9 +121,9 @@ extern "C" {
#include "bli_addsc.h"
#include "bli_copysc.h"
#include "bli_divsc.h"
#include "bli_fnormsc.h"
#include "bli_getsc.h"
#include "bli_mulsc.h"
#include "bli_normfsc.h"
#include "bli_setsc.h"
#include "bli_sqrtsc.h"
#include "bli_subsc.h"
@@ -143,7 +143,6 @@ extern "C" {
#include "bli_copyv.h"
#include "bli_dotv.h"
#include "bli_dotxv.h"
#include "bli_fnormv.h"
#include "bli_scal2v.h"
#include "bli_subv.h"
#include "bli_swapv.h"
@@ -183,7 +182,6 @@ extern "C" {
#include "bli_addm.h"
#include "bli_axpym.h"
#include "bli_copym.h"
#include "bli_fnormm.h"
#include "bli_scal2m.h"
#include "bli_subm.h"
#include "bli_packm.h"
@@ -220,12 +218,17 @@ extern "C" {
// -- Utility operations --
#include "bli_abmaxv.h"
#include "bli_absumv.h"
#include "bli_absumm.h"
#include "bli_amaxv.h"
#include "bli_asumv.h"
#include "bli_mkherm.h"
#include "bli_mksymm.h"
#include "bli_mktrim.h"
#include "bli_norm1v.h"
#include "bli_norm1m.h"
#include "bli_normfv.h"
#include "bli_normfm.h"
#include "bli_normiv.h"
#include "bli_normim.h"
#include "bli_printv.h"
#include "bli_printm.h"
#include "bli_randv.h"

View File

@@ -1,36 +0,0 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_abmaxv_check( obj_t* x,
obj_t* abmax_i );

View File

@@ -1,189 +0,0 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#define FUNCPTR_T absumm_fp
typedef void (*FUNCPTR_T)(
doff_t diagoffx,
uplo_t uplox,
dim_t m,
dim_t n,
void* x, inc_t rs_x, inc_t cs_x,
void* absum
);
static FUNCPTR_T GENARRAY(ftypes,absumm_unb_var1);
void bli_absumm_unb_var1( obj_t* x,
obj_t* absum )
{
num_t dt_x = bli_obj_datatype( *x );
doff_t diagoffx = bli_obj_diag_offset( *x );
uplo_t uplox = bli_obj_uplo( *x );
dim_t m = bli_obj_length( *x );
dim_t n = bli_obj_width( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
inc_t rs_x = bli_obj_row_stride( *x );
inc_t cs_x = bli_obj_col_stride( *x );
void* buf_absum = bli_obj_buffer_at_off( *absum );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x];
// Invoke the function.
f( diagoffx,
uplox,
m,
n,
buf_x, rs_x, cs_x,
buf_absum );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname, kername ) \
\
void PASTEMAC(chx,varname)( \
doff_t diagoffx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
void* x, inc_t rs_x, inc_t cs_x, \
void* absum \
) \
{ \
ctype_x* x_cast = x; \
ctype_xr* absum_cast = absum; \
ctype_x* x1; \
ctype_xr absum_r; \
ctype_xr absum_temp_r; \
uplo_t uplox_eff; \
dim_t n_iter; \
dim_t n_elem, n_elem_max; \
inc_t ldx, incx; \
dim_t j, i; \
dim_t ij0, n_shift; \
\
/* Initialize the absolute sum accumulator to zero. */ \
PASTEMAC(chxr,set0s)( absum_r ); \
\
/* If either dimension is zero, return swith absum equal to zero. */ \
if ( bli_zero_dim2( m, n ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_r, *absum_cast ); \
return; \
} \
\
/* Set various loop parameters. */ \
bli_set_dims_incs_uplo_1m( diagoffx, BLIS_NONUNIT_DIAG, \
uplox, m, n, rs_x, cs_x, \
uplox_eff, n_elem_max, n_iter, incx, ldx, \
ij0, n_shift ); \
\
/* If the matrix is zeros, return swith absum equal to zero. */ \
if ( bli_is_zeros( uplox_eff ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_r, *absum_cast ); \
return; \
} \
\
\
/* Handle dense and upper/lower storage cases separately. */ \
if ( bli_is_dense( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
n_elem = n_elem_max; \
\
x1 = x_cast + (j )*ldx + (0 )*incx; \
\
PASTEMAC(chx,kername)( n_elem, \
x1, incx, \
&absum_temp_r ); \
\
PASTEMAC2(chxr,chxr,adds)( absum_temp_r, absum_r ); \
} \
} \
else \
{ \
if ( bli_is_upper( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
\
x1 = x_cast + (ij0+j )*ldx + (0 )*incx; \
\
PASTEMAC(chx,kername)( n_elem, \
x1, incx, \
&absum_temp_r ); \
\
PASTEMAC2(chxr,chxr,adds)( absum_temp_r, absum_r ); \
} \
} \
else if ( bli_is_lower( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
n_elem = n_elem_max - i; \
\
x1 = x_cast + (j )*ldx + (ij0+i )*incx; \
\
PASTEMAC(chx,kername)( n_elem, \
x1, incx, \
&absum_temp_r ); \
\
PASTEMAC2(chxr,chxr,adds)( absum_temp_r, absum_r ); \
} \
} \
} \
\
/* Store final values of absum to output variables. */ \
PASTEMAC2(chxr,chxr,copys)( absum_r, *absum_cast ); \
}
INSERT_GENTFUNCR_BASIC( absumm_unb_var1, absumv_unb_var1 )

View File

@@ -1,36 +0,0 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_absumv_check( obj_t* x,
obj_t* absum );

View File

@@ -35,14 +35,14 @@
#include "blis.h"
/*
void bli_abmaxv( obj_t* x,
void bli_amaxv( obj_t* x,
obj_t* scale,
obj_t* sumsq )
{
if ( bli_error_checking_is_enabled() )
bli_abmaxv_check( x, scale, sumsq );
bli_amaxv_check( x, scale, sumsq );
bli_abmaxv_unb_var1( x, scale, sumsq );
bli_amaxv_unb_var1( x, scale, sumsq );
}
*/
@@ -64,7 +64,7 @@ void PASTEMAC0(opname)( \
abmax_i ); \
}
GENFRONT( abmaxv, abmaxv_unb_var1 )
GENFRONT( amaxv, amaxv_unb_var1 )
//
@@ -84,5 +84,5 @@ void PASTEMAC(chx,opname)( \
abmax_i ); \
}
INSERT_GENTFUNCI_BASIC( abmaxv, abmaxv_unb_var1 )
INSERT_GENTFUNCI_BASIC( amaxv, amaxv_unb_var1 )

View File

@@ -32,15 +32,15 @@
*/
#include "bli_abmaxv_check.h"
#include "bli_abmaxv_unb_var1.h"
#include "bli_amaxv_check.h"
#include "bli_amaxv_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_abmaxv( obj_t* x,
obj_t* abmax_i );
void bli_amaxv( obj_t* x,
obj_t* abmax_i );
//
@@ -55,5 +55,5 @@ void PASTEMAC(chx,opname)( \
ctype_i* abmax_i \
);
INSERT_GENTPROTI_BASIC( abmaxv )
INSERT_GENTPROTI_BASIC( amaxv )

View File

@@ -34,8 +34,8 @@
#include "blis.h"
void bli_abmaxv_check( obj_t* x,
obj_t* abmax_i )
void bli_amaxv_check( obj_t* x,
obj_t* abmax_i )
{
err_t e_val;

View File

@@ -32,5 +32,5 @@
*/
void bli_absumm_check( obj_t* a,
obj_t* absum );
void bli_amaxv_check( obj_t* x,
obj_t* abmax_i );

View File

@@ -34,7 +34,7 @@
#include "blis.h"
#define FUNCPTR_T abmaxv_fp
#define FUNCPTR_T amaxv_fp
typedef void (*FUNCPTR_T)(
dim_t n,
@@ -42,11 +42,11 @@ typedef void (*FUNCPTR_T)(
void* abmax_i
);
static FUNCPTR_T GENARRAY(ftypes,abmaxv_unb_var1);
static FUNCPTR_T GENARRAY(ftypes,amaxv_unb_var1);
void bli_abmaxv_unb_var1( obj_t* x,
obj_t* abmax_i )
void bli_amaxv_unb_var1( obj_t* x,
obj_t* abmax_i )
{
num_t dt_x = bli_obj_datatype( *x );
@@ -71,7 +71,7 @@ void bli_abmaxv_unb_var1( obj_t* x,
#undef GENTFUNCRI
#define GENTFUNCRI( ctype_x, ctype_xr, ctype_i, chx, chxr, chi, opname, varname ) \
#define GENTFUNCRI( ctype_x, ctype_xr, ctype_i, chx, chxr, chi, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
@@ -82,55 +82,62 @@ void PASTEMAC(chx,varname)( \
ctype_x* x_cast = x; \
ctype_i* abmax_i_cast = abmax_i; \
ctype_xr* minus_one = PASTEMAC(chxr,m1); \
ctype_i* minus_one_i = PASTEMAC(chi,m1); \
ctype_i* zero_i = PASTEMAC(chi,0); \
\
ctype_x* chi1; \
ctype_xr chi1_r; \
ctype_xr chi1_i; \
ctype_xr abs_chi1_save; \
ctype_xr abs_chi1; \
ctype_i i_save; \
ctype_xr abs_chi1_max; \
ctype_i i_max; \
dim_t i; \
\
/* If the vector is empty, return an index of zero. */ \
if ( bli_zero_dim1( n ) ) \
{ \
PASTEMAC2(chi,chi,copys)( *zero_i, *abmax_i_cast ); \
return; \
} \
\
/* Initialize the index of the maximum absolute value to zero. */ \
PASTEMAC2(chi,chi,copys)( *zero_i, i_max ); \
\
/* Initialize the maximum absolute value search candidate with
-1, which is guaranteed to be less than all values we will
compute. */ \
PASTEMAC2(chxr,chxr,copys)( *minus_one, abs_chi1_save ); \
\
/* Initialize the index for the maximum absolute value search
candidate. We use -1 in case x has a length of zero. */ \
PASTEMAC2(chi,chi,copys)( *minus_one_i, i_save ); \
\
chi1 = x_cast; \
PASTEMAC2(chxr,chxr,copys)( *minus_one, abs_chi1_max ); \
\
for ( i = 0; i < n; ++i ) \
{ \
chi1 = x_cast + (i )*incx; \
\
/* Get the real and imaginary components of chi1. */ \
PASTEMAC2(chx,chxr,gets)( *chi1, chi1_r, chi1_i ); \
\
/* Replace chi1_r and chi1_i with their absolute values. */ \
chi1_r = bli_fabs( chi1_r ); \
chi1_i = bli_fabs( chi1_i ); \
PASTEMAC2(chxr,chxr,abval2s)( chi1_r, chi1_r ); \
PASTEMAC2(chxr,chxr,abval2s)( chi1_i, chi1_i ); \
\
/* Add the real and imaginary absolute values together. */ \
PASTEMAC(chxr,set0s)( abs_chi1 ); \
PASTEMAC2(chxr,chxr,adds)( chi1_r, abs_chi1 ); \
PASTEMAC2(chxr,chxr,adds)( chi1_i, abs_chi1 ); \
\
if ( abs_chi1_save < abs_chi1 ) \
/* If the absolute value of the current element exceeds that of
the previous largest, save it and its index. If NaN is
encountered, then treat it the same as if it were a valid
value that was smaller than any previously seen. This
behavior mimics that of LAPACK's ?lange(). */ \
if ( abs_chi1_max < abs_chi1 || bli_isnan( abs_chi1 ) ) \
{ \
/* If the absolute value of the current element exceeds
that of the previous largest, save it and its index. */ \
PASTEMAC2(chxr,chxr,copys)( abs_chi1, abs_chi1_save ); \
PASTEMAC2(chi,chi,copys)( i, i_save ); \
PASTEMAC2(chxr,chxr,copys)( abs_chi1, abs_chi1_max ); \
PASTEMAC2(chi,chi,copys)( i, i_max ); \
} \
\
chi1 += incx; \
} \
\
/* Store final index to output variable. */ \
PASTEMAC2(chi,chi,copys)( i_save, *abmax_i_cast ); \
PASTEMAC2(chi,chi,copys)( i_max, *abmax_i_cast ); \
}
INSERT_GENTFUNCRI_BASIC( abmaxv, abmaxv_unb_var1 )
INSERT_GENTFUNCRI_BASIC0( amaxv_unb_var1 )

View File

@@ -32,8 +32,8 @@
*/
void bli_abmaxv_unb_var1( obj_t* x,
obj_t* abmax_i );
void bli_amaxv_unb_var1( obj_t* x,
obj_t* abmax_i );
#undef GENTPROTRI
@@ -45,5 +45,5 @@ void PASTEMAC(chx,varname)( \
void* abmax_i \
);
INSERT_GENTPROTRI_BASIC( abmaxv_unb_var1 )
INSERT_GENTPROTRI_BASIC( amaxv_unb_var1 )

View File

@@ -35,14 +35,14 @@
#include "blis.h"
/*
void bli_absumv( obj_t* x,
void bli_asumv( obj_t* x,
obj_t* scale,
obj_t* sumsq )
{
if ( bli_error_checking_is_enabled() )
bli_absumv_check( x, scale, sumsq );
bli_asumv_check( x, scale, sumsq );
bli_absumv_unb_var1( x, scale, sumsq );
bli_asumv_unb_var1( x, scale, sumsq );
}
*/
@@ -54,17 +54,17 @@ void bli_absumv( obj_t* x,
\
void PASTEMAC0(opname)( \
obj_t* x, \
obj_t* absum \
obj_t* asum \
) \
{ \
if ( bli_error_checking_is_enabled() ) \
PASTEMAC(opname,_check)( x, absum ); \
PASTEMAC(opname,_check)( x, asum ); \
\
PASTEMAC0(varname)( x, \
absum ); \
asum ); \
}
GENFRONT( absumv, absumv_unb_var1 )
GENFRONT( asumv, asumv_unb_var1 )
//
@@ -76,13 +76,13 @@ GENFRONT( absumv, absumv_unb_var1 )
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* absum \
ctype_xr* asum \
) \
{ \
PASTEMAC(chx,varname)( n, \
x, incx, \
absum ); \
asum ); \
}
INSERT_GENTFUNCR_BASIC( absumv, absumv_unb_var1 )
INSERT_GENTFUNCR_BASIC( asumv, asumv_unb_var1 )

View File

@@ -32,15 +32,15 @@
*/
#include "bli_absumv_check.h"
#include "bli_absumv_unb_var1.h"
#include "bli_asumv_check.h"
#include "bli_asumv_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_absumv( obj_t* x,
obj_t* absum );
void bli_asumv( obj_t* x,
obj_t* asum );
//
@@ -52,8 +52,8 @@ void bli_absumv( obj_t* x,
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* absum \
ctype_xr* asum \
);
INSERT_GENTPROTR_BASIC( absumv )
INSERT_GENTPROTR_BASIC( asumv )

View File

@@ -34,8 +34,8 @@
#include "blis.h"
void bli_absumv_check( obj_t* x,
obj_t* absum )
void bli_asumv_check( obj_t* x,
obj_t* asum )
{
err_t e_val;
@@ -44,7 +44,7 @@ void bli_absumv_check( obj_t* x,
e_val = bli_check_floating_object( x );
bli_check_error_code( e_val );
e_val = bli_check_nonconstant_object( absum );
e_val = bli_check_nonconstant_object( asum );
bli_check_error_code( e_val );
// Check object dimensions.
@@ -52,7 +52,7 @@ void bli_absumv_check( obj_t* x,
e_val = bli_check_vector_object( x );
bli_check_error_code( e_val );
e_val = bli_check_scalar_object( absum );
e_val = bli_check_scalar_object( asum );
bli_check_error_code( e_val );
}

View File

@@ -0,0 +1,36 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_asumv_check( obj_t* x,
obj_t* asum );

View File

@@ -34,86 +34,66 @@
#include "blis.h"
#define FUNCPTR_T absumv_fp
#define FUNCPTR_T asumv_fp
typedef void (*FUNCPTR_T)(
dim_t n,
void* x, inc_t incx,
void* absum
void* asum
);
/*
// If some mixed datatype functions will not be compiled, we initialize
// the corresponding elements of the function array to NULL.
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
static FUNCPTR_T GENARRAY2_ALL(ftypes,absumv_unb_var1);
#else
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
static FUNCPTR_T GENARRAY2_EXT(ftypes,absumv_unb_var1);
#else
static FUNCPTR_T GENARRAY2_MIN(ftypes,absumv_unb_var1);
#endif
#endif
*/
static FUNCPTR_T GENARRAY(ftypes,absumv_unb_var1);
static FUNCPTR_T GENARRAY(ftypes,asumv_unb_var1);
void bli_absumv_unb_var1( obj_t* x,
obj_t* absum )
void bli_asumv_unb_var1( obj_t* x,
obj_t* asum )
{
num_t dt_x = bli_obj_datatype( *x );
num_t dt_x = bli_obj_datatype( *x );
dim_t n = bli_obj_vector_dim( *x );
dim_t n = bli_obj_vector_dim( *x );
inc_t inc_x = bli_obj_vector_inc( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
inc_t inc_x = bli_obj_vector_inc( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
void* buf_absum = bli_obj_buffer_at_off( *absum );
void* buf_asum = bli_obj_buffer_at_off( *asum );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x]; //[dt_s];
f = ftypes[dt_x];
// Invoke the function.
f( n,
buf_x, inc_x,
buf_absum );
buf_asum );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* absum \
void* asum \
) \
{ \
ctype_x* x_cast = x; \
ctype_xr* absum_cast = absum; \
ctype_x* x_cast = x; \
ctype_xr* asum_cast = asum; \
ctype_x* chi1; \
ctype_xr chi1_r; \
ctype_xr chi1_i; \
ctype_xr absum_r; \
ctype_xr absum; \
dim_t i; \
\
/* Initialize the absolute sum accumulator to zero. */ \
PASTEMAC(chxr,set0s)( absum_r ); \
\
/* If x is zero length, return swith absum equal to zero. */ \
if ( bli_zero_dim1( n ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_r, *absum_cast ); \
return; \
} \
\
chi1 = x_cast; \
PASTEMAC(chxr,set0s)( absum ); \
\
for ( i = 0; i < n; ++i ) \
{ \
chi1 = x_cast + (i )*incx; \
\
/* Get the real and imaginary components of chi1. */ \
PASTEMAC2(chx,chxr,gets)( *chi1, chi1_r, chi1_i ); \
\
@@ -122,15 +102,13 @@ void PASTEMAC(chx,varname)( \
chi1_i = bli_fabs( chi1_i ); \
\
/* Accumulate the real and imaginary components into absum. */ \
PASTEMAC2(chxr,chxr,adds)( chi1_r, absum_r ); \
PASTEMAC2(chxr,chxr,adds)( chi1_i, absum_r ); \
\
chi1 += incx; \
PASTEMAC2(chxr,chxr,adds)( chi1_r, absum ); \
PASTEMAC2(chxr,chxr,adds)( chi1_i, absum ); \
} \
\
/* Store final values of absum to output variables. */ \
PASTEMAC2(chxr,chxr,copys)( absum_r, *absum_cast ); \
/* Store the final value of absum to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( absum, *asum_cast ); \
}
INSERT_GENTFUNCR_BASIC( absumv, absumv_unb_var1 )
INSERT_GENTFUNCR_BASIC0( asumv_unb_var1 )

View File

@@ -32,8 +32,8 @@
*/
void bli_absumv_unb_var1( obj_t* x,
obj_t* absum );
void bli_asumv_unb_var1( obj_t* x,
obj_t* asum );
#undef GENTPROTR
@@ -42,8 +42,8 @@ void bli_absumv_unb_var1( obj_t* x,
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* absum \
void* asum \
);
INSERT_GENTPROTR_BASIC( absumv_unb_var1 )
INSERT_GENTPROTR_BASIC( asumv_unb_var1 )

View File

@@ -71,7 +71,7 @@ void bli_mkherm_unb_var1( obj_t* a )
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname)( \
uplo_t uploa, \
@@ -117,5 +117,5 @@ void PASTEMAC(ch,varname)( \
}
INSERT_GENTFUNC_BASIC( mkherm, mkherm_unb_var1 )
INSERT_GENTFUNC_BASIC0( mkherm_unb_var1 )

View File

@@ -71,7 +71,7 @@ void bli_mksymm_unb_var1( obj_t* a )
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname)( \
uplo_t uploa, \
@@ -103,5 +103,5 @@ void PASTEMAC(ch,varname)( \
}
INSERT_GENTFUNC_BASIC( mksymm, mksymm_unb_var1 )
INSERT_GENTFUNC_BASIC0( mksymm_unb_var1 )

View File

@@ -71,7 +71,7 @@ void bli_mktrim_unb_var1( obj_t* a )
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname)( \
uplo_t uploa, \
@@ -105,5 +105,5 @@ void PASTEMAC(ch,varname)( \
}
INSERT_GENTFUNC_BASIC( mktrim, mktrim_unb_var1 )
INSERT_GENTFUNC_BASIC0( mktrim_unb_var1 )

View File

@@ -43,17 +43,17 @@
\
void PASTEMAC0(opname)( \
obj_t* x, \
obj_t* absum \
obj_t* norm \
) \
{ \
if ( bli_error_checking_is_enabled() ) \
PASTEMAC(opname,_check)( x, absum ); \
PASTEMAC(opname,_check)( x, norm ); \
\
PASTEMAC0(varname)( x, \
absum ); \
norm ); \
}
GENFRONT( absumm, absumm_unb_var1 )
GENFRONT( norm1m, norm1m_unb_var1 )
//
@@ -64,20 +64,22 @@ GENFRONT( absumm, absumm_unb_var1 )
\
void PASTEMAC(chx,opname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
ctype_x* x, inc_t rs_x, inc_t cs_x, \
ctype_xr* absum \
ctype_xr* norm \
) \
{ \
PASTEMAC(chx,varname)( diagoffx, \
diagx, \
uplox, \
m, \
n, \
x, rs_x, cs_x, \
absum ); \
norm ); \
}
INSERT_GENTFUNCR_BASIC( absumm, absumm_unb_var1 )
INSERT_GENTFUNCR_BASIC( norm1m, norm1m_unb_var1 )

View File

@@ -32,14 +32,14 @@
*/
#include "bli_fnormm_check.h"
#include "bli_fnormm_unb_var1.h"
#include "bli_norm1m_check.h"
#include "bli_norm1m_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_fnormm( obj_t* x,
void bli_norm1m( obj_t* x,
obj_t* norm );
@@ -59,5 +59,5 @@ void PASTEMAC(chx,opname)( \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( fnormm )
INSERT_GENTPROTR_BASIC( norm1m )

View File

@@ -34,8 +34,8 @@
#include "blis.h"
void bli_absumm_check( obj_t* x,
obj_t* absum )
void bli_norm1m_check( obj_t* x,
obj_t* norm )
{
err_t e_val;
@@ -44,7 +44,7 @@ void bli_absumm_check( obj_t* x,
e_val = bli_check_floating_object( x );
bli_check_error_code( e_val );
e_val = bli_check_nonconstant_object( absum );
e_val = bli_check_nonconstant_object( norm );
bli_check_error_code( e_val );
// Check object dimensions.
@@ -52,7 +52,7 @@ void bli_absumm_check( obj_t* x,
e_val = bli_check_matrix_object( x );
bli_check_error_code( e_val );
e_val = bli_check_scalar_object( absum );
e_val = bli_check_scalar_object( norm );
bli_check_error_code( e_val );
}

View File

@@ -32,5 +32,5 @@
*/
void bli_fnormv_check( obj_t* x,
void bli_norm1m_check( obj_t* a,
obj_t* norm );

View File

@@ -0,0 +1,231 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#define FUNCPTR_T norm1m_fp
typedef void (*FUNCPTR_T)(
doff_t diagoffx,
diag_t diagx,
uplo_t uplox,
dim_t m,
dim_t n,
void* x, inc_t rs_x, inc_t cs_x,
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,norm1m_unb_var1);
void bli_norm1m_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
doff_t diagoffx = bli_obj_diag_offset( *x );
uplo_t diagx = bli_obj_diag( *x );
uplo_t uplox = bli_obj_uplo( *x );
dim_t m = bli_obj_length( *x );
dim_t n = bli_obj_width( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
inc_t rs_x = bli_obj_row_stride( *x );
inc_t cs_x = bli_obj_col_stride( *x );
void* buf_norm = bli_obj_buffer_at_off( *norm );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x];
// Invoke the function.
f( diagoffx,
diagx,
uplox,
m,
n,
buf_x, rs_x, cs_x,
buf_norm );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname, kername ) \
\
void PASTEMAC(chx,varname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
void* x, inc_t rs_x, inc_t cs_x, \
void* norm \
) \
{ \
ctype_x* x_cast = x; \
ctype_xr* norm_cast = norm; \
ctype_x* one = PASTEMAC(chx,1); \
ctype_x* x0; \
ctype_x* chi1; \
ctype_x* x2; \
ctype_xr absum_max; \
ctype_xr absum_j; \
ctype_xr abval_chi1; \
uplo_t uplox_eff; \
dim_t n_iter; \
dim_t n_elem, n_elem_max; \
inc_t ldx, incx; \
dim_t j, i; \
dim_t ij0, n_shift; \
\
/* Initialize the maximum absolute column sum to zero. */ \
PASTEMAC(chxr,set0s)( absum_max ); \
\
/* If either dimension is zero, return with absum_max equal to zero. */ \
if ( bli_zero_dim2( m, n ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_max, *norm_cast ); \
return; \
} \
\
/* Set various loop parameters. */ \
bli_set_dims_incs_uplo_1m_noswap( diagoffx, BLIS_NONUNIT_DIAG, \
uplox, m, n, rs_x, cs_x, \
uplox_eff, n_elem_max, n_iter, incx, ldx, \
ij0, n_shift ); \
\
/* If the matrix is zeros, return with absum_max equal to zero. */ \
if ( bli_is_zeros( uplox_eff ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_max, *norm_cast ); \
return; \
} \
\
\
/* Handle dense and upper/lower storage cases separately. */ \
if ( bli_is_dense( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
n_elem = n_elem_max; \
\
x0 = x_cast + (j )*ldx + (0 )*incx; \
\
/* Compute the norm of the current column. */ \
PASTEMAC(chx,kername)( n_elem, \
x0, incx, \
&absum_j ); \
\
/* If absum_j is greater than the previous maximum value,
then save it. */ \
if ( absum_max < absum_j || bli_isnan( absum_j ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_j, absum_max ); \
} \
} \
} \
else \
{ \
if ( bli_is_upper( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
\
x0 = x_cast + (ij0+j )*ldx + (0 )*incx; \
chi1 = x_cast + (ij0+j )*ldx + (n_elem-1)*incx; \
\
/* Compute the norm of the super-diagonal elements. */ \
PASTEMAC(chx,kername)( n_elem - 1, \
x0, incx, \
&absum_j ); \
\
if ( bli_is_unit_diag( diagx ) ) chi1 = one; \
\
/* Handle the diagonal element separately in case it's
unit. */ \
PASTEMAC2(chx,chxr,abval2s)( *chi1, abval_chi1 ); \
PASTEMAC2(chxr,chxr,adds)( abval_chi1, absum_j ); \
\
/* If absum_j is greater than the previous maximum value,
then save it. */ \
if ( absum_max < absum_j || bli_isnan( absum_j ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_j, absum_max ); \
} \
} \
} \
else if ( bli_is_lower( uplox_eff ) ) \
{ \
for ( j = 0; j < n_iter; ++j ) \
{ \
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
n_elem = n_elem_max - i; \
\
chi1 = x_cast + (j )*ldx + (ij0+i )*incx; \
x2 = x_cast + (j )*ldx + (ij0+i+1)*incx; \
\
/* Compute the norm of the sub-diagonal elements. */ \
PASTEMAC(chx,kername)( n_elem - 1, \
x2, incx, \
&absum_j ); \
\
if ( bli_is_unit_diag( diagx ) ) chi1 = one; \
\
/* Handle the diagonal element separately in case it's
unit. */ \
PASTEMAC2(chx,chxr,abval2s)( *chi1, abval_chi1 ); \
PASTEMAC2(chxr,chxr,adds)( abval_chi1, absum_j ); \
\
/* If absum_j is greater than the previous maximum value,
then save it. */ \
if ( absum_max < absum_j || bli_isnan( absum_j ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( absum_j, absum_max ); \
} \
} \
} \
} \
\
/* Store final value of absum_max to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( absum_max, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC( norm1m_unb_var1, norm1v_unb_var1 )

View File

@@ -32,8 +32,8 @@
*/
void bli_absumm_unb_var1( obj_t* x,
obj_t* absum );
void bli_norm1m_unb_var1( obj_t* x,
obj_t* norm );
#undef GENTPROTR
@@ -41,12 +41,13 @@ void bli_absumm_unb_var1( obj_t* x,
\
void PASTEMAC(chx,varname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
void* x, inc_t rs_x, inc_t cs_x, \
void* absum \
void* norm \
);
INSERT_GENTPROTR_BASIC( absumm_unb_var1 )
INSERT_GENTPROTR_BASIC( norm1m_unb_var1 )

View File

@@ -0,0 +1,77 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
//
// Define object-based interface.
//
#undef GENFRONT
#define GENFRONT( opname, varname ) \
\
void PASTEMAC0(opname)( \
obj_t* x, \
obj_t* norm \
) \
{ \
if ( bli_error_checking_is_enabled() ) \
PASTEMAC(opname,_check)( x, norm ); \
\
PASTEMAC0(varname)( x, \
norm ); \
}
GENFRONT( norm1v, norm1v_unb_var1 )
//
// Define BLAS-like interfaces.
//
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
\
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* norm \
) \
{ \
PASTEMAC(chx,varname)( n, \
x, incx, \
norm ); \
}
INSERT_GENTFUNCR_BASIC( norm1v, norm1v_unb_var1 )

View File

@@ -0,0 +1,59 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bli_norm1v_check.h"
#include "bli_norm1v_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_norm1v( obj_t* x,
obj_t* norm );
//
// Prototype BLAS-like interfaces.
//
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
\
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( norm1v )

View File

@@ -0,0 +1,58 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
void bli_norm1v_check( obj_t* x,
obj_t* norm )
{
err_t e_val;
// Check object datatypes.
e_val = bli_check_floating_object( x );
bli_check_error_code( e_val );
e_val = bli_check_nonconstant_object( norm );
bli_check_error_code( e_val );
// Check object dimensions.
e_val = bli_check_vector_object( x );
bli_check_error_code( e_val );
e_val = bli_check_scalar_object( norm );
bli_check_error_code( e_val );
}

View File

@@ -32,5 +32,5 @@
*/
void bli_fnormm_check( obj_t* x,
void bli_norm1v_check( obj_t* x,
obj_t* norm );

View File

@@ -0,0 +1,108 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#define FUNCPTR_T norm1v_fp
typedef void (*FUNCPTR_T)(
dim_t n,
void* x, inc_t incx,
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,norm1v_unb_var1);
void bli_norm1v_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
dim_t n = bli_obj_vector_dim( *x );
inc_t inc_x = bli_obj_vector_inc( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
void* buf_norm = bli_obj_buffer_at_off( *norm );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x];
// Invoke the function.
f( n,
buf_x, inc_x,
buf_norm );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* norm \
) \
{ \
ctype_x* x_cast = x; \
ctype_xr* norm_cast = norm; \
ctype_x* chi1; \
ctype_xr abs_chi1; \
ctype_xr absum; \
dim_t i; \
\
/* Initialize the absolute sum accumulator to zero. */ \
PASTEMAC(chxr,set0s)( absum ); \
\
for ( i = 0; i < n; ++i ) \
{ \
chi1 = x_cast + (i )*incx; \
\
/* Compute the absolute value (or complex magnitude) of chi1. */ \
PASTEMAC2(chx,chxr,abval2s)( *chi1, abs_chi1 ); \
\
/* Accumulate the absolute value of chi1 into absum. */ \
PASTEMAC2(chxr,chxr,adds)( abs_chi1, absum ); \
} \
\
/* Store final value of absum to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( absum, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC0( norm1v_unb_var1 )

View File

@@ -0,0 +1,49 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_norm1v_unb_var1( obj_t* x,
obj_t* norm );
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* norm \
);
INSERT_GENTPROTR_BASIC( norm1v_unb_var1 )

View File

@@ -38,13 +38,13 @@
//
// Define object-based interface.
//
void bli_fnormm( obj_t* x,
void bli_normfm( obj_t* x,
obj_t* norm )
{
if ( bli_error_checking_is_enabled() )
bli_fnormm_check( x, norm );
bli_normfm_check( x, norm );
bli_fnormm_unb_var1( x, norm );
bli_normfm_unb_var1( x, norm );
}
@@ -73,5 +73,5 @@ void PASTEMAC(chx,opname)( \
norm ); \
}
INSERT_GENTFUNCR_BASIC( fnormm, fnormm_unb_var1 )
INSERT_GENTFUNCR_BASIC( normfm, normfm_unb_var1 )

View File

@@ -32,15 +32,15 @@
*/
#include "bli_absumm_check.h"
#include "bli_absumm_unb_var1.h"
#include "bli_normfm_check.h"
#include "bli_normfm_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_absumm( obj_t* x,
obj_t* absum );
void bli_normfm( obj_t* x,
obj_t* norm );
//
@@ -51,12 +51,13 @@ void bli_absumm( obj_t* x,
\
void PASTEMAC(chx,opname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
ctype_x* x, inc_t rs_x, inc_t cs_x, \
ctype_xr* absum \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( absumm )
INSERT_GENTPROTR_BASIC( normfm )

View File

@@ -34,7 +34,7 @@
#include "blis.h"
void bli_fnormm_check( obj_t* x,
void bli_normfm_check( obj_t* x,
obj_t* norm )
{
err_t e_val;

View File

@@ -0,0 +1,36 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normfm_check( obj_t* x,
obj_t* norm );

View File

@@ -34,7 +34,7 @@
#include "blis.h"
#define FUNCPTR_T fnormm_fp
#define FUNCPTR_T normfm_fp
typedef void (*FUNCPTR_T)(
doff_t diagoffx,
@@ -46,27 +46,13 @@ typedef void (*FUNCPTR_T)(
void* norm
);
/*
// If some mixed datatype functions will not be compiled, we initialize
// the corresponding elements of the function array to NULL.
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
static FUNCPTR_T GENARRAY2_ALL(ftypes,fnormm_unb_var1);
#else
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
static FUNCPTR_T GENARRAY2_EXT(ftypes,fnormm_unb_var1);
#else
static FUNCPTR_T GENARRAY2_MIN(ftypes,fnormm_unb_var1);
#endif
#endif
*/
static FUNCPTR_T GENARRAY(ftypes,fnormm_unb_var1);
static FUNCPTR_T GENARRAY(ftypes,normfm_unb_var1);
void bli_fnormm_unb_var1( obj_t* x,
void bli_normfm_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
//num_t dt_norm = bli_obj_datatype( *norm );
doff_t diagoffx = bli_obj_diag_offset( *x );
diag_t diagx = bli_obj_diag( *x );
@@ -85,7 +71,7 @@ void bli_fnormm_unb_var1( obj_t* x,
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x]; //[dt_norm];
f = ftypes[dt_x];
// Invoke the function.
f( diagoffx,
@@ -117,9 +103,8 @@ void PASTEMAC(chx,varname)( \
ctype_xr* one_r = PASTEMAC(chxr,1); \
ctype_xr* zero_r = PASTEMAC(chxr,0); \
ctype_x* x0; \
ctype_x* x1; \
ctype_x* x2; \
ctype_x* chi1; \
ctype_x* x2; \
ctype_xr scale; \
ctype_xr sumsq; \
ctype_xr sqrt_sumsq; \
@@ -162,10 +147,11 @@ void PASTEMAC(chx,varname)( \
{ \
n_elem = n_elem_max; \
\
x1 = x_cast + (j )*ldx + (0 )*incx; \
x0 = x_cast + (j )*ldx + (0 )*incx; \
\
/* Compute the norm of the current column. */ \
PASTEMAC(chx,kername)( n_elem, \
x1, incx, \
x0, incx, \
&scale, \
&sumsq ); \
} \
@@ -178,23 +164,23 @@ void PASTEMAC(chx,varname)( \
{ \
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
\
x1 = x_cast + (ij0+j )*ldx + (0 )*incx; \
x0 = x1; \
chi1 = one; \
x0 = x_cast + (ij0+j )*ldx + (0 )*incx; \
chi1 = x_cast + (ij0+j )*ldx + (n_elem-1)*incx; \
\
if ( bli_is_unit_diag( diagx ) ) \
{ \
PASTEMAC(chx,kername)( 1, \
chi1, incx, \
&scale, \
&sumsq ); \
--n_elem; \
} \
\
PASTEMAC(chx,kername)( n_elem, \
/* Sum the squares of the super-diagonal elements. */ \
PASTEMAC(chx,kername)( n_elem - 1, \
x0, incx, \
&scale, \
&sumsq ); \
\
if ( bli_is_unit_diag( diagx ) ) chi1 = one; \
\
/* Handle the diagonal element separately in case it's
unit. */ \
PASTEMAC(chx,kername)( 1, \
chi1, incx, \
&scale, \
&sumsq ); \
} \
} \
else if ( bli_is_lower( uplox_eff ) ) \
@@ -204,31 +190,34 @@ void PASTEMAC(chx,varname)( \
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
n_elem = n_elem_max - i; \
\
x1 = x_cast + (j )*ldx + (ij0+i )*incx; \
x2 = x1 + incx; \
chi1 = one; \
chi1 = x_cast + (j )*ldx + (ij0+i )*incx; \
x2 = x_cast + (j )*ldx + (ij0+i+1)*incx; \
\
if ( bli_is_unit_diag( diagx ) ) \
{ \
PASTEMAC(chx,kername)( 1, \
chi1, incx, \
&scale, \
&sumsq ); \
--n_elem; \
} \
\
PASTEMAC(chx,kername)( n_elem, \
/* Sum the squares of the sub-diagonal elements. */ \
PASTEMAC(chx,kername)( n_elem - 1, \
x2, incx, \
&scale, \
&sumsq ); \
\
if ( bli_is_unit_diag( diagx ) ) chi1 = one; \
\
/* Handle the diagonal element separately in case it's
unit. */ \
PASTEMAC(chx,kername)( 1, \
chi1, incx, \
&scale, \
&sumsq ); \
} \
} \
} \
\
/* Compute: norm = scale * sqrt( sumsq ) */ \
PASTEMAC2(chxr,chxr,sqrt2s)( sumsq, sqrt_sumsq ); \
PASTEMAC3(chxr,chxr,chxr,scal2s)( scale, sqrt_sumsq, *norm_cast ); \
PASTEMAC2(chxr,chxr,scals)( scale, sqrt_sumsq ); \
\
/* Store the final value to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( sqrt_sumsq, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC( fnormm_unb_var1, sumsqv_unb_var1 )
INSERT_GENTFUNCR_BASIC( normfm_unb_var1, sumsqv_unb_var1 )

View File

@@ -32,7 +32,7 @@
*/
void bli_fnormm_unb_var1( obj_t* x, obj_t* norm );
void bli_normfm_unb_var1( obj_t* x, obj_t* norm );
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
@@ -47,4 +47,4 @@ void PASTEMAC(chx,varname)( \
void* norm \
);
INSERT_GENTPROTR_BASIC( fnormm_unb_var1 )
INSERT_GENTPROTR_BASIC( normfm_unb_var1 )

View File

@@ -38,13 +38,13 @@
//
// Define object-based interface.
//
void bli_fnormv( obj_t* x,
void bli_normfv( obj_t* x,
obj_t* norm )
{
if ( bli_error_checking_is_enabled() )
bli_fnormv_check( x, norm );
bli_normfv_check( x, norm );
bli_fnormv_unb_var1( x, norm );
bli_normfv_unb_var1( x, norm );
}
@@ -65,5 +65,5 @@ void PASTEMAC(chx,opname)( \
norm ); \
}
INSERT_GENTFUNCR_BASIC( fnormv, fnormv_unb_var1 )
INSERT_GENTFUNCR_BASIC( normfv, normfv_unb_var1 )

View File

@@ -32,14 +32,14 @@
*/
#include "bli_fnormv_check.h"
#include "bli_fnormv_unb_var1.h"
#include "bli_normfv_check.h"
#include "bli_normfv_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_fnormv( obj_t* x,
void bli_normfv( obj_t* x,
obj_t* norm );
@@ -55,5 +55,5 @@ void PASTEMAC(chx,opname)( \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( fnormv )
INSERT_GENTPROTR_BASIC( normfv )

View File

@@ -34,7 +34,7 @@
#include "blis.h"
void bli_fnormv_check( obj_t* x,
void bli_normfv_check( obj_t* x,
obj_t* norm )
{
err_t e_val;

View File

@@ -0,0 +1,36 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normfv_check( obj_t* x,
obj_t* norm );

View File

@@ -34,7 +34,7 @@
#include "blis.h"
#define FUNCPTR_T fnormv_fp
#define FUNCPTR_T normfv_fp
typedef void (*FUNCPTR_T)(
dim_t m,
@@ -42,10 +42,10 @@ typedef void (*FUNCPTR_T)(
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,fnormv_unb_var1);
static FUNCPTR_T GENARRAY(ftypes,normfv_unb_var1);
void bli_fnormv_unb_var1( obj_t* x,
void bli_normfv_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
@@ -106,8 +106,11 @@ void PASTEMAC(chx,varname)( \
\
/* Compute: norm = scale * sqrt( sumsq ) */ \
PASTEMAC2(chxr,chxr,sqrt2s)( sumsq, sqrt_sumsq ); \
PASTEMAC3(chxr,chxr,chxr,scal2s)( scale, sqrt_sumsq, *norm_cast ); \
PASTEMAC2(chxr,chxr,scals)( scale, sqrt_sumsq ); \
\
/* Store the final value to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( sqrt_sumsq, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC( fnormv_unb_var1, sumsqv_unb_var1 )
INSERT_GENTFUNCR_BASIC( normfv_unb_var1, sumsqv_unb_var1 )

View File

@@ -32,7 +32,7 @@
*/
void bli_fnormv_unb_var1( obj_t* x, obj_t* norm );
void bli_normfv_unb_var1( obj_t* x, obj_t* norm );
#undef GENTPROTR
@@ -44,5 +44,5 @@ void PASTEMAC(chx,varname)( \
void* norm \
);
INSERT_GENTPROTR_BASIC( fnormv_unb_var1 )
INSERT_GENTPROTR_BASIC( normfv_unb_var1 )

View File

@@ -0,0 +1,85 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
//
// Define object-based interface.
//
#undef GENFRONT
#define GENFRONT( opname, varname ) \
\
void PASTEMAC0(opname)( \
obj_t* x, \
obj_t* norm \
) \
{ \
if ( bli_error_checking_is_enabled() ) \
PASTEMAC(opname,_check)( x, norm ); \
\
PASTEMAC0(varname)( x, \
norm ); \
}
GENFRONT( normim, normim_unb_var1 )
//
// Define BLAS-like interfaces.
//
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
\
void PASTEMAC(chx,opname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
ctype_x* x, inc_t rs_x, inc_t cs_x, \
ctype_xr* norm \
) \
{ \
PASTEMAC(chx,varname)( diagoffx, \
diagx, \
uplox, \
m, \
n, \
x, rs_x, cs_x, \
norm ); \
}
INSERT_GENTFUNCR_BASIC( normim, normim_unb_var1 )

View File

@@ -0,0 +1,63 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bli_normim_check.h"
#include "bli_normim_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_normim( obj_t* x,
obj_t* norm );
//
// Prototype BLAS-like interfaces.
//
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
\
void PASTEMAC(chx,opname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
ctype_x* x, inc_t rs_x, inc_t cs_x, \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( normim )

View File

@@ -0,0 +1,58 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
void bli_normim_check( obj_t* x,
obj_t* norm )
{
err_t e_val;
// Check object datatypes.
e_val = bli_check_floating_object( x );
bli_check_error_code( e_val );
e_val = bli_check_nonconstant_object( norm );
bli_check_error_code( e_val );
// Check object dimensions.
e_val = bli_check_matrix_object( x );
bli_check_error_code( e_val );
e_val = bli_check_scalar_object( norm );
bli_check_error_code( e_val );
}

View File

@@ -0,0 +1,36 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normim_check( obj_t* a,
obj_t* norm );

View File

@@ -0,0 +1,120 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#define FUNCPTR_T normim_fp
typedef void (*FUNCPTR_T)(
doff_t diagoffx,
diag_t diagx,
uplo_t uplox,
dim_t m,
dim_t n,
void* x, inc_t rs_x, inc_t cs_x,
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,normim_unb_var1);
void bli_normim_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
doff_t diagoffx = bli_obj_diag_offset( *x );
uplo_t diagx = bli_obj_diag( *x );
uplo_t uplox = bli_obj_uplo( *x );
dim_t m = bli_obj_length( *x );
dim_t n = bli_obj_width( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
inc_t rs_x = bli_obj_row_stride( *x );
inc_t cs_x = bli_obj_col_stride( *x );
void* buf_norm = bli_obj_buffer_at_off( *norm );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x];
// Invoke the function.
f( diagoffx,
diagx,
uplox,
m,
n,
buf_x, rs_x, cs_x,
buf_norm );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname, kername ) \
\
void PASTEMAC(chx,varname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
void* x, inc_t rs_x, inc_t cs_x, \
void* norm \
) \
{ \
/* Induce a transposition so that rows become columns. */ \
bli_swap_dims( m, n ); \
bli_swap_incs( rs_x, cs_x ); \
bli_toggle_uplo( uplox ); \
bli_negate_diag_offset( diagoffx ); \
\
/* Now we can simply compute the 1-norm of this transposed matrix,
which will be equivalent to the infinity-norm of the original
matrix. */ \
PASTEMAC(chx,kername)( diagoffx, \
diagx, \
uplox, \
m, \
n, \
x, rs_x, cs_x, \
norm ); \
}
INSERT_GENTFUNCR_BASIC( normim_unb_var1, norm1m_unb_var1 )

View File

@@ -0,0 +1,53 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normim_unb_var1( obj_t* x,
obj_t* norm );
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
doff_t diagoffx, \
diag_t diagx, \
uplo_t uplox, \
dim_t m, \
dim_t n, \
void* x, inc_t rs_x, inc_t cs_x, \
void* norm \
);
INSERT_GENTPROTR_BASIC( normim_unb_var1 )

View File

@@ -0,0 +1,77 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
//
// Define object-based interface.
//
#undef GENFRONT
#define GENFRONT( opname, varname ) \
\
void PASTEMAC0(opname)( \
obj_t* x, \
obj_t* norm \
) \
{ \
if ( bli_error_checking_is_enabled() ) \
PASTEMAC(opname,_check)( x, norm ); \
\
PASTEMAC0(varname)( x, \
norm ); \
}
GENFRONT( normiv, normiv_unb_var1 )
//
// Define BLAS-like interfaces.
//
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, opname, varname ) \
\
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* norm \
) \
{ \
PASTEMAC(chx,varname)( n, \
x, incx, \
norm ); \
}
INSERT_GENTFUNCR_BASIC( normiv, normiv_unb_var1 )

View File

@@ -0,0 +1,59 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bli_normiv_check.h"
#include "bli_normiv_unb_var1.h"
//
// Prototype object-based interface.
//
void bli_normiv( obj_t* x,
obj_t* norm );
//
// Prototype BLAS-like interfaces.
//
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, opname ) \
\
void PASTEMAC(chx,opname)( \
dim_t n, \
ctype_x* x, inc_t incx, \
ctype_xr* norm \
);
INSERT_GENTPROTR_BASIC( normiv )

View File

@@ -0,0 +1,58 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
void bli_normiv_check( obj_t* x,
obj_t* norm )
{
err_t e_val;
// Check object datatypes.
e_val = bli_check_floating_object( x );
bli_check_error_code( e_val );
e_val = bli_check_nonconstant_object( norm );
bli_check_error_code( e_val );
// Check object dimensions.
e_val = bli_check_vector_object( x );
bli_check_error_code( e_val );
e_val = bli_check_scalar_object( norm );
bli_check_error_code( e_val );
}

View File

@@ -0,0 +1,36 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normiv_check( obj_t* x,
obj_t* norm );

View File

@@ -0,0 +1,115 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#define FUNCPTR_T normiv_fp
typedef void (*FUNCPTR_T)(
dim_t n,
void* x, inc_t incx,
void* norm
);
static FUNCPTR_T GENARRAY(ftypes,normiv_unb_var1);
void bli_normiv_unb_var1( obj_t* x,
obj_t* norm )
{
num_t dt_x = bli_obj_datatype( *x );
dim_t n = bli_obj_vector_dim( *x );
inc_t inc_x = bli_obj_vector_inc( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
void* buf_norm = bli_obj_buffer_at_off( *norm );
FUNCPTR_T f;
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_x];
// Invoke the function.
f( n,
buf_x, inc_x,
buf_norm );
}
#undef GENTFUNCR
#define GENTFUNCR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* norm \
) \
{ \
ctype_x* x_cast = x; \
ctype_xr* norm_cast = norm; \
ctype_x* chi1; \
ctype_xr abs_chi1; \
ctype_xr abs_chi1_max; \
dim_t i; \
\
/* Initialize the maximum absolute value to zero. */ \
PASTEMAC(chxr,set0s)( abs_chi1_max ); \
\
for ( i = 0; i < n; ++i ) \
{ \
chi1 = x_cast + (i )*incx; \
\
/* Compute the absolute value (or complex magnitude) of chi1. */ \
PASTEMAC2(chx,chxr,abval2s)( *chi1, abs_chi1 ); \
\
/* If the absolute value of the current element exceeds that of
the previous largest, save it and its index. If NaN is
encountered, then treat it the same as if it were a valid
value that was smaller than any previously seen. This
behavior mimics that of LAPACK's ?lange(). */ \
if ( abs_chi1_max < abs_chi1 || bli_isnan( abs_chi1 ) ) \
{ \
PASTEMAC2(chxr,chxr,copys)( abs_chi1, abs_chi1_max ); \
} \
} \
\
/* Store the final value to the output variable. */ \
PASTEMAC2(chxr,chxr,copys)( abs_chi1_max, *norm_cast ); \
}
INSERT_GENTFUNCR_BASIC0( normiv_unb_var1 )

View File

@@ -0,0 +1,49 @@
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_normiv_unb_var1( obj_t* x,
obj_t* norm );
#undef GENTPROTR
#define GENTPROTR( ctype_x, ctype_xr, chx, chxr, varname ) \
\
void PASTEMAC(chx,varname)( \
dim_t n, \
void* x, inc_t incx, \
void* norm \
);
INSERT_GENTPROTR_BASIC( normiv_unb_var1 )

View File

@@ -77,7 +77,7 @@ void bli_randm_unb_var1( obj_t* x )
#undef GENTFUNC
#define GENTFUNC( ctype, ch, opname, varname ) \
#define GENTFUNC( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname)( \
doff_t diagoffx, \
@@ -187,5 +187,5 @@ void PASTEMAC(ch,varname)( \
} \
}
INSERT_GENTFUNC_BASIC( randm, randm_unb_var1 )
INSERT_GENTFUNC_BASIC0( randm_unb_var1 )

Some files were not shown because too many files have changed in this diff Show More