mirror of
https://github.com/amd/blis.git
synced 2026-04-19 23:28:52 +00:00
Minor changes to lower levels of scalm and setm.
Details: - Removed diagx parameter from lower-level interfaces of scalm. - Modified scalm_basic_check() to expect an object with a nonunit diagonal. - Changed setm_unb_var1() so that having an implicit unit diagonal results in only the strictly lower or upper triangle of the matrix being modified.
This commit is contained in:
@@ -62,7 +62,6 @@ void bl2_scalm( obj_t* beta,
|
||||
void PASTEMAC(ch,opname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
@@ -72,7 +71,6 @@ void PASTEMAC(ch,opname)( \
|
||||
{ \
|
||||
PASTEMAC2(ch,ch,varname)( conjbeta, \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
@@ -92,7 +90,6 @@ INSERT_GENTFUNC_BASIC( scalm, scalm_unb_var1 )
|
||||
void PASTEMAC2(chb,chx,opname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
@@ -102,7 +99,6 @@ void PASTEMAC2(chb,chx,opname)( \
|
||||
{ \
|
||||
PASTEMAC2(chb,chx,varname)( conjbeta, \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
|
||||
@@ -55,7 +55,6 @@ void bl2_scalm( obj_t* beta,
|
||||
void PASTEMAC(ch,opname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
@@ -75,7 +74,6 @@ INSERT_GENTPROT_BASIC( scalm )
|
||||
void PASTEMAC2(chb,chx,opname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
|
||||
@@ -51,6 +51,11 @@ void bl2_scalm_basic_check( obj_t* beta,
|
||||
|
||||
e_val = bl2_check_scalar_object( beta );
|
||||
bl2_check_error_code( e_val );
|
||||
|
||||
// Check object properties.
|
||||
|
||||
e_val = bl2_check_nonunit_diag( x );
|
||||
bl2_check_error_code( e_val );
|
||||
}
|
||||
|
||||
void bl2_scalm_check( obj_t* beta,
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
typedef void (*FUNCPTR_T)(
|
||||
conj_t conjbeta,
|
||||
doff_t diagoffx,
|
||||
diag_t diagx,
|
||||
uplo_t uplox,
|
||||
dim_t m,
|
||||
dim_t n,
|
||||
@@ -67,7 +66,6 @@ void bl2_scalm_unb_var1( obj_t* beta,
|
||||
|
||||
conj_t conjbeta = bl2_obj_conj_status( *beta );
|
||||
doff_t diagoffx = bl2_obj_diag_offset( *x );
|
||||
diag_t diagx = bl2_obj_diag( *x );
|
||||
uplo_t uplox = bl2_obj_uplo( *x );
|
||||
|
||||
dim_t m = bl2_obj_length( *x );
|
||||
@@ -94,7 +92,6 @@ void bl2_scalm_unb_var1( obj_t* beta,
|
||||
// Invoke the function.
|
||||
f( conjbeta,
|
||||
diagoffx,
|
||||
diagx,
|
||||
uplox,
|
||||
m,
|
||||
n,
|
||||
@@ -109,7 +106,6 @@ void bl2_scalm_unb_var1( obj_t* beta,
|
||||
void PASTEMAC2(chb,chx,varname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
@@ -132,7 +128,8 @@ void PASTEMAC2(chb,chx,varname)( \
|
||||
/* If beta is unit, the entire operation is a no-op. */ \
|
||||
if ( PASTEMAC(chb,eq1)( *beta_cast ) ) return; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
/* Set various loop parameters. Here, we assume diagx is BLIS_NONUNIT_DIAG
|
||||
because in _check() we disallow scalm on unit diagonal matrices. */ \
|
||||
bl2_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, \
|
||||
|
||||
@@ -42,7 +42,6 @@ void bl2_scalm_unb_var1( obj_t* beta,
|
||||
void PASTEMAC2(chb,chx,varname)( \
|
||||
conj_t conjbeta, \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
|
||||
@@ -128,9 +128,8 @@ void PASTEMAC2(chb,chx,varname)( \
|
||||
/* When the diagonal of x is implicitly unit, we update ONLY the stored
|
||||
region strictly above or below the diagonal. */ \
|
||||
\
|
||||
/* Set various loop parameters. Here, we pretend that diagx is equal to
|
||||
BLIS_NONUNIT_DIAG because the actual value does not affect us here. */ \
|
||||
bl2_set_dims_incs_uplo_1m( diagoffx, BLIS_NONUNIT_DIAG, \
|
||||
/* Set various loop parameters. */ \
|
||||
bl2_set_dims_incs_uplo_1m( diagoffx, diagx, \
|
||||
uplox, m, n, rs_x, cs_x, \
|
||||
uplox_eff, n_elem_max, n_iter, incx, ldx, \
|
||||
ij0, n_shift ); \
|
||||
|
||||
@@ -128,6 +128,16 @@ err_t bl2_check_valid_diag( diag_t diag )
|
||||
return e_val;
|
||||
}
|
||||
|
||||
err_t bl2_check_nonunit_diag( obj_t* a )
|
||||
{
|
||||
err_t e_val = BLIS_SUCCESS;
|
||||
|
||||
if ( !bl2_obj_has_nonunit_diag( *a ) )
|
||||
e_val = BLIS_EXPECTED_NONUNIT_DIAG;
|
||||
|
||||
return e_val;
|
||||
}
|
||||
|
||||
// -- Datatype-related checks --------------------------------------------------
|
||||
|
||||
err_t bl2_check_valid_datatype( num_t dt )
|
||||
|
||||
@@ -44,6 +44,7 @@ err_t bl2_check_valid_side( side_t side );
|
||||
err_t bl2_check_valid_uplo( uplo_t uplo );
|
||||
err_t bl2_check_valid_trans( trans_t trans );
|
||||
err_t bl2_check_valid_diag( diag_t diag );
|
||||
err_t bl2_check_nonunit_diag( obj_t* a );
|
||||
|
||||
err_t bl2_check_valid_datatype( num_t dt );
|
||||
err_t bl2_check_object_valid_datatype( obj_t* a );
|
||||
|
||||
@@ -107,6 +107,8 @@ void bl2_error_msgs_init( void )
|
||||
"Invalid conj parameter value." );
|
||||
sprintf( bl2_error_string_for_code(BLIS_INVALID_DIAG),
|
||||
"Invalid diag parameter value." );
|
||||
sprintf( bl2_error_string_for_code(BLIS_EXPECTED_NONUNIT_DIAG),
|
||||
"Expected object with non-unit diagonal." );
|
||||
|
||||
sprintf( bl2_error_string_for_code(BLIS_INVALID_DATATYPE),
|
||||
"Invalid datatype value." );
|
||||
|
||||
@@ -452,6 +452,7 @@ typedef enum
|
||||
BLIS_INVALID_CONJ = ( -23),
|
||||
BLIS_INVALID_DIAG = ( -24),
|
||||
BLIS_INVALID_MACHVAL = ( -25),
|
||||
BLIS_EXPECTED_NONUNIT_DIAG = ( -26),
|
||||
|
||||
// Datatype-specific errors
|
||||
BLIS_INVALID_DATATYPE = ( -30),
|
||||
|
||||
Reference in New Issue
Block a user