Response 3

This commit is contained in:
Gundolf Haase 2025-11-12 17:14:29 +01:00
commit 6a3d5f1e51
3 changed files with 25 additions and 4 deletions

BIN
Sheet3/gh_code_Pizzo.pdf Normal file

Binary file not shown.

16
Sheet3/gh_response.txt Normal file
View file

@ -0,0 +1,16 @@
* thank you for list of finshed tasks
* g++ -O3 main_blas.cpp bench_funcs_blas.cpp bench_funcs.cpp -lblas
* g++ -O3 main.cpp bench_funcs.cpp bench_funcs.cpp ==> problems because *.cpp is included in main file [-1]
* clang-tidy *.cpp -checks=llvm-*,-llvm-header-guard -header-filter=.* -enable-check-profile -extra-arg="-std=c++17" -extra-arg="-fopenmp" -- *.cpp > gh_codecheck.txt
* see also annotated PDF gh_code_Pizzo.pdf
* more flexibilty which test to run:
See main_blas.cpp and comments // GH // HG
* run benchmarks more than once (rule of thumb: 10 sec run time)

View file

@ -35,10 +35,15 @@ double toc() {
}
//CHANGE FLAG BASED ON WHAT YOU WANT TO DO
int main() {
//int main() {
//cout << fixed << setprecision(6);
//int flag = 2; // 1=A2 (dot), 2=B2 (matvec), 3=C2 (matmul)
// GH
int main(const int argc, const char *argv[])
{
const unsigned int flag = (argc > 1) ? atoi(argv[1]) : 2;
// HG
cout << fixed << setprecision(6);
int flag = 2; // 1=A2 (dot), 2=B2 (matvec), 3=C2 (matmul)
if (flag == 1) {// A2) DOT via cBLAS
size_t N = 5000000;
vector<double> x, y;
@ -80,7 +85,7 @@ int main() {
}
else if (flag == 3) { // C2) GEMM via cBLAS
size_t M = 500, L = 500, N = 500;
size_t M = 500, L = 500, N = 500; // GH: Use also different sizes
vector<double> A, B, C;
gen_matrix_A(M, L, A);
gen_matrix_A(L, N, B);