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

Debuging the code to be compatible with nvcc.

parent 2ee50b69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

TARGET=TNL
INSTALL_PREFIX=${HOME}/local
WITH_CUDA=no
WITH_CUDA=yes
WITH_CUSPARSE=no
CUDA_ARCHITECTURE=2.0
TEMPLATE_EXPLICIT_INSTANTIATION=yes
+14 −0
Original line number Diff line number Diff line
@@ -121,10 +121,17 @@ template< typename Real,
          typename Index >
bool tnlMatrix< Real, Device, Index >::save( tnlFile& file ) const
{
#ifdef HAVE_NOT_CXX11
   if( ! tnlObject::save( file ) ||
       ! file.write< IndexType, tnlHost, Index >( &this->rows, 1 ) ||
       ! file.write< IndexType, tnlHost, Index >( &this->columns, 1 ) )
      return false;
#else   
   if( ! tnlObject::save( file ) ||
       ! file.write( &this->rows ) ||
       ! file.write( &this->columns ) )
      return false;
#endif      
   return true;
}

@@ -133,10 +140,17 @@ template< typename Real,
          typename Index >
bool tnlMatrix< Real, Device, Index >::load( tnlFile& file )
{
#ifdef HAVE_NOT_CXX11
   if( ! tnlObject::load( file ) ||
       ! file.read< IndexType, tnlHost, Index >( &this->rows, 1 ) ||
       ! file.read< IndexType, tnlHost, Index >( &this->columns, 1 ) )
      return false;
#else   
   if( ! tnlObject::load( file ) ||
       ! file.read( &this->rows ) ||
       ! file.read( &this->columns ) )
      return false;
#endif      
   return true;
}

+3 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
#include <core/tnlHost.h>
#include <core/tnlCuda.h>

using namespace std;

/****
 * In this code we do not use constants and references as we would like to.
 * OpenMP would complain that
@@ -209,7 +211,7 @@ bool tnlMersonSolver< Problem > :: solve( DofVectorType& u )
         return true;
       }
      if( iteration == this -> getMaxIterationsNumber() ||
          std::isnan( residue ) )
          isnan( residue ) )
         return false;
   }
};
+14 −0
Original line number Diff line number Diff line
@@ -104,15 +104,29 @@ class tnlDenseMatrix : public tnlMatrix< Real, Device, Index >,
                   const RealType& matrixMultiplicator = 1.0,
                   const RealType& thisMatrixMultiplicator = 1.0 );

#ifdef HAVE_NOT_CXX11
   template< typename Matrix1, typename Matrix2, int tileDim >
   void getMatrixProduct( const Matrix1& matrix1,
                       const Matrix2& matrix2,
                       const RealType& matrix1Multiplicator = 1.0,
                       const RealType& matrix2Multiplicator = 1.0 );
#else
   template< typename Matrix1, typename Matrix2, int tileDim = 32 >
   void getMatrixProduct( const Matrix1& matrix1,
                       const Matrix2& matrix2,
                       const RealType& matrix1Multiplicator = 1.0,
                       const RealType& matrix2Multiplicator = 1.0 );
#endif   

#ifdef HAVE_NOT_CXX11
   template< typename Matrix, int tileDim >
   void getTransposition( const Matrix& matrix,
                          const RealType& matrixMultiplicator = 1.0 );
#else
   template< typename Matrix, int tileDim = 32 >
   void getTransposition( const Matrix& matrix,
                          const RealType& matrixMultiplicator = 1.0 );
#endif

   template< typename Vector >
   void performSORIteration( const Vector& b,
+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#ifndef SPARSEMATRIXBENCHMARK_H_
#define SPARSEMATRIXBENCHMARK_H_


#include <fstream>
#include <iomanip>
#include <config/tnlConfigDescription.h>
Loading