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

Added sparse sandbox matrix optionaly to SpMV benchmark.

parent 86bf24dd
No related branches found
No related tags found
1 merge request!105TO/matrices-adaptive-csr
...@@ -35,6 +35,13 @@ ...@@ -35,6 +35,13 @@
#include <TNL/Algorithms/Segments/SlicedEllpack.h> #include <TNL/Algorithms/Segments/SlicedEllpack.h>
#include <TNL/Algorithms/Segments/ChunkedEllpack.h> #include <TNL/Algorithms/Segments/ChunkedEllpack.h>
#include <TNL/Algorithms/Segments/BiEllpack.h> #include <TNL/Algorithms/Segments/BiEllpack.h>
// Uncomment the following line to enable benchmarking the sandbox sparse matrix.
//#define WITH_SANDBOX_MATRIX_BENCHMARK
#ifdef WITH_SANDBOX_MATRIX_BENCHMARK
#include <TNL/Matrices/Sandbox/SparseSandboxMatrix.h>
#endif
using namespace TNL::Matrices; using namespace TNL::Matrices;
#include <Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h> #include <Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h>
...@@ -122,6 +129,10 @@ using BiEllpackSegments = Algorithms::Segments::BiEllpack< Device, Index, IndexA ...@@ -122,6 +129,10 @@ using BiEllpackSegments = Algorithms::Segments::BiEllpack< Device, Index, IndexA
template< typename Real, typename Device, typename Index > template< typename Real, typename Device, typename Index >
using SymmetricSparseMatrix_BiEllpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::SymmetricMatrix, BiEllpackSegments >; using SymmetricSparseMatrix_BiEllpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::SymmetricMatrix, BiEllpackSegments >;
#ifdef WITH_SANDBOX_MATRIX_BENCHMARK
template< typename Real, typename Device, typename Index >
using SparseSandboxMatrix = Matrices::Sandbox::SparseSandboxMatrix< Real, Device, Index, Matrices::GeneralMatrix >;
#endif
///// /////
// Legacy formats // Legacy formats
...@@ -496,6 +507,9 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, ...@@ -496,6 +507,9 @@ benchmarkSpmvSynthetic( Benchmark& benchmark,
benchmarkSpMV< Real, HostMatrixType, SparseMatrix_SlicedEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, HostMatrixType, SparseMatrix_SlicedEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR );
benchmarkSpMV< Real, HostMatrixType, SparseMatrix_ChunkedEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, HostMatrixType, SparseMatrix_ChunkedEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR );
benchmarkSpMV< Real, HostMatrixType, SparseMatrix_BiEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, HostMatrixType, SparseMatrix_BiEllpack >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR );
#ifdef WITH_SANDBOX_MATRIX_BENCHMARK
benchmarkSpMV< Real, HostMatrixType, SparseSandboxMatrix >( benchmark, hostMatrix, hostOutVector, inputFileName, verboseMR );
#endif
hostMatrix.reset(); hostMatrix.reset();
///// /////
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <TNL/Matrices/DenseMatrixView.h> #include <TNL/Matrices/DenseMatrixView.h>
#include <TNL/Matrices/SparseMatrix.h> #include <TNL/Matrices/SparseMatrix.h>
#include <TNL/Matrices/SparseMatrixView.h> #include <TNL/Matrices/SparseMatrixView.h>
#include <TNL/Matrices/Sandbox/SparseSandboxMatrix.h>
#include <TNL/Algorithms/Segments/CSRView.h> #include <TNL/Algorithms/Segments/CSRView.h>
#include <TNL/Algorithms/Segments/EllpackView.h> #include <TNL/Algorithms/Segments/EllpackView.h>
#include <TNL/Algorithms/Segments/SlicedEllpackView.h> #include <TNL/Algorithms/Segments/SlicedEllpackView.h>
...@@ -85,6 +86,34 @@ struct MatrixInfo< SparseMatrix< Real, Device, Index, MatrixType, Segments, Real ...@@ -85,6 +86,34 @@ struct MatrixInfo< SparseMatrix< Real, Device, Index, MatrixType, Segments, Real
{ {
}; };
template< typename Real,
typename Device,
typename Index,
typename MatrixType >
struct MatrixInfo< Sandbox::SparseSandboxMatrixView< Real, Device, Index, MatrixType > >
{
static String getDensity() { return String( "sparse" ); };
static String getFormat()
{
if( MatrixType::isSymmetric() )
return TNL::String( "Symmetric Sandbox" );
else
return TNL::String( "Sandbox" );
};
};
template< typename Real,
typename Device,
typename Index,
typename MatrixType,
typename RealAllocator,
typename IndexAllocator >
struct MatrixInfo< Sandbox::SparseSandboxMatrix< Real, Device, Index, MatrixType, RealAllocator, IndexAllocator > >
: public MatrixInfo< typename Sandbox::SparseSandboxMatrix< Real, Device, Index, MatrixType, RealAllocator, IndexAllocator >::ViewType >
{
};
///// /////
// Legacy matrices // Legacy matrices
template< typename Real, typename Device, typename Index > template< typename Real, typename Device, typename Index >
......
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