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

What are m, n, k in dgemm routines? #167

Open
markisus opened this issue Sep 1, 2022 · 1 comment
Open

What are m, n, k in dgemm routines? #167

markisus opened this issue Sep 1, 2022 · 1 comment

Comments

@markisus
Copy link

markisus commented Sep 1, 2022

In particular I'm looking for guidance using blasfeo_dgemm_tn which takes the parameters m,n,k.
void blasfeo_dgemm_nt(int m, int n, int k, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dmat *sB, int bi, int bj, double beta, struct blasfeo_dmat *sC, int ci, int cj, struct blasfeo_dmat *sD, int di, int dj);

If I'm trying to use it to compute D = A.t * B where A has dimension 3 x 4 and B has 3 x 5 (and therefore D is necessarily 4 x 5), what should be m,n,k? I'm also ignoring C by setting it to D and using a beta=0 multiplier.

@giaf
Copy link
Owner

giaf commented Sep 1, 2022

All BLASFEO routines are closely related to the standard BLAS and LAPACK counterparts, and in particular the dimension parameters are identical, so you can always use the standard BLAS documentation for guidance
https://netlib.org/lapack/explore-html/d1/d54/group__double__blas__level3_gaeda3cbd99c8fb834a60a6412878226e1.html
In particular, for all gemm routines, you can see m and n as the number of rows and columns of the result matrix, while k as the length of the dot product to compute each element of the result matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants