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

Debugging AdaptiveRgCSR format.

parent 169fd2ef
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ bool tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: setSize( Index new_size )
template< typename Real, tnlDevice Device, typename Index >
bool tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: setNonzeroElements( Index elements )
{
   tnlAssert( elements !=0, );
   if( ! nonzero_elements.setSize(elements) ||  ! columns.setSize(elements) )
      return false;
   nonzero_elements.setValue( 0.0 );
@@ -249,6 +250,7 @@ template< typename Real, tnlDevice Device, typename Index >
bool tnlAdaptiveRgCSRMatrix< Real, Device, Index > :: copyFrom( const tnlCSRMatrix< Real, tnlHost, Index >& mat )
{
	dbgFunctionName( "tnlAdaptiveRgCSRMatrix< Real, tnlHost >", "copyFrom" );
	tnlAssert( cudaBlockSize != 0, );
	if( ! this -> setSize( mat.getSize() ) )
		return false;
	
+3 −3
Original line number Diff line number Diff line
@@ -74,9 +74,9 @@ matrix_solvers_benchmark_dbg_LDADD = ../src/libtnl-0.1.la \
endif

#if BUILD_CUDA
matrix_formats_test_CXXFLAGS = "-DHAVE_CUDA"
sparse_matrix_benchmark_CXXFLAGS += "-DHAVE_CUDA"
tnl_benchmarks_CXXFLAGS = "-DHAVE_CUDA"
matrix_formats_test_CXXFLAGS = -DHAVE_CUDA
sparse_matrix_benchmark_CXXFLAGS += -DHAVE_CUDA
tnl_benchmarks_CXXFLAGS = -DHAVE_CUDA
#endif


+3 −3
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ matrix_formats_test_LDADD = ../src/libtnl-0.1.la \
                            ../src/matrix/libtnlmatrix-0.1.la 

sparse_matrix_benchmark_CXXFLAGS = $(OPTIMISECXXFLAGS) \
	$(CUSP_CXXFLAGS) "-DHAVE_CUDA"
	$(CUSP_CXXFLAGS) -DHAVE_CUDA
sparse_matrix_benchmark_SOURCES = $(sparse_matrix_benchmark_sources)
sparse_matrix_benchmark_LDADD = ../src/libtnl-0.1.la \
                                ../src/core/libtnlcore-0.1.la \
@@ -406,8 +406,8 @@ reorder_csr_SOURCES = ReorderCSR.cpp


#if BUILD_CUDA
matrix_formats_test_CXXFLAGS = "-DHAVE_CUDA"
tnl_benchmarks_CXXFLAGS = "-DHAVE_CUDA"
matrix_formats_test_CXXFLAGS = -DHAVE_CUDA
tnl_benchmarks_CXXFLAGS = -DHAVE_CUDA
#endif
check_SCRIPTS = get-matrices \
                convert-matrices \
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ BASE="ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/"
                
PWD=`pwd`
IWD="$PWD"
SPARSE_MATRIX_BENCHMARK="$IWD/sparse-matrix-benchmark"
SPARSE_MATRIX_BENCHMARK="$IWD/sparse-matrix-benchmark-dbg"
STOP_TIME="1"

source ../tnl-env-variables
+8 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
#ifndef SPARSEMATRIXBENCHMARK_H_
#define SPARSEMATRIXBENCHMARK_H_

#define HAVE_CUDA

#include <fstream>
#include <iomanip>
#include <matrix/tnlCSRMatrix.h>
@@ -32,6 +34,8 @@
#include <core/mfuncs.h>
#include <config.h>



#ifdef HAVE_CUSP
#include <cusp-test.h>
#endif
@@ -329,6 +333,7 @@ bool benchmarkMatrix( const tnlString& input_file,
      cout << left << setw( 25 ) << "AdaptiveRow-grouped CSR " << setw( 5 ) << flush;

   tnlAdaptiveRgCSRMatrix< REAL, tnlHost > argcsr_matrix( "argcsr-matrix" );
   argcsr_matrix. setCUDABlockSize( 128 );
   if( argcsr_matrix. copyFrom( csr_matrix ) )
   {
      /*time = stop_time;
@@ -352,9 +357,9 @@ bool benchmarkMatrix( const tnlString& input_file,
         //spmv_cuda_coa_csr_gflops[ block_iter ] = -1.0;
         //return false;
      }
      else
      else*/
         if( verbose )
            cout << right << setw( 12 ) << "OK." << endl;*/
            cout << right << setw( 12 ) << "OK." << endl;

   }
   else
@@ -373,6 +378,7 @@ bool benchmarkMatrix( const tnlString& input_file,
      cout << left << setw( 25 ) << "AdaptiveRow-grouped CSR " << setw( 5 ) << flush;

   tnlAdaptiveRgCSRMatrix< REAL, tnlCuda > cuda_argcsr_matrix( "cuda-argcsr-matrix" );
   cuda_argcsr_matrix. setCUDABlockSize( 128 );

   if( cuda_argcsr_matrix. copyFrom( argcsr_matrix ) )
   {