Commit b06136b9 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Added use of MatrixInfo to SpMV benchmark.

parent 8f57fd18
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <TNL/Matrices/Legacy/BiEllpack.h>

#include <TNL/Matrices/MatrixReader.h>
#include <TNL/Matrices/MatrixInfo.h>

#include <TNL/Matrices/SparseMatrix.h>
#include <TNL/Matrices/MatrixType.h>
@@ -160,7 +161,7 @@ benchmarkSpMV( Benchmark& benchmark,
          { "non-zeros", convertToString( hostMatrix.getNumberOfNonzeroMatrixElements() ) },
          { "rows", convertToString( hostMatrix.getRows() ) },
          { "columns", convertToString( hostMatrix.getColumns() ) },
          { "matrix format", convertToString( getType( hostMatrix ) ) }
          { "matrix format", MatrixInfo< HostMatrix >::getFormat() } //convertToString( getType( hostMatrix ) ) }
       } ));

    hostVector.setSize( hostMatrix.getColumns() );
@@ -294,7 +295,8 @@ benchmarkSpmvSynthetic( Benchmark& benchmark,
   
   benchmarkSpMV< Real, SlicedEllpackAlias >( benchmark, inputFileName, verboseMR );
   benchmarkSpMV< Real, SparseMatrix_SlicedEllpack >( benchmark, inputFileName, verboseMR );
   //benchmarkSpMV< Real, Matrices::ChunkedEllpack >( benchmark, inputFileName, verboseMR );
   benchmarkSpMV< Real, Matrices::ChunkedEllpack >( benchmark, inputFileName, verboseMR );
   benchmarkSpMV< Real, Matrices::BiEllpack >( benchmark, inputFileName, verboseMR );

   ////
   // Segments based sparse matrices
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ class CSR

      static String getSerializationType();

      static String getSegmentsType();

      /**
       * \brief Set sizes of particular segments.
       */
+10 −0
Original line number Diff line number Diff line
@@ -64,6 +64,16 @@ getSerializationType()
   return "CSR< [any_device], " + TNL::getSerializationType< IndexType >() + " >";
}

template< typename Device,
          typename Index,
          typename IndexAllocator >
String
CSR< Device, Index, IndexAllocator >::
getSegmentsType()
{
   return ViewType::getSegmentsType();
}

template< typename Device,
          typename Index,
          typename IndexAllocator >
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ class CSRView

      static String getSerializationType();

      static String getSegmentsType();

      __cuda_callable__
      ViewType getView();

+9 −0
Original line number Diff line number Diff line
@@ -64,6 +64,15 @@ getSerializationType()
   return "CSR< [any_device], " + TNL::getSerializationType< IndexType >() + " >";
}

template< typename Device,
          typename Index >
String
CSRView< Device, Index >::
getSegmentsType()
{
   return "CSR";
}

template< typename Device,
          typename Index >
__cuda_callable__
Loading