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

Fixing constructor of tnlGrid3D.

Debuging tnlLongVectorCUDA.h.
parent 18af9949
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -53,8 +53,11 @@ template< class T > class tnlLongVectorCUDA : public tnlObject
#ifdef HAVE_CUDA
    : size( _size ), shared_data( false )
   {
	   cerr << "X##" << endl;
      if( name )
         SetName( name );
      cout << "Initiating " << GetName() << endl;
      cerr << "X### " << size + 1 << endl;
      if( cudaMalloc( ( void** ) &data, ( size + 1 ) * sizeof( T ) ) != cudaSuccess  )
      {
         cerr << "Unable to allocate new long vector with size "
@@ -63,6 +66,7 @@ template< class T > class tnlLongVectorCUDA : public tnlObject
         data = NULL;
         abort();
      }
      cerr << "X####" << endl;
      //data ++;
   };
#else
@@ -122,6 +126,7 @@ template< class T > class tnlLongVectorCUDA : public tnlObject
   bool SetNewSize( int _size )
#ifdef HAVE_CUDA
   {
	   cerr << "Setting new size to " << _size << " for " << GetName() << endl;
      if( size == _size ) return true;
      if( ! shared_data )
      {
+3 −3
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@ template< typename T = double > class tnlGrid3D : public tnlField3D< T >
{
   public:

   tnlGrid3D()
   {
   };
   tnlGrid3D( const char* name = 0 )
   : tnlField3D< T >( name )
     {};

   //! Constructor with the grid and the domain dimensions
   /*! @param x_size, @param y_size and @param z_size define the grid dimensions.