sgemm1-capp-region1

SGEMM performs one of the matrix-matrix operations of the type:

C := alpha * op(A) * op(B) + beta * C

Where op(X) is either X or X', alpha and beta are scalars, and A,B and C are matrices.

The dimensions of A,B, and C are as follows:

op(A) is a m by k matrix. op(B) is a k by n matrix. and C is a m by n matrix.

Code Snippet

#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
#define B(I,J) b[(I)-1 + ((J)-1)* ( *ldb)]
#define C(I,J) c[(I)-1 + ((J)-1)* ( *ldc)]

// char* transa=T, transb=N;
// int* m=512, n=512, k=512, lda=512, ldb=512, ldc=512;
// float temp, tempA, tempB, tempC, tempD, checksum=0.0;
// float* alpha=2.500000, beta=2.500000;


for (j = 1; j <= *n; ++j) {
    for (i = 1; i <= *m; ++i) {
        temp = 0.f;
        for (l = 1; l <= *k; l ++) {
            temp += A(l,i) * B(l,j);
        }
        C(i,j) = *alpha * temp + *beta * C(i,j);
    }
}