Skip to content

Commit 7d974c5

Browse files
[posts/math-libraries-intro] Fix makefile and make examples uniform (#45)
1 parent 36043fe commit 7d974c5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

posts/math-libraries-intro/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ BINARIES= cublas-example openblas-example
2828

2929
all: $(BINARIES)
3030

31-
openblas-example: openblas-example.c Makefile
32-
g++ -std=c++11 -pthread -O3 -Wall openblas-example.c -o openblas-example -lopenblas -lpthread -lm
31+
openblas-example: openblas-example.cpp Makefile
32+
g++ -std=c++11 -pthread -O3 -Wall openblas-example.cpp -o openblas-example -lopenblas -lpthread -lm
3333

3434
cublas-example: cublas-example.cu Makefile
3535
nvcc -lcublas -std=c++11 cublas-example.cu -o cublas-example

posts/math-libraries-intro/openblas-example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]){
3535
std::vector<double> C(m * n);
3636

3737
for (l = 0; l < loops; l++)
38-
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, m, n, k, alpha, A.data(), lda, B.data(), ldb, beta, C.data(), ldc);
38+
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, m, n, k, alpha, A.data(), lda, B.data(), ldb, beta, C.data(), ldc);
3939

4040
stop = std::chrono::high_resolution_clock::now( );
4141
elapsed_cpu_ms = stop - start;

0 commit comments

Comments
 (0)