Loading src/TNL/DevicePointer.h +12 −12 Original line number Diff line number Diff line Loading @@ -210,8 +210,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer typedef DevicePointer< Object, Devices::Cuda > ThisType; explicit DevicePointer( ObjectType& obj ) : counter( 0 ), cuda_pointer( 0 ), pointer( 0 ), modified( false ) : pointer( 0 ), cuda_pointer( 0 ), counter( 0 ), modified( false ) { this->counter = new int( 1 ); this->pointer = &obj; Loading Loading @@ -252,8 +252,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } // conditional constructor for non-const -> const data Loading @@ -267,8 +267,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } const Object* operator->() const Loading Loading @@ -335,8 +335,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; return *this; } Loading @@ -349,8 +349,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; return *this; } Loading @@ -361,12 +361,12 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; return *this; } Loading @@ -378,12 +378,12 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; return *this; } Loading Loading @@ -432,9 +432,9 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer Object *pointer, *cuda_pointer; bool modified; int* counter; bool modified; }; } // namespace TNL src/TNL/SharedPointer.h +12 −12 Original line number Diff line number Diff line Loading @@ -308,8 +308,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer template< typename... Args > explicit SharedPointer( Args... args ) : counter( 0 ), cuda_pointer( 0 ), pointer( 0 ), modified( false ) : pointer( 0 ), cuda_pointer( 0 ), counter( 0 ), modified( false ) { if( ! lazy ) { Loading Loading @@ -356,8 +356,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } // conditional constructor for non-const -> const data Loading @@ -371,8 +371,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } template< typename... Args > Loading Loading @@ -480,8 +480,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Copy-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; Loading @@ -497,8 +497,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Copy-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; Loading @@ -512,12 +512,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Move-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; #endif Loading @@ -532,12 +532,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Move-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; #endif Loading Loading @@ -601,9 +601,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer Object *pointer, *cuda_pointer; bool modified; int* counter; bool modified; }; } // namespace TNL Loading
src/TNL/DevicePointer.h +12 −12 Original line number Diff line number Diff line Loading @@ -210,8 +210,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer typedef DevicePointer< Object, Devices::Cuda > ThisType; explicit DevicePointer( ObjectType& obj ) : counter( 0 ), cuda_pointer( 0 ), pointer( 0 ), modified( false ) : pointer( 0 ), cuda_pointer( 0 ), counter( 0 ), modified( false ) { this->counter = new int( 1 ); this->pointer = &obj; Loading Loading @@ -252,8 +252,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } // conditional constructor for non-const -> const data Loading @@ -267,8 +267,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } const Object* operator->() const Loading Loading @@ -335,8 +335,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; return *this; } Loading @@ -349,8 +349,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; return *this; } Loading @@ -361,12 +361,12 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; return *this; } Loading @@ -378,12 +378,12 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; return *this; } Loading Loading @@ -432,9 +432,9 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer Object *pointer, *cuda_pointer; bool modified; int* counter; bool modified; }; } // namespace TNL
src/TNL/SharedPointer.h +12 −12 Original line number Diff line number Diff line Loading @@ -308,8 +308,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer template< typename... Args > explicit SharedPointer( Args... args ) : counter( 0 ), cuda_pointer( 0 ), pointer( 0 ), modified( false ) : pointer( 0 ), cuda_pointer( 0 ), counter( 0 ), modified( false ) { if( ! lazy ) { Loading Loading @@ -356,8 +356,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } // conditional constructor for non-const -> const data Loading @@ -371,8 +371,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer { pointer.pointer = nullptr; pointer.cuda_pointer = nullptr; pointer.modified = false; pointer.counter = nullptr; pointer.modified = false; } template< typename... Args > Loading Loading @@ -480,8 +480,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Copy-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; Loading @@ -497,8 +497,8 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; *( this->counter ) += 1; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Copy-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; Loading @@ -512,12 +512,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Move-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; #endif Loading @@ -532,12 +532,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer this->free(); this->pointer = ptr.pointer; this->cuda_pointer = ptr.cuda_pointer; this->modified = ptr.modified; this->counter = ptr.counter; this->modified = ptr.modified; ptr.pointer = nullptr; ptr.cuda_pointer = nullptr; ptr.modified = false; ptr.counter = nullptr; ptr.modified = false; #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Move-assigned shared pointer: counter = " << *(this->counter) << ", type: " << demangle(typeid(ObjectType).name()) << std::endl; #endif Loading Loading @@ -601,9 +601,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer Object *pointer, *cuda_pointer; bool modified; int* counter; bool modified; }; } // namespace TNL