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

Added both strategies of threads mapping in CSR Light to SpMV benchmark.

parent 47606aff
No related branches found
No related tags found
1 merge request!105TO/matrices-adaptive-csr
......@@ -437,10 +437,19 @@ benchmarkSpMVCSRLight( BenchmarkType& benchmark,
cudaMatrix.vectorProduct( cudaInVector, cudaOutVector );
};
cudaMatrix.getSegments().getKernel().setThreadsMapping( Algorithms::Segments::CSRLightAutomaticThreads );
String format = MatrixInfo< HostMatrix >::getFormat();
SpmvBenchmarkResult< Real, Devices::Cuda, int > cudaBenchmarkResults( format, csrResultVector, cudaOutVector, cudaMatrix.getNonzeroElementsCount() );
benchmark.time< Devices::Cuda >( resetCudaVectors, "GPU", spmvCuda, cudaBenchmarkResults );
{
cudaMatrix.getSegments().getKernel().setThreadsMapping( Algorithms::Segments::CSRLightAutomaticThreads );
String format = MatrixInfo< HostMatrix >::getFormat() + " Automatic";
SpmvBenchmarkResult< Real, Devices::Cuda, int > cudaBenchmarkResults( format, csrResultVector, cudaOutVector, cudaMatrix.getNonzeroElementsCount() );
benchmark.time< Devices::Cuda >( resetCudaVectors, "GPU", spmvCuda, cudaBenchmarkResults );
};
{
cudaMatrix.getSegments().getKernel().setThreadsMapping( Algorithms::Segments::CSRLightAutomaticThreadsLightSpMV );
String format = MatrixInfo< HostMatrix >::getFormat() + " Automatic Light";
SpmvBenchmarkResult< Real, Devices::Cuda, int > cudaBenchmarkResults( format, csrResultVector, cudaOutVector, cudaMatrix.getNonzeroElementsCount() );
benchmark.time< Devices::Cuda >( resetCudaVectors, "GPU", spmvCuda, cudaBenchmarkResults );
};
/*for( auto threadsPerRow : std::vector< int >{ 1, 2, 4, 8, 16, 32 } )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment