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

Debuging smart pointers.

parent 87c55031
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ class tnlSharedPointer< Object, tnlHost > : public tnlSmartPointer
         return *this;
      }      
      
      const ThisType& operator=( ThisType&& ptr )
      const ThisType& operator=( const ThisType&& ptr )
      {
         if( this-> pointer )
            delete this->pointer;
@@ -153,7 +153,7 @@ class tnlSharedPointer< Object, tnlCuda > : public tnlSmartPointer
      
      typedef Object ObjectType;
      typedef tnlHost DeviceType;
      typedef tnlSharedPointer< Object, tnlHost > ThisType;
      typedef tnlSharedPointer< Object, tnlCuda > ThisType;

      explicit  tnlSharedPointer()
      : counter( 0 ), cuda_pointer( 0 ), 
@@ -254,7 +254,6 @@ class tnlSharedPointer< Object, tnlCuda > : public tnlSmartPointer
      
      const ThisType& operator=( const ThisType& ptr )
      {
         std::cerr << "Op. = " << std::endl;
         this->free();
         this->pointer = ptr.pointer;
         this->cuda_pointer = ptr.cuda_pointer;
@@ -268,7 +267,7 @@ class tnlSharedPointer< Object, tnlCuda > : public tnlSmartPointer
      bool synchronize()
      {
#ifdef HAVE_CUDA
         /*if( this->modified )
         if( this->modified )
         {
            std::cerr << "Synchronizing data..." << std::endl;
            tnlAssert( this->pointer, );
@@ -277,7 +276,7 @@ class tnlSharedPointer< Object, tnlCuda > : public tnlSmartPointer
            if( ! checkCudaDevice )
               return false;
            return true;
         }*/
         }
#else         
         return false;
#endif         
+6 −6
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ tnlGridTraverser2D(
   
   GridEntity entity( *grid, coordinates, *entityOrientation, *entityBasis );
   
   /*if( entity.getCoordinates().x() <= end->x() &&
   if( entity.getCoordinates().x() <= end->x() &&
       entity.getCoordinates().y() <= end->y() )
   {
      entity.refresh();
@@ -318,7 +318,7 @@ tnlGridTraverser2D(
           *userData,
           entity );
      }
   }*/
   }
}
#endif

@@ -346,7 +346,7 @@ processEntities(
   CoordinatesType* kernelEnd = tnlCuda::passToDevice( end );
   CoordinatesType* kernelEntityOrientation = tnlCuda::passToDevice( entityOrientation );
   CoordinatesType* kernelEntityBasis = tnlCuda::passToDevice( entityBasis );
   typename GridEntity::MeshType* kernelGrid = tnlCuda::passToDevice( *gridPointer );
   //typename GridEntity::MeshType* kernelGrid = tnlCuda::passToDevice( *gridPointer );
   UserData* kernelUserData = tnlCuda::passToDevice( userData );
   checkCudaDevice;
      
@@ -358,12 +358,12 @@ processEntities(
   const IndexType cudaYGrids = tnlCuda::getNumberOfGrids( cudaBlocks.y );

   
   //tnlCuda::synchronizeDevice();
   tnlCuda::synchronizeDevice();
   for( IndexType gridYIdx = 0; gridYIdx < cudaYGrids; gridYIdx ++ )
      for( IndexType gridXIdx = 0; gridXIdx < cudaXGrids; gridXIdx ++ )
         tnlGridTraverser2D< Real, Index, GridEntity, UserData, EntitiesProcessor, processOnlyBoundaryEntities >
            <<< cudaBlocks, cudaBlockSize >>>
            ( kernelGrid, //&gridPointer.template getData< tnlCuda >(),
            ( &gridPointer.template getData< tnlCuda >(),
              kernelUserData,
              kernelBegin,
              kernelEnd,
@@ -374,7 +374,7 @@ processEntities(
      
   cudaThreadSynchronize();
   checkCudaDevice;
   tnlCuda::freeFromDevice( kernelGrid );
   //tnlCuda::freeFromDevice( kernelGrid );
   tnlCuda::freeFromDevice( kernelBegin );
   tnlCuda::freeFromDevice( kernelEnd );
   tnlCuda::freeFromDevice( kernelEntityOrientation );