Skip to content

Instantly share code, notes, and snippets.

@danieldk
Last active June 4, 2022 18:33
Show Gist options
  • Save danieldk/b4f275e715fb8131d6fe5435e9f29a98 to your computer and use it in GitHub Desktop.
Save danieldk/b4f275e715fb8131d6fe5435e9f29a98 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <cblas.h>
int const M = 7;
int const K = 1026;
int const N = 1026;
int main() {
float const *A = (float *) calloc(M * K, sizeof(float));
float const *B = (float *) calloc(K * N, sizeof(float));
float *C = (float *) malloc(M * N * sizeof(float));
cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
M, N, K, 1.0, A, K, B, N, 0.0, C, N);
free((void *) A);
free((void *) B);
free((void *) C);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment