Commit fe5cc346 authored by Lukas Cejka's avatar Lukas Cejka Committed by Tomáš Oberhuber
Browse files

Added benchmarked format shortcut to cuSPARSE label of benchmark metadata.

parent fdb9d432
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -59,6 +59,18 @@ std::string getMatrixFormat( const Matrix& matrix )
    return format;
}

template< typename Matrix >
std::string getFormatShort( const Matrix& matrix )
{
    std::string mtrxFullType = getType( matrix );
    std::string mtrxType = mtrxFullType.substr( 0, mtrxFullType.find( "<" ) );
    std::string format = mtrxType.substr( mtrxType.find( ':' ) + 2 );
    format = format.substr( format.find(':') + 2);
    format = format.substr( 0, 3 );

    return format;
}

// Print information about the matrix.
template< typename Matrix >
void printMatrixInfo( const Matrix& matrix,
@@ -221,7 +233,7 @@ benchmarkSpMV( Benchmark& benchmark,
          { "non-zeros", convertToString( hostMatrix.getNumberOfNonzeroMatrixElements() ) },
          { "rows", convertToString( hostMatrix.getRows() ) },
          { "columns", convertToString( hostMatrix.getColumns() ) },
          { "matrix format", convertToString( "CSR-cuSPARSE" ) }
          { "matrix format", convertToString( "CSR-cuSPARSE-" + getFormatShort( hostMatrix ) ) }
       } ));

    benchmark.time< Devices::Cuda >( reset, "GPU", spmvCusparse );