Commit 25ebfde3 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed bugs in smart pointers

parent 1fa4cefe
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer
   public:

      typedef Object ObjectType;
      typedef Devices::Host DeviceType;
      typedef Devices::Cuda DeviceType;
      typedef DevicePointer< Object, Devices::Cuda > ThisType;

      explicit  DevicePointer( ObjectType& obj )
@@ -425,9 +425,6 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer
      bool modified;

      int* counter;

      template< typename Object_, typename Device_ >
      friend class DevicePointer;
};

} // namespace TNL
+5 −5
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer
                                      std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >;

      // friend class will be needed for templated assignment operators
      template< typename Object_, typename Device_ >
      friend class DevicePointer;
      template< typename Object_, typename Device_, bool lazy_ >
      friend class SharedPointer;

   public:

@@ -292,13 +292,13 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer
                                      std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >;

      // friend class will be needed for templated assignment operators
      template< typename Object_, typename Device_ >
      friend class DevicePointer;
      template< typename Object_, typename Device_, bool lazy_ >
      friend class SharedPointer;

   public:

      typedef Object ObjectType;
      typedef Devices::Host DeviceType;
      typedef Devices::Cuda DeviceType;
      typedef SharedPointer< Object, Devices::Cuda, lazy > ThisType;

      template< typename... Args >
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer
   public:
      
      typedef Object ObjectType;
      typedef Devices::Host DeviceType;
      typedef Devices::Cuda DeviceType;
      typedef UniquePointer< Object, Devices::Host > ThisType;
         
      template< typename... Args >