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

Debuging the heat equation solver for CUDA.

parent b056f164
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ class tnlHeatEquationEocRhs

      template< typename Vertex,
                typename Real >
#ifdef HAVE_CUDA
      __device__ __host__
#endif
      Real getValue( const Vertex& vertex,
                     const Real& time ) const
      {
+5 −2
Original line number Diff line number Diff line
@@ -77,15 +77,18 @@ class tnlCuda
   static ObjectType* passToDevice( const ObjectType& object );

   template< typename ObjectType >
   static ObjectType passFromDevice( const ObjectType& object );
   static ObjectType passFromDevice( const ObjectType* object );

   template< typename ObjectType >
   static void passFromDevice( const ObjectType& deviceObject,
   static void passFromDevice( const ObjectType* deviceObject,
                               ObjectType& hostObject );

   template< typename ObjectType >
   static void freeFromDevice( ObjectType* object );

   template< typename ObjectType >
   static void print( const ObjectType* object, ostream& str = std::cout );

#ifdef HAVE_CUDA
   template< typename Index >
   static __device__ Index getInterleaving( const Index index );
+9 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#ifndef TNLCONSTANTFUNCTION_H_
#define TNLCONSTANTFUNCTION_H_

#include <iostream>
#include <core/vectors/tnlStaticVector.h>

template< int FunctionDimensions,
@@ -74,6 +75,14 @@ class tnlConstantFunction
   RealType constant;
};

template< int FunctionDimensions,
          typename Real >
std::ostream& operator << ( std::ostream& str, const tnlConstantFunction< FunctionDimensions, Real >& f )
{
   str << "Constant function: constant = " << f.getConstant();
   return str;
}

#include <implementation/functions/tnlConstantFunction_impl.h>

#endif /* TNLCONSTANTFUNCTION_H_ */
+8 −0
Original line number Diff line number Diff line
@@ -143,6 +143,14 @@ class tnlExpBumpFunction< 3, Real > : public tnlExpBumpFunctionBase< Real >
                         const Real& time = 0.0 ) const;
};

template< int Dimensions,
          typename Real >
ostream& operator << ( ostream& str, const tnlExpBumpFunction< Dimensions, Real >& f )
{
   str << "ExpBump. function: amplitude = " << f.getAmplitude() << " sigma = " << f.getSigma();
   return str;
}

#include <implementation/functions/tnlExpBumpFunction_impl.h>


+11 −0
Original line number Diff line number Diff line
@@ -153,6 +153,17 @@ class tnlSinBumpsFunction< 3, Real > : public tnlSinBumpsFunctionBase< tnlStatic
                         const Real& time = 0.0 ) const;
};

template< int Dimensions,
          typename Real >
ostream& operator << ( ostream& str, const tnlSinBumpsFunction< Dimensions, Real >& f )
{
   str << "Sin Bumps. function: amplitude = " << f.getAmplitude()
       << " wavelength = " << f.getWaveLength()
       << " phase = " << f.getPhase();
   return str;
}


#include <implementation/functions/tnlSinBumpsFunction_impl.h>


Loading