Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing loop over block columns of C #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/HowToOptimizeGemm/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ leading dimension of the array that stores matrix X. If LDX=-1
then the leading dimension is set to the row dimension of matrix X.
*/

#define LDA 1000
#define LDB 1000
#define LDC 1000
#define LDA -1
#define LDB -1
#define LDC -1
20 changes: 11 additions & 9 deletions src/MMult_4x4_15.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ void MY_MMult( int m, int n, int k, double *a, int lda,
double *b, int ldb,
double *c, int ldc )
{
int i, p, pb, ib;

/* This time, we compute a mc x n block of C by a call to the InnerKernel */

for ( p=0; p<k; p+=kc ){
pb = min( k-p, kc );
for ( i=0; i<m; i+=mc ){
ib = min( m-i, mc );
InnerKernel( ib, n, pb, &A( i,p ), lda, &B(p, 0 ), ldb, &C( i,0 ), ldc, i==0 );
int i, p, pb, ib, j, jb;

/* This time, we compute a mc x nb block of C by a call to the InnerKernel */
for ( j=0; j<n; j+=nb ){
jb = min( n-j, nb );
for ( p=0; p<k; p+=kc ){
pb = min( k-p, kc );
for ( i=0; i<m; i+=mc ){
ib = min( m-i, mc );
InnerKernel( ib, jb, pb, &A( i,p ), lda, &B(p,j ), ldb, &C( i,j ), ldc, i==0 );
}
}
}
}
Expand Down