fixes
This commit is contained in:
parent
67c1ff09ef
commit
e662f3c84b
9 changed files with 38 additions and 37 deletions
|
|
@ -8,10 +8,9 @@
|
|||
#include "task_7.h"
|
||||
#include "timing.h"
|
||||
#include <cblas.h> // cBLAS Library
|
||||
#include <lapacke.h>
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <lapacke.h>
|
||||
|
||||
void task_1() {
|
||||
printf("\n\n-------------- Task 1 --------------\n\n");
|
||||
|
|
@ -235,31 +234,33 @@ void task_7() {
|
|||
// Benchmark
|
||||
|
||||
cout << fixed << setprecision(4);
|
||||
size_t NLOOPS = 1000;
|
||||
cout << "N = " << " | 1 | 2 | 4 | 8 | 16 | 32 " << endl;
|
||||
cout << "---------|--------|--------|--------|--------|--------|-------" << endl;
|
||||
for (int exp = 1; exp < 10; ++exp) {
|
||||
cout << "Nrhs = " << static_cast<size_t>(pow(2,exp));
|
||||
size_t NLOOPS = 200;
|
||||
size_t Nrhs = 2000;
|
||||
cout << "Solution time per right hand side in milliseconds: sec*1000/Nrhs" << endl;
|
||||
cout << "N = " << " | 1 | 2 | 4 | 8 | 16 | 32 " << endl;
|
||||
cout << "------------|--------|--------|--------|--------|--------|-------" << endl;
|
||||
for (int k = 1; k < 10; ++k) {
|
||||
cout << "Nrhs = " << Nrhs*k;
|
||||
for (size_t N : {1, 2, 4, 8, 16, 32}) {
|
||||
tic();
|
||||
for (size_t i = 0; i < NLOOPS; ++i) {
|
||||
benchmark_lapacke(N, static_cast<size_t>(pow(2,exp)));
|
||||
benchmark_lapacke(N, Nrhs*k);
|
||||
}
|
||||
double sec = toc();
|
||||
double sec = toc()*1000 / (static_cast<double>(Nrhs)*k);
|
||||
cout << " | " << sec;
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
printf("\nFor fixed n, the solution time per rhs does not slow down consistently and scales very well.\nIts faster than expected.");
|
||||
printf("\nFor fixed n, the solution time per rhs stays roughly constant.");
|
||||
}
|
||||
|
||||
int main() {
|
||||
task_1();
|
||||
task_2();
|
||||
task_3();
|
||||
task_4();
|
||||
task_5();
|
||||
task_6();
|
||||
// task_1();
|
||||
// task_2();
|
||||
// task_3();
|
||||
// task_4();
|
||||
// task_5();
|
||||
// task_6();
|
||||
task_7();
|
||||
printf("\n\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "task_3.h"
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
#include "task_4+6.h"
|
||||
#include "timing.h"
|
||||
#include <cblas.h> // cBLAS Library
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
void print_performance(double sec, size_t memory, size_t flops, unsigned int size) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#include "task_4+6.h"
|
||||
#include "task_5.h"
|
||||
#include "timing.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
double norm(vector<double> const &x) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "task_7.h"
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <lapacke.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
tuple<vector<double>, vector<double>> init_M(size_t N, size_t Nrhs) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue