Loading src/Benchmarks/SpMV/spmv.h +27 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <TNL/Matrices/SlicedEllpack.h> #include <TNL/Matrices/ChunkedEllpack.h> //#include <TNL/Matrices/MatrixReader.h> namespace TNL { namespace Benchmarks { Loading @@ -27,6 +29,16 @@ namespace Benchmarks { template< typename Real, typename Device, typename Index > using SlicedEllpack = Matrices::SlicedEllpack< Real, Device, Index >; //template< typename Matrix > //void printMatrixInfo( const String& inputFileName, // const Matrix& matrix, // std::ostream& str ) //{ // str << " Rows: " << std::setw( 8 ) << matrix.getRows(); // str << " Columns: " << std::setw( 8 ) << matrix.getColumns(); // str << " Nonzero Elements: " << std::setw( 10 ) << matrix.getNumberOfNonzeroMatrixElements(); //} template< typename Matrix > int setHostTestMatrix( Matrix& matrix, const int elementsPerRow ) Loading Loading @@ -176,6 +188,21 @@ benchmarkSpmvSynthetic( Benchmark & benchmark, const int & size, const int & elementsPerRow ) { // typedef Matrices::CSR< Real, Devices::Host, int > CSRType; // CSRType csrMatrix; // try // { // if( ! MatrixReader< CSRType >::readMtxFile( inputFileName, csrMatrix ) ) // { // std::cerr << "I am not able to read the matrix file " << inputFileName << "." << std::endl; // return false; // } // } // catch( std::bad_alloc ) // { // std::cerr << "Not enough memory to read the matrix." << std::endl; // return false; // } bool result = true; // TODO: benchmark all formats from tnl-benchmark-spmv (different parameters of the base formats) result |= benchmarkSpMV< Real, Matrices::CSR >( benchmark, size, elementsPerRow ); Loading src/Benchmarks/SpMV/tnl-benchmark-spmv.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ void setupConfig( Config::ConfigDescription & config ) { config.addDelimiter( "Benchmark settings:" ); config.addRequiredEntry< String >( "input-file", "Input file name." ); config.addEntry< String >( "log-file", "Log file name.", "tnl-benchmark-blas.log"); config.addEntry< String >( "output-mode", "Mode for opening the log file.", "overwrite" ); config.addEntryEnum( "append" ); Loading Loading
src/Benchmarks/SpMV/spmv.h +27 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <TNL/Matrices/SlicedEllpack.h> #include <TNL/Matrices/ChunkedEllpack.h> //#include <TNL/Matrices/MatrixReader.h> namespace TNL { namespace Benchmarks { Loading @@ -27,6 +29,16 @@ namespace Benchmarks { template< typename Real, typename Device, typename Index > using SlicedEllpack = Matrices::SlicedEllpack< Real, Device, Index >; //template< typename Matrix > //void printMatrixInfo( const String& inputFileName, // const Matrix& matrix, // std::ostream& str ) //{ // str << " Rows: " << std::setw( 8 ) << matrix.getRows(); // str << " Columns: " << std::setw( 8 ) << matrix.getColumns(); // str << " Nonzero Elements: " << std::setw( 10 ) << matrix.getNumberOfNonzeroMatrixElements(); //} template< typename Matrix > int setHostTestMatrix( Matrix& matrix, const int elementsPerRow ) Loading Loading @@ -176,6 +188,21 @@ benchmarkSpmvSynthetic( Benchmark & benchmark, const int & size, const int & elementsPerRow ) { // typedef Matrices::CSR< Real, Devices::Host, int > CSRType; // CSRType csrMatrix; // try // { // if( ! MatrixReader< CSRType >::readMtxFile( inputFileName, csrMatrix ) ) // { // std::cerr << "I am not able to read the matrix file " << inputFileName << "." << std::endl; // return false; // } // } // catch( std::bad_alloc ) // { // std::cerr << "Not enough memory to read the matrix." << std::endl; // return false; // } bool result = true; // TODO: benchmark all formats from tnl-benchmark-spmv (different parameters of the base formats) result |= benchmarkSpMV< Real, Matrices::CSR >( benchmark, size, elementsPerRow ); Loading
src/Benchmarks/SpMV/tnl-benchmark-spmv.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ void setupConfig( Config::ConfigDescription & config ) { config.addDelimiter( "Benchmark settings:" ); config.addRequiredEntry< String >( "input-file", "Input file name." ); config.addEntry< String >( "log-file", "Log file name.", "tnl-benchmark-blas.log"); config.addEntry< String >( "output-mode", "Mode for opening the log file.", "overwrite" ); config.addEntryEnum( "append" ); Loading