libflame  revision_anchor
Functions
bli_scalm.c File Reference

(r)

Functions

void bli_sscalm (conj_t conj, int m, int n, float *alpha, float *a, int a_rs, int a_cs)
void bli_dscalm (conj_t conj, int m, int n, double *alpha, double *a, int a_rs, int a_cs)
void bli_csscalm (conj_t conj, int m, int n, float *alpha, scomplex *a, int a_rs, int a_cs)
void bli_cscalm (conj_t conj, int m, int n, scomplex *alpha, scomplex *a, int a_rs, int a_cs)
void bli_zdscalm (conj_t conj, int m, int n, double *alpha, dcomplex *a, int a_rs, int a_cs)
void bli_zscalm (conj_t conj, int m, int n, dcomplex *alpha, dcomplex *a, int a_rs, int a_cs)

Function Documentation

void bli_cscalm ( conj_t  conj,
int  m,
int  n,
scomplex alpha,
scomplex a,
int  a_rs,
int  a_cs 
)

References bli_cscal(), bli_is_row_storage(), bli_is_vector(), bli_vector_dim(), bli_vector_inc(), bli_zero_dim2(), and BLIS_NO_TRANSPOSE.

Referenced by bli_cgemm(), bli_chemm(), bli_csymm(), bli_ctrmmsx(), bli_ctrsmsx(), FLA_Lyap_h_opc_var1(), FLA_Lyap_h_opc_var2(), FLA_Lyap_h_opc_var3(), FLA_Lyap_h_opc_var4(), FLA_Lyap_n_opc_var1(), FLA_Lyap_n_opc_var2(), FLA_Lyap_n_opc_var3(), FLA_Lyap_n_opc_var4(), FLA_Scal_external(), and FLA_Scalc_external().

{
    scomplex  alpha_conj;
    scomplex* a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_ceq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_ccopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_cscal( n_elem,
                   &alpha_conj,
                   a_begin, inca );
    }
}
void bli_csscalm ( conj_t  conj,
int  m,
int  n,
float *  alpha,
scomplex a,
int  a_rs,
int  a_cs 
)

References bli_csscal(), bli_is_row_storage(), bli_is_vector(), bli_vector_dim(), bli_vector_inc(), bli_zero_dim2(), and BLIS_NO_TRANSPOSE.

Referenced by FLA_Scal_external(), and FLA_Scalc_external().

{
    float     alpha_conj;
    scomplex* a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_seq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_scopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_csscal( n_elem,
                    &alpha_conj,
                    a_begin, inca );
    }
}
void bli_dscalm ( conj_t  conj,
int  m,
int  n,
double *  alpha,
double *  a,
int  a_rs,
int  a_cs 
)

References bli_dscal(), bli_is_row_storage(), bli_is_vector(), bli_vector_dim(), bli_vector_inc(), bli_zero_dim2(), and BLIS_NO_TRANSPOSE.

Referenced by bli_dgemm(), bli_dsymm(), bli_dtrmmsx(), bli_dtrsmsx(), FLA_Lyap_h_opd_var1(), FLA_Lyap_h_opd_var2(), FLA_Lyap_h_opd_var3(), FLA_Lyap_h_opd_var4(), FLA_Lyap_n_opd_var1(), FLA_Lyap_n_opd_var2(), FLA_Lyap_n_opd_var3(), FLA_Lyap_n_opd_var4(), FLA_Scal_external(), and FLA_Scalc_external().

{
    double    alpha_conj;
    double*   a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_deq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_dcopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_dscal( n_elem,
                   &alpha_conj,
                   a_begin, inca );
    }
}
void bli_sscalm ( conj_t  conj,
int  m,
int  n,
float *  alpha,
float *  a,
int  a_rs,
int  a_cs 
)

References bli_is_row_storage(), bli_is_vector(), bli_sscal(), bli_vector_dim(), bli_vector_inc(), bli_zero_dim2(), and BLIS_NO_TRANSPOSE.

Referenced by bli_sgemm(), bli_ssymm(), bli_strmmsx(), bli_strsmsx(), FLA_Lyap_h_ops_var1(), FLA_Lyap_h_ops_var2(), FLA_Lyap_h_ops_var3(), FLA_Lyap_h_ops_var4(), FLA_Lyap_n_ops_var1(), FLA_Lyap_n_ops_var2(), FLA_Lyap_n_ops_var3(), FLA_Lyap_n_ops_var4(), FLA_Scal_external(), and FLA_Scalc_external().

{
    float     alpha_conj;
    float*    a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_seq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_scopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_sscal( n_elem,
                   &alpha_conj,
                   a_begin, inca );
    }
}
void bli_zdscalm ( conj_t  conj,
int  m,
int  n,
double *  alpha,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bli_is_row_storage(), bli_is_vector(), bli_vector_dim(), bli_vector_inc(), bli_zdscal(), bli_zero_dim2(), and BLIS_NO_TRANSPOSE.

Referenced by FLA_Scal_external(), and FLA_Scalc_external().

{
    double    alpha_conj;
    dcomplex* a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_deq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_dcopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_zdscal( n_elem,
                    &alpha_conj,
                    a_begin, inca );
    }
}
void bli_zscalm ( conj_t  conj,
int  m,
int  n,
dcomplex alpha,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bli_is_row_storage(), bli_is_vector(), bli_vector_dim(), bli_vector_inc(), bli_zero_dim2(), bli_zscal(), and BLIS_NO_TRANSPOSE.

Referenced by bli_zgemm(), bli_zhemm(), bli_zsymm(), bli_ztrmmsx(), bli_ztrsmsx(), FLA_Lyap_h_opz_var1(), FLA_Lyap_h_opz_var2(), FLA_Lyap_h_opz_var3(), FLA_Lyap_h_opz_var4(), FLA_Lyap_n_opz_var1(), FLA_Lyap_n_opz_var2(), FLA_Lyap_n_opz_var3(), FLA_Lyap_n_opz_var4(), FLA_Scal_external(), and FLA_Scalc_external().

{
    dcomplex  alpha_conj;
    dcomplex* a_begin;
    int       lda, inca;
    int       n_iter;
    int       n_elem;
    int       j;

    // Return early if possible.
    if ( bli_zero_dim2( m, n ) ) return;
    if ( bli_zeq1( alpha ) ) return;

    // Handle cases where A is a vector to ensure that the underlying axpy
    // gets invoked only once.
    if ( bli_is_vector( m, n ) )
    {
        // Initialize with values appropriate for a vector.
        n_iter = 1;
        n_elem = bli_vector_dim( m, n );
        lda    = 1; // multiplied by zero when n_iter == 1; not needed.
        inca   = bli_vector_inc( BLIS_NO_TRANSPOSE, m, n, a_rs, a_cs );
    }
    else // matrix case
    {
        // Initialize with optimal values for column-major storage.
        n_iter = n;
        n_elem = m;
        lda    = a_cs;
        inca   = a_rs;

        // An optimization: if A is row-major, then let's access the matrix
        // by rows instead of by columns to increase spatial locality.
        if ( bli_is_row_storage( a_rs, a_cs ) )
        {
            bli_swap_ints( n_iter, n_elem );
            bli_swap_ints( lda, inca );
        }
    }

    bli_zcopys( conj, alpha, &alpha_conj );

    for ( j = 0; j < n_iter; j++ )
    {
        a_begin = a + j*lda;

        bli_zscal( n_elem,
                   &alpha_conj,
                   a_begin, inca );
    }
}