int main(int nargs, char **args) { int m, n, lda=4; TYPE a[4]; printf("\nGEMM: NB=%d, lat=%d, mu=%d, nu=%d, ku=%d\n\n", NB, ATL_mmLAT, ATL_mmMU, ATL_mmNU, ATL_mmKU); ATL_GetPartMVN(a, lda, &m, &n); printf("mvN block = %d x %d; mu=%d, nu=%d\n", m, n, ATL_mvNMU, ATL_mvNNU); ATL_GetPartMVT(a, lda, &m, &n); printf("mvT block = %d x %d; mu=%d, nu=%d\n\n", m, n, ATL_mvTMU, ATL_mvTNU); ATL_GetPartSYMV(a, lda, &m, &n); printf("symv block = %d x %d\n\n", m, n); ATL_GetPartR1(a, lda, m, n); printf("ger block = %d x %d; mu=%d, nu=%d\n\n", m, n, ATL_r1MU, ATL_r1NU); return(0); }
void Mjoin( PATL, syr2L ) ( const int N, const TYPE * X, const TYPE * Y, TYPE * A, const int LDA ) { /* * Purpose * ======= * * Mjoin( PATL, syr2L ) performs the symmetric rank 2 operation * * A := alpha * x * y' + alpha * y * x' + A, * * where alpha is a scalar, x and y are n-element vectors and A is an n * by n symmetric matrix. * * This is a recursive version of the algorithm. For a more detailed * description of the arguments of this function, see the reference im- * plementation in the ATLAS/src/blas/reference directory. * * --------------------------------------------------------------------- */ /* * .. Local Variables .. */ #ifdef TREAL #define one ATL_rone #else const TYPE one[2] = { ATL_rone, ATL_rzero }; #endif TYPE * x0, * y0; int j, jb, jbs, m, mb, nb; #ifdef TREAL #define ger Mjoin( PATL, ger1_a1_x1_yX ) #else #define ger Mjoin( PATL, ger1u_a1_x1_yX ) #endif /* .. * .. Executable Statements .. * */ ATL_GetPartR1( A, LDA, mb, nb ); x0 = (TYPE *)(X); y0 = (TYPE *)(Y); for( j = 0; j < N; j += nb ) { jb = N - j; jb = Mmin( jb, nb ); Mjoin( PATL, refsyr2L )( jb, one, X, 1, Y, 1, A, LDA ); if( ( m = N-j-jb ) != 0 ) { jbs = (jb SHIFT); X += jbs; Y += jbs; ger( m, jb, one, X, 1, y0, 1, A + jbs, LDA ); ger( m, jb, one, Y, 1, x0, 1, A + jbs, LDA ); MLrnext( jb, A, LDA ); x0 = (TYPE *)(X); y0 = (TYPE *)(Y); } } /* * End of Mjoin( PATL, syr2L ) */ }
void Mjoin( PATL, her2U ) ( const int N, const TYPE * X, const TYPE * Y, TYPE * A, const int LDA ) { /* * Purpose * ======= * * Mjoin( PATL, her2U ) performs the Hermitian rank 2 operation * * A := alpha * x * conjg( y' ) + y * conjg( alpha * x' ) + A, * * where alpha is a scalar, x and y are n-element vectors and A is an n * by n Hermitian matrix. * * This is a recursive version of the algorithm. For a more detailed * description of the arguments of this function, see the reference im- * plementation in the ATLAS/src/blas/reference directory. * * --------------------------------------------------------------------- */ /* * .. Local Variables .. */ #ifdef TREAL #define one ATL_rone #else const TYPE one[2] = { ATL_rone, ATL_rzero }; #endif TYPE * A0, * x0, * y0; int j, jb, jbs, m, mb, nb; #define ger Mjoin( PATL, ger1c_a1_x1_yX ) /* .. * .. Executable Statements .. * */ ATL_GetPartR1( A, LDA, mb, nb ); MUrnext( N, A, LDA ); x0 = (TYPE *)(X); X += (N SHIFT); y0 = (TYPE *)(Y); Y += (N SHIFT); for( j = 0; j < N; j += nb ) { jb = N - j; jb = Mmin( jb, nb ); jbs = (jb SHIFT); MUrprev( jb, A, LDA ); X -= jbs; Y -= jbs; if( ( m = N-j-jb ) != 0 ) { A0 = (TYPE *)(A) - (m SHIFT); ger( m, jb, one, x0, 1, Y, 1, A0, LDA ); ger( m, jb, one, y0, 1, X, 1, A0, LDA ); } Mjoin( PATL, refher2U )( jb, one, X, 1, Y, 1, A, LDA ); } /* * End of Mjoin( PATL, her2U ) */ }