Skip to content

Commit f5fcc5b

Browse files
authored
Add trivial gemm test for multithread consistency
1 parent 62f4c84 commit f5fcc5b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cpp_thread_test/gemm64.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
#include <cblas.h>
3+
int main ( int argc, char* argv[] ) {
4+
const long n = ((long)1 << 31) - 1;
5+
std::cout << n <<std::endl;
6+
float* A = new float[n];
7+
float* B = new float[n];
8+
float* C = new float[1];
9+
for(long i =0; i <n; i++){
10+
A[i] = 1;
11+
B[i] = 1;
12+
13+
}
14+
cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 1, 1, n, 1.0, A, n, B, 1, 0.0, C, 1);
15+
std::cout << *C <<std::endl;
16+
delete[] A;
17+
delete[] B;
18+
delete[] C;
19+
return 0;
20+
}

0 commit comments

Comments
 (0)