Skip to content
Snippets Groups Projects
Commit 345e290c authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Jakub Klinkovský
Browse files

Fixing SpMV benchmark with CUDA.

parent 2b69cfe1
No related branches found
No related tags found
1 merge request!105TO/matrices-adaptive-csr
......@@ -52,7 +52,7 @@ runBlasBenchmarks( Benchmark<> & benchmark,
benchmark.newBenchmark( String("Array operations (") + precision + ", host allocator = CudaHost)",
metadata );
for( std::size_t size = minSize; size <= maxSize; size *= 2 ) {
benchmark.setMetadataColumns( Benchmark::MetadataColumns({
benchmark.setMetadataColumns( Benchmark<>::MetadataColumns({
{ "size", convertToString( size ) },
} ));
benchmarkArrayOperations< Real, int, Allocators::CudaHost >( benchmark, size );
......@@ -60,7 +60,7 @@ runBlasBenchmarks( Benchmark<> & benchmark,
benchmark.newBenchmark( String("Array operations (") + precision + ", host allocator = CudaManaged)",
metadata );
for( std::size_t size = minSize; size <= maxSize; size *= 2 ) {
benchmark.setMetadataColumns( Benchmark::MetadataColumns({
benchmark.setMetadataColumns( Benchmark<>::MetadataColumns({
{ "size", convertToString( size ) },
} ));
benchmarkArrayOperations< Real, int, Allocators::CudaManaged >( benchmark, size );
......
......@@ -479,7 +479,7 @@ benchmarkSpmv( BenchmarkType& benchmark,
cusparseMatrix.vectorProduct( cudaInVector, cudaOutVector );
};
SpmvBenchmarkResult< Real, Devices::Cuda, int > cudaBenchmarkResults( String( "cusprase" ), hostOutVector, hostOutVector, csrHostMatrix.getNonzeroElementsCount() );
SpmvBenchmarkResult< Real, Devices::Cuda, int > cudaBenchmarkResults( String( "cusparse" ), hostOutVector, cudaOutVector, csrHostMatrix.getNonzeroElementsCount() );
benchmark.time< Devices::Cuda >( resetCusparseVectors, "GPU", spmvCusparse, cudaBenchmarkResults );
#ifdef HAVE_CSR5
......
......@@ -32,8 +32,8 @@ using namespace TNL::Benchmarks;
template< typename Real >
void
runSpMVBenchmarks( SpMV::BenchmarkType & benchmark,
SpMV::BenchmarkType::MetadataMap metadata,
runSpMVBenchmarks( TNL::Benchmarks::SpMV::BenchmarkType & benchmark,
TNL::Benchmarks::SpMV::BenchmarkType::MetadataMap metadata,
const String & inputFileName,
const Config::ParameterContainer& parameters,
bool verboseMR = false )
......@@ -46,7 +46,7 @@ runSpMVBenchmarks( SpMV::BenchmarkType & benchmark,
metadata );
// Start the actual benchmark in spmv.h
try {
SpMV::benchmarkSpmv< Real >( benchmark, inputFileName, parameters, verboseMR );
TNL::Benchmarks::SpMV::benchmarkSpmv< Real >( benchmark, inputFileName, parameters, verboseMR );
}
catch( const std::exception& ex ) {
std::cerr << ex.what() << std::endl;
......@@ -133,10 +133,10 @@ main( int argc, char* argv[] )
std::ofstream logFile( logFileName.getString(), mode );
// init benchmark and common metadata
SpMV::BenchmarkType benchmark( loops, verbose, outputMode );
TNL::Benchmarks::SpMV::BenchmarkType benchmark( loops, verbose, outputMode );
// prepare global metadata
SpMV::BenchmarkType::MetadataMap metadata = getHardwareMetadata< Logging >();
TNL::Benchmarks::SpMV::BenchmarkType::MetadataMap metadata = getHardwareMetadata< Logging >();
// Initiate setup of benchmarks
if( precision == "all" || precision == "float" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment