#ifndef HPC_BENCH_H #define HPC_BENCH_H 1 #include #include #include #include namespace bench { template T asumDiffGeMatrix(Index m, Index n, const T *A, Index incRowA, Index incColA, T *B, Index incRowB, Index incColB) { T asum = 0; for (Index j=0; j void initGeMatrix(Index m, Index n, T *A, Index incRowA, Index incColA) { std::random_device random; std::mt19937 mt(random()); std::uniform_real_distribution uniform(-100, 100); for (Index j=0; j void initGeMatrix(Index m, Index n, std::complex *A, Index incRowA, Index incColA) { std::random_device random; std::mt19937 mt(random()); std::uniform_real_distribution uniform(-100, 100); for (Index j=0; j(uniform(mt), uniform(mt)); } } } template struct WallTime { void tic() { t0 = std::chrono::high_resolution_clock::now(); } T toc() { using namespace std::chrono; elapsed = high_resolution_clock::now() - t0; return duration(elapsed).count(); } std::chrono::high_resolution_clock::time_point t0; std::chrono::high_resolution_clock::duration elapsed; }; } // namespace bench #endif // HPC_BENCH_H