Loading src/TNL/Pointers/SharedPointerCuda.h +5 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <cstring> // std::memcpy, std::memcmp #include <cstddef> // std::nullptr_t #include <algorithm> // swap //#define TNL_DEBUG_SHARED_POINTERS Loading Loading @@ -67,7 +68,7 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::Cuda; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::Cuda >; SharedPointer( std::nullptr_t ) : pd( nullptr ) Loading Loading @@ -321,7 +322,7 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::Cuda; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::Cuda >; SharedPointer( std::nullptr_t ) : pd( nullptr ), Loading src/TNL/Pointers/SharedPointerHost.h +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <TNL/Pointers/SmartPointer.h> #include <cstddef> // std::nullptr_t #include <algorithm> // swap namespace TNL { namespace Pointers { Loading src/TNL/Pointers/SharedPointerMic.h +4 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <cstring> // std::memcpy, std::memcmp #include <cstddef> // std::nullptr_t #include <algorithm> // swap namespace TNL { namespace Pointers { Loading @@ -44,7 +45,7 @@ class SharedPointer< Object, Devices::MIC > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::MIC; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::MIC >; SharedPointer( std::nullptr_t ) : pd( nullptr ), Loading src/UnitTests/Pointers/SharedPointerCudaTest.cu +13 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,19 @@ TEST( SharedPointerCudaTest, nullptrAssignement ) #endif } TEST( SharedPointerCudaTest, swap ) { #ifdef HAVE_CUDA using TestType = Pointers::SharedPointer< double, Devices::Cuda >; TestType p1( 1 ), p2( 2 ); p1.swap( p2 ); ASSERT_EQ( *p1, 2 ); ASSERT_EQ( *p2, 1 ); #endif } #endif Loading src/UnitTests/Pointers/SharedPointerHostTest.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,17 @@ TEST( SharedPointerCudaTest, nullptrAssignement ) ASSERT_FALSE( p2 ); } TEST( SharedPointerCudaTest, swap ) { using TestType = Pointers::SharedPointer< double, Devices::Host >; TestType p1( 1 ), p2( 2 ); p1.swap( p2 ); ASSERT_EQ( *p1, 2 ); ASSERT_EQ( *p2, 1 ); } #endif #include "../GtestMissingError.h" Loading Loading
src/TNL/Pointers/SharedPointerCuda.h +5 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <cstring> // std::memcpy, std::memcmp #include <cstddef> // std::nullptr_t #include <algorithm> // swap //#define TNL_DEBUG_SHARED_POINTERS Loading Loading @@ -67,7 +68,7 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::Cuda; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::Cuda >; SharedPointer( std::nullptr_t ) : pd( nullptr ) Loading Loading @@ -321,7 +322,7 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::Cuda; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::Cuda >; SharedPointer( std::nullptr_t ) : pd( nullptr ), Loading
src/TNL/Pointers/SharedPointerHost.h +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <TNL/Pointers/SmartPointer.h> #include <cstddef> // std::nullptr_t #include <algorithm> // swap namespace TNL { namespace Pointers { Loading
src/TNL/Pointers/SharedPointerMic.h +4 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <cstring> // std::memcpy, std::memcmp #include <cstddef> // std::nullptr_t #include <algorithm> // swap namespace TNL { namespace Pointers { Loading @@ -44,7 +45,7 @@ class SharedPointer< Object, Devices::MIC > : public SmartPointer using ObjectType = Object; using DeviceType = Devices::MIC; using ThisType = SharedPointer< Object, Devices::Host >; using ThisType = SharedPointer< Object, Devices::MIC >; SharedPointer( std::nullptr_t ) : pd( nullptr ), Loading
src/UnitTests/Pointers/SharedPointerCudaTest.cu +13 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,19 @@ TEST( SharedPointerCudaTest, nullptrAssignement ) #endif } TEST( SharedPointerCudaTest, swap ) { #ifdef HAVE_CUDA using TestType = Pointers::SharedPointer< double, Devices::Cuda >; TestType p1( 1 ), p2( 2 ); p1.swap( p2 ); ASSERT_EQ( *p1, 2 ); ASSERT_EQ( *p2, 1 ); #endif } #endif Loading
src/UnitTests/Pointers/SharedPointerHostTest.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,17 @@ TEST( SharedPointerCudaTest, nullptrAssignement ) ASSERT_FALSE( p2 ); } TEST( SharedPointerCudaTest, swap ) { using TestType = Pointers::SharedPointer< double, Devices::Host >; TestType p1( 1 ), p2( 2 ); p1.swap( p2 ); ASSERT_EQ( *p1, 2 ); ASSERT_EQ( *p2, 1 ); } #endif #include "../GtestMissingError.h" Loading