Skip to content
Snippets Groups Projects
Commit d871fdf5 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Simplified benchmark.time() calls in case of cuBLAS

parent ae90399d
No related branches found
No related tags found
No related merge requests found
...@@ -86,11 +86,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -86,11 +86,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "scalar multiplication", 2 * datasetSize ); benchmark.setOperation( "scalar multiplication", 2 * datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", multiplyHost, "CPU", multiplyHost,
"GPU", multiplyCuda "GPU", multiplyCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", multiplyCublas benchmark.time( reset1, "cuBLAS", multiplyCublas );
#endif #endif
);
auto addVectorHost = [&]() { auto addVectorHost = [&]() {
...@@ -111,11 +110,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -111,11 +110,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "vector addition", 3 * datasetSize ); benchmark.setOperation( "vector addition", 3 * datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", addVectorHost, "CPU", addVectorHost,
"GPU", addVectorCuda "GPU", addVectorCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", addVectorCublas benchmark.time( reset1, "cuBLAS", addVectorCublas );
#endif #endif
);
auto maxHost = [&]() { auto maxHost = [&]() {
...@@ -160,11 +158,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -160,11 +158,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "absMax", datasetSize ); benchmark.setOperation( "absMax", datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", absMaxHost, "CPU", absMaxHost,
"GPU", absMaxCuda "GPU", absMaxCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", absMaxCublas benchmark.time( reset1, "cuBLAS", absMaxCublas );
#endif #endif
);
auto absMinHost = [&]() { auto absMinHost = [&]() {
...@@ -185,11 +182,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -185,11 +182,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "absMin", datasetSize ); benchmark.setOperation( "absMin", datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", absMinHost, "CPU", absMinHost,
"GPU", absMinCuda "GPU", absMinCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", absMinCublas benchmark.time( reset1, "cuBLAS", absMinCublas );
#endif #endif
);
auto sumHost = [&]() { auto sumHost = [&]() {
...@@ -220,11 +216,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -220,11 +216,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "l1 norm", datasetSize ); benchmark.setOperation( "l1 norm", datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", l1normHost, "CPU", l1normHost,
"GPU", l1normCuda "GPU", l1normCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", l1normCublas benchmark.time( reset1, "cuBLAS", l1normCublas );
#endif #endif
);
auto l2normHost = [&]() { auto l2normHost = [&]() {
...@@ -243,11 +238,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -243,11 +238,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "l2 norm", datasetSize ); benchmark.setOperation( "l2 norm", datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", l2normHost, "CPU", l2normHost,
"GPU", l2normCuda "GPU", l2normCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", l2normCublas benchmark.time( reset1, "cuBLAS", l2normCublas );
#endif #endif
);
auto l3normHost = [&]() { auto l3normHost = [&]() {
...@@ -279,11 +273,10 @@ benchmarkVectorOperations( Benchmark & benchmark, ...@@ -279,11 +273,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark.setOperation( "scalar product", 2 * datasetSize ); benchmark.setOperation( "scalar product", 2 * datasetSize );
benchmark.time( reset1, benchmark.time( reset1,
"CPU", scalarProductHost, "CPU", scalarProductHost,
"GPU", scalarProductCuda "GPU", scalarProductCuda );
#ifdef HAVE_CUBLAS #ifdef HAVE_CUBLAS
, "cuBLAS", scalarProductCublas benchmark.time( reset1, "cuBLAS", scalarProductCublas );
#endif #endif
);
/* /*
cout << "Benchmarking prefix-sum:" << endl; cout << "Benchmarking prefix-sum:" << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment