|
libflame
revision_anchor
|
Functions | |
| void | bli_sherk (uplo_t uplo, trans_t trans, int m, int k, float *alpha, float *a, int a_rs, int a_cs, float *beta, float *c, int c_rs, int c_cs) |
| void | bli_dherk (uplo_t uplo, trans_t trans, int m, int k, double *alpha, double *a, int a_rs, int a_cs, double *beta, double *c, int c_rs, int c_cs) |
| void | bli_cherk (uplo_t uplo, trans_t trans, int m, int k, float *alpha, scomplex *a, int a_rs, int a_cs, float *beta, scomplex *c, int c_rs, int c_cs) |
| void | bli_zherk (uplo_t uplo, trans_t trans, int m, int k, double *alpha, dcomplex *a, int a_rs, int a_cs, double *beta, dcomplex *c, int c_rs, int c_cs) |
| void | bli_cherk_blas (uplo_t uplo, trans_t trans, int m, int k, float *alpha, scomplex *a, int lda, float *beta, scomplex *c, int ldc) |
| void | bli_zherk_blas (uplo_t uplo, trans_t trans, int m, int k, double *alpha, dcomplex *a, int lda, double *beta, dcomplex *c, int ldc) |
| void bli_cherk | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| float * | alpha, | ||
| scomplex * | a, | ||
| int | a_rs, | ||
| int | a_cs, | ||
| float * | beta, | ||
| scomplex * | c, | ||
| int | c_rs, | ||
| int | c_cs | ||
| ) |
References bli_c1(), bli_callocm(), bli_caxpymrt(), bli_ccreate_contigmr(), bli_ccreate_contigmt(), bli_cfree(), bli_cfree_contigm(), bli_cfree_saved_contigmr(), bli_cherk_blas(), bli_csscalmr(), bli_is_col_storage(), bli_s0(), bli_zero_dim2(), and BLIS_CONJ_NO_TRANSPOSE.
Referenced by FLA_Herk_external(), and FLA_UDdate_UT_opc_var1().
{
uplo_t uplo_save = uplo;
int m_save = m;
scomplex* a_save = a;
scomplex* c_save = c;
int a_rs_save = a_rs;
int a_cs_save = a_cs;
int c_rs_save = c_rs;
int c_cs_save = c_cs;
float zero_r = bli_s0();
scomplex one = bli_c1();
scomplex* c_conj;
int lda, inca;
int ldc, incc;
int ldc_conj, incc_conj;
int herk_needs_conj = FALSE;
// Return early if possible.
if ( bli_zero_dim2( m, k ) ) return;
// If necessary, allocate, initialize, and use a temporary contiguous
// copy of each matrix rather than the original matrices.
bli_ccreate_contigmt( trans,
m,
k,
a_save, a_rs_save, a_cs_save,
&a, &a_rs, &a_cs );
bli_ccreate_contigmr( uplo,
m,
m,
c_save, c_rs_save, c_cs_save,
&c, &c_rs, &c_cs );
// Initialize with values assuming column-major storage.
lda = a_cs;
inca = a_rs;
ldc = c_cs;
incc = c_rs;
// Adjust the parameters based on the storage of each matrix.
if ( bli_is_col_storage( c_rs, c_cs ) )
{
if ( bli_is_col_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_c ) += A_c * A_c'
// effective operation: uplo( C_c ) += A_c * A_c'
}
else // if ( bli_is_row_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_c ) += A_r * A_r'
// effective operation: uplo( C_c ) += conj( A_c' * A_c )
bli_swap_ints( lda, inca );
bli_toggle_conjtrans( trans );
herk_needs_conj = TRUE;
}
}
else // if ( bli_is_row_storage( c_rs, c_cs ) )
{
if ( bli_is_col_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_r ) += A_c * A_c'
// effective operation: ~uplo( C_c ) += conj( A_c * A_c' )
bli_swap_ints( ldc, incc );
bli_toggle_uplo( uplo );
herk_needs_conj = TRUE;
}
else // if ( bli_is_row_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_r ) += A_r * A_r'
// effective operation: ~uplo( C_c ) += A_c' * A_c
bli_swap_ints( ldc, incc );
bli_swap_ints( lda, inca );
bli_toggle_uplo( uplo );
bli_toggle_conjtrans( trans );
}
}
// There are two cases where we need to perform the rank-k product and
// then axpy the result into C with a conjugation. We handle those two
// cases here.
if ( herk_needs_conj )
{
// We need a temporary matrix for holding the rank-k product.
c_conj = bli_callocm( m, m );
ldc_conj = m;
incc_conj = 1;
// Compute the rank-k product.
bli_cherk_blas( uplo,
trans,
m,
k,
alpha,
a, lda,
&zero_r,
c_conj, ldc_conj );
// Scale C by beta.
bli_csscalmr( uplo,
m,
m,
beta,
c, incc, ldc );
// And finally, accumulate the rank-k product in C_conj into C
// with a conjugation.
bli_caxpymrt( uplo,
BLIS_CONJ_NO_TRANSPOSE,
m,
m,
&one,
c_conj, incc_conj, ldc_conj,
c, incc, ldc );
// Free the temporary matrix for C.
bli_cfree( c_conj );
}
else
{
bli_cherk_blas( uplo,
trans,
m,
k,
alpha,
a, lda,
beta,
c, ldc );
}
// Free any temporary contiguous matrices, copying the result back to
// the original matrix.
bli_cfree_contigm( a_save, a_rs_save, a_cs_save,
&a, &a_rs, &a_cs );
bli_cfree_saved_contigmr( uplo_save,
m_save,
m_save,
c_save, c_rs_save, c_cs_save,
&c, &c_rs, &c_cs );
}
| void bli_cherk_blas | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| float * | alpha, | ||
| scomplex * | a, | ||
| int | lda, | ||
| float * | beta, | ||
| scomplex * | c, | ||
| int | ldc | ||
| ) |
References bli_param_map_to_netlib_trans(), bli_param_map_to_netlib_uplo(), cblas_cherk(), CblasColMajor, and F77_cherk().
Referenced by bli_cherk().
{
#ifdef BLIS_ENABLE_CBLAS_INTERFACES
enum CBLAS_ORDER cblas_order = CblasColMajor;
enum CBLAS_UPLO cblas_uplo;
enum CBLAS_TRANSPOSE cblas_trans;
bli_param_map_to_netlib_uplo( uplo, &cblas_uplo );
bli_param_map_to_netlib_trans( trans, &cblas_trans );
cblas_cherk( cblas_order,
cblas_uplo,
cblas_trans,
m,
k,
*alpha,
a, lda,
*beta,
c, ldc );
#else
char blas_uplo;
char blas_trans;
bli_param_map_to_netlib_uplo( uplo, &blas_uplo );
bli_param_map_to_netlib_trans( trans, &blas_trans );
F77_cherk( &blas_uplo,
&blas_trans,
&m,
&k,
alpha,
a, &lda,
beta,
c, &ldc );
#endif
}
| void bli_dherk | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| double * | alpha, | ||
| double * | a, | ||
| int | a_rs, | ||
| int | a_cs, | ||
| double * | beta, | ||
| double * | c, | ||
| int | c_rs, | ||
| int | c_cs | ||
| ) |
References bli_dsyrk().
{
bli_dsyrk( uplo,
trans,
m,
k,
alpha,
a, a_rs, a_cs,
beta,
c, c_rs, c_cs );
}
| void bli_sherk | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| float * | alpha, | ||
| float * | a, | ||
| int | a_rs, | ||
| int | a_cs, | ||
| float * | beta, | ||
| float * | c, | ||
| int | c_rs, | ||
| int | c_cs | ||
| ) |
References bli_ssyrk().
{
bli_ssyrk( uplo,
trans,
m,
k,
alpha,
a, a_rs, a_cs,
beta,
c, c_rs, c_cs );
}
| void bli_zherk | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| double * | alpha, | ||
| dcomplex * | a, | ||
| int | a_rs, | ||
| int | a_cs, | ||
| double * | beta, | ||
| dcomplex * | c, | ||
| int | c_rs, | ||
| int | c_cs | ||
| ) |
References bli_d0(), bli_is_col_storage(), bli_z1(), bli_zallocm(), bli_zaxpymrt(), bli_zcreate_contigmr(), bli_zcreate_contigmt(), bli_zdscalmr(), bli_zero_dim2(), bli_zfree(), bli_zfree_contigm(), bli_zfree_saved_contigmr(), bli_zherk_blas(), and BLIS_CONJ_NO_TRANSPOSE.
Referenced by FLA_Herk_external(), and FLA_UDdate_UT_opz_var1().
{
uplo_t uplo_save = uplo;
int m_save = m;
dcomplex* a_save = a;
dcomplex* c_save = c;
int a_rs_save = a_rs;
int a_cs_save = a_cs;
int c_rs_save = c_rs;
int c_cs_save = c_cs;
double zero_r = bli_d0();
dcomplex one = bli_z1();
dcomplex* c_conj;
int lda, inca;
int ldc, incc;
int ldc_conj, incc_conj;
int herk_needs_conj = FALSE;
// Return early if possible.
if ( bli_zero_dim2( m, k ) ) return;
// If necessary, allocate, initialize, and use a temporary contiguous
// copy of each matrix rather than the original matrices.
bli_zcreate_contigmt( trans,
m,
k,
a_save, a_rs_save, a_cs_save,
&a, &a_rs, &a_cs );
bli_zcreate_contigmr( uplo,
m,
m,
c_save, c_rs_save, c_cs_save,
&c, &c_rs, &c_cs );
// Initialize with values assuming column-major storage.
lda = a_cs;
inca = a_rs;
ldc = c_cs;
incc = c_rs;
// Adjust the parameters based on the storage of each matrix.
if ( bli_is_col_storage( c_rs, c_cs ) )
{
if ( bli_is_col_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_c ) += A_c * A_c'
// effective operation: uplo( C_c ) += A_c * A_c'
}
else // if ( bli_is_row_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_c ) += A_r * A_r'
// effective operation: uplo( C_c ) += conj( A_c' * A_c )
bli_swap_ints( lda, inca );
bli_toggle_conjtrans( trans );
herk_needs_conj = TRUE;
}
}
else // if ( bli_is_row_storage( c_rs, c_cs ) )
{
if ( bli_is_col_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_r ) += A_c * A_c'
// effective operation: ~uplo( C_c ) += conj( A_c * A_c' )
bli_swap_ints( ldc, incc );
bli_toggle_uplo( uplo );
herk_needs_conj = TRUE;
}
else // if ( bli_is_row_storage( a_rs, a_cs ) )
{
// requested operation: uplo( C_r ) += A_r * A_r'
// effective operation: ~uplo( C_c ) += A_c' * A_c
bli_swap_ints( ldc, incc );
bli_swap_ints( lda, inca );
bli_toggle_uplo( uplo );
bli_toggle_conjtrans( trans );
}
}
// There are two cases where we need to perform the rank-k product and
// then axpy the result into C with a conjugation. We handle those two
// cases here.
if ( herk_needs_conj )
{
// We need a temporary matrix for holding the rank-k product.
c_conj = bli_zallocm( m, m );
ldc_conj = m;
incc_conj = 1;
// Compute the rank-k product.
bli_zherk_blas( uplo,
trans,
m,
k,
alpha,
a, lda,
&zero_r,
c_conj, ldc_conj );
// Scale C by beta.
bli_zdscalmr( uplo,
m,
m,
beta,
c, incc, ldc );
// And finally, accumulate the rank-k product in C_conj into C
// with a conjugation.
bli_zaxpymrt( uplo,
BLIS_CONJ_NO_TRANSPOSE,
m,
m,
&one,
c_conj, incc_conj, ldc_conj,
c, incc, ldc );
// Free the temporary matrix for C.
bli_zfree( c_conj );
}
else
{
bli_zherk_blas( uplo,
trans,
m,
k,
alpha,
a, lda,
beta,
c, ldc );
}
// Free any temporary contiguous matrices, copying the result back to
// the original matrix.
bli_zfree_contigm( a_save, a_rs_save, a_cs_save,
&a, &a_rs, &a_cs );
bli_zfree_saved_contigmr( uplo_save,
m_save,
m_save,
c_save, c_rs_save, c_cs_save,
&c, &c_rs, &c_cs );
}
| void bli_zherk_blas | ( | uplo_t | uplo, |
| trans_t | trans, | ||
| int | m, | ||
| int | k, | ||
| double * | alpha, | ||
| dcomplex * | a, | ||
| int | lda, | ||
| double * | beta, | ||
| dcomplex * | c, | ||
| int | ldc | ||
| ) |
References bli_param_map_to_netlib_trans(), bli_param_map_to_netlib_uplo(), cblas_zherk(), CblasColMajor, and F77_zherk().
Referenced by bli_zherk().
{
#ifdef BLIS_ENABLE_CBLAS_INTERFACES
enum CBLAS_ORDER cblas_order = CblasColMajor;
enum CBLAS_UPLO cblas_uplo;
enum CBLAS_TRANSPOSE cblas_trans;
bli_param_map_to_netlib_uplo( uplo, &cblas_uplo );
bli_param_map_to_netlib_trans( trans, &cblas_trans );
cblas_zherk( cblas_order,
cblas_uplo,
cblas_trans,
m,
k,
*alpha,
a, lda,
*beta,
c, ldc );
#else
char blas_uplo;
char blas_trans;
bli_param_map_to_netlib_uplo( uplo, &blas_uplo );
bli_param_map_to_netlib_trans( trans, &blas_trans );
F77_zherk( &blas_uplo,
&blas_trans,
&m,
&k,
alpha,
a, &lda,
beta,
c, &ldc );
#endif
}
1.7.6.1