libflame  revision_anchor
Functions
FLA_Apply_CAQ2_UT.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Apply_CAQ2_UT_internal (FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj D, FLA_Obj T, FLA_Obj W, FLA_Obj C, FLA_Obj E, fla_apcaq2ut_t *cntl)
FLA_Error FLA_Apply_CAQ2_UT_lhfc (FLA_Obj D, FLA_Obj T, FLA_Obj W, FLA_Obj C, FLA_Obj E, fla_apcaq2ut_t *cntl)

Function Documentation

FLA_Error FLA_Apply_CAQ2_UT_internal ( FLA_Side  side,
FLA_Trans  trans,
FLA_Direct  direct,
FLA_Store  storev,
FLA_Obj  D,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  C,
FLA_Obj  E,
fla_apcaq2ut_t cntl 
)

References fla_apcaq2ut_cntl_leaf, FLA_Apply_CAQ2_UT_internal(), FLA_Apply_CAQ2_UT_internal_check(), FLA_Apply_CAQ2_UT_lhfc(), FLA_Apply_Q2_UT_task(), FLA_Check_error_level(), FLA_Obj_elemtype(), FLA_Obj_structure(), and FLASH_Queue_get_enabled().

Referenced by FLA_Apply_CAQ2_UT_internal(), FLA_Apply_CAQ2_UT_lhfc_blk_var2(), FLA_Apply_CAQ2_UT_lhfc_blk_var3(), FLA_Apply_CAQ2_UT_lhfc_task(), FLA_Apply_CAQ2_UT_task(), FLA_Apply_CAQ_UT_inc_lhfc_blk_var1(), and FLA_CAQR_UT_inc_blk_var1().

{
    FLA_Error r_val = FLA_SUCCESS;

    if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
        FLA_Apply_CAQ2_UT_internal_check( side, trans, direct, storev, D, T, W, C, E, cntl );

    if      ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
              FLA_Obj_elemtype( D ) == FLA_MATRIX &&
              FLA_Cntl_variant( cntl ) == FLA_SUBPROBLEM )
    {
        // Recurse
        r_val = FLA_Apply_CAQ2_UT_internal( side,
                                            trans,
                                            direct,
                                            storev,
                                            *FLASH_OBJ_PTR_AT( D ),
                                            *FLASH_OBJ_PTR_AT( T ),
                                            *FLASH_OBJ_PTR_AT( W ),
                                            *FLASH_OBJ_PTR_AT( C ),
                                            *FLASH_OBJ_PTR_AT( E ),
                                            flash_apcaq2ut_cntl_leaf );
    }
    else if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
              FLA_Obj_elemtype( D ) == FLA_SCALAR &&
              FLASH_Queue_get_enabled( ) )
    {
        // Enqueue
        if      ( FLA_Obj_structure( D ) == FLA_FULL_MATRIX )
        {
            ENQUEUE_FLASH_Apply_Q2_UT( side, trans, direct, storev, D, T, W, C, E, cntl );
        }
        else if ( FLA_Obj_structure( D ) == FLA_UPPER_TRIANGULAR )
        {
            ENQUEUE_FLASH_Apply_CAQ2_UT( side, trans, direct, storev, D, T, W, C, E, cntl );
        }
        else if ( FLA_Obj_structure( D ) == FLA_ZERO_MATRIX )
        {
            // Don't enqueue any tasks for zero blocks.
        }
        else
        {
            FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
        }
    }
    else
    {
        if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
             FLA_Obj_elemtype( D ) == FLA_SCALAR &&
             !FLASH_Queue_get_enabled( ) )
        {

            // Execute leaf.
            if      ( FLA_Obj_structure( D ) == FLA_FULL_MATRIX )
            {
                FLA_Apply_Q2_UT_task( side, trans, direct, storev, D, T, W, C, E, NULL );
                return FLA_SUCCESS;
            }
            else if ( FLA_Obj_structure( D ) == FLA_UPPER_TRIANGULAR )
                cntl = fla_apcaq2ut_cntl_leaf;
            else if ( FLA_Obj_structure( D ) == FLA_ZERO_MATRIX )
                return FLA_SUCCESS;
            else
                FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
        }

        if      ( side == FLA_LEFT )
        {
            if      ( trans == FLA_NO_TRANSPOSE )
            {
                if      ( direct == FLA_FORWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
                else if ( direct == FLA_BACKWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
            }
            else if ( trans == FLA_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
            {
                if      ( direct == FLA_FORWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        r_val = FLA_Apply_CAQ2_UT_lhfc( D, T, W, C, E, cntl );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
                else if ( direct == FLA_BACKWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
            }
        }
        else if ( side == FLA_RIGHT )
        {
            if      ( trans == FLA_NO_TRANSPOSE )
            {
                if      ( direct == FLA_FORWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
                else if ( direct == FLA_BACKWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
            }
            else if ( trans == FLA_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
            {
                if      ( direct == FLA_FORWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
                else if ( direct == FLA_BACKWARD )
                {
                    if      ( storev == FLA_COLUMNWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                    else if ( storev == FLA_ROWWISE )
                        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                }
            }
        }
    }

    return r_val;
}

References FLA_Apply_CAQ2_UT_lhfc_blk_var1(), FLA_Apply_CAQ2_UT_lhfc_blk_var2(), and FLA_Apply_CAQ2_UT_lhfc_blk_var3().

Referenced by FLA_Apply_CAQ2_UT_internal().

{
    FLA_Error r_val = FLA_SUCCESS;
    
    if      ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT1 )
    {
        r_val = FLA_Apply_CAQ2_UT_lhfc_blk_var1( D, T, W, C, E, cntl );
    }
    else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT2 )
    {
        r_val = FLA_Apply_CAQ2_UT_lhfc_blk_var2( D, T, W, C, E, cntl );
    }
    else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT3 )
    {
        r_val = FLA_Apply_CAQ2_UT_lhfc_blk_var3( D, T, W, C, E, cntl );
    }
    else
    {
        FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
    }

    return r_val;
}