Last active
March 31, 2021 01:37
-
-
Save maoe/953c4e863703be915928b0f8997fcc46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cc -o repro repro.c libopenblas.a | |
// or | |
// cc -o repro repro.c -L. -lopenblas | |
// then | |
// ./repro | |
#include <stdio.h> | |
#include "cblas.h" | |
int main(void) | |
{ | |
int m = 2; | |
int n = 2; | |
int k = 2; | |
double alpha = 1.0; | |
double lhs[4] = {1.0, 0.0, 0.0, 1.0}; | |
int lhs_stride = 2; | |
double rhs[4] = {1.0, 1.0, 1.0, 1.0}; | |
int rhs_stride = 2; | |
double beta = 0.0; | |
double c[4] = {0.0, 0.0, 0.0, 0.0}; | |
int c_stride = 2; | |
cblas_dgemm( | |
CblasRowMajor, | |
CblasNoTrans, | |
CblasNoTrans, | |
m, | |
n, | |
k, | |
alpha, | |
lhs, | |
lhs_stride, | |
rhs, | |
rhs_stride, | |
beta, | |
c, | |
c_stride); | |
for (int i = 0; i < 4; i++) | |
{ | |
printf("%f\n", c[i]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment