Ex8 and minor improvements

This commit is contained in:
Markus Schmidt 2025-11-12 02:04:18 +01:00
commit 77bc8c6aa3
50 changed files with 214845 additions and 43 deletions

View file

@ -131,6 +131,7 @@ int main(int argc, char **argv)
double bytesC = (MC * LC + LC * NC + MC * NC)* sizeof(double);
cout << "\n===== Benchmark C =====\n";
cout << guardC << endl;
cout << "bytes: " << bytesC << endl;
cout << "Timing in sec. : " << tC << endl;
cout << "GFLOPS : " << flopsC / tC / 1024 / 1024 / 1024 << endl;
@ -172,6 +173,7 @@ int main(int argc, char **argv)
double bytesD = (p + 2 * ND)*sizeof(double);
cout << "\n===== Benchmark D =====\n";
cout << guardD << endl;
cout << "bytes: " << bytesD << endl;
cout << "Timing in sec. : " << tD << endl;
cout << "GFLOPS : " << flopsD / tD / 1024 / 1024 / 1024 << endl;
@ -208,6 +210,8 @@ int main(int argc, char **argv)
cout << "GFLOPS : " << 2.0 * NA / tA / 1024 / 1024 / 1024 << endl;
cout << "GiByte/s : "
<< NA * sizeof(xA[0]) / tA / 1024 / 1024 / 1024 << endl;
//a bit faster due to only accessing one vector
}
@ -240,6 +244,8 @@ int main(int argc, char **argv)
cout << "GFLOPS : " << 5.0 * NA / tA / 1024 / 1024 / 1024 << endl;
cout << "GiByte/s : "
<< 2.0 * NA * sizeof(xA[0]) / tA / 1024 / 1024 / 1024 << endl;
//in comparison to benchmark A: a bit slower runtime but more than double the amount of FLOPS therefor also more GFLOPS
}
@ -276,11 +282,16 @@ int main(int argc, char **argv)
double bytesC = (MC * LC + LC * NC + MC * NC)* sizeof(double);
cout << "\n===== Benchmark 5C =====\n";
cout << guardC << endl;
cout << "bytes: " << bytesC << endl;
cout << "Timing in sec. : " << tC << endl;
cout << "GFLOPS : " << flopsC / tC / 1024 / 1024 / 1024 << endl;
cout << "GiByte/s : " << bytesC / tC / 1024 / 1024 / 1024 << endl;
//slower than rowwise access, due to incoherent acces in the vector memory of A
//Transpose matrix, the it is also row wise-access or reorder loops
}
return 0;
} // memory for x and y will be deallocated by their destructors
}