diff --git a/src/TNL/DevicePointer.h b/src/TNL/DevicePointer.h index fab718cf1d5be52af40d1f54bf7b60634095e1c1..23aaa54f5ed67c70ac51361fcd563341b589954e 100644 --- a/src/TNL/DevicePointer.h +++ b/src/TNL/DevicePointer.h @@ -119,6 +119,12 @@ class DevicePointer< Object, Devices::Host > : public SmartPointer return this->pointer; } + __cuda_callable__ + bool operator!() const + { + return ! this->pointer; + } + template< typename Device = Devices::Host > __cuda_callable__ const Object& getData() const @@ -287,6 +293,12 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer return this->pd; } + __cuda_callable__ + bool operator!() const + { + return ! this->pd; + } + template< typename Device = Devices::Host > __cuda_callable__ const Object& getData() const diff --git a/src/TNL/SharedPointer.h b/src/TNL/SharedPointer.h index c1a3e063477cfe04d8d64bd9144a203e676ebee5..addf6ab70c2f4ac1e05ae119d9e4ea41c1254f17 100644 --- a/src/TNL/SharedPointer.h +++ b/src/TNL/SharedPointer.h @@ -167,6 +167,12 @@ class SharedPointer< Object, Devices::Host > : public SmartPointer return this->pd; } + __cuda_callable__ + bool operator!() const + { + return ! this->pd; + } + template< typename Device = Devices::Host > __cuda_callable__ const Object& getData() const @@ -402,6 +408,12 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer return this->pd; } + __cuda_callable__ + bool operator!() const + { + return ! this->pd; + } + template< typename Device = Devices::Host > __cuda_callable__ const Object& getData() const diff --git a/src/TNL/UniquePointer.h b/src/TNL/UniquePointer.h index 01765d51b16baa65e460b1dd639ebef363cc633c..419bb67659b06e43110afd969ed699c2fadbb877 100644 --- a/src/TNL/UniquePointer.h +++ b/src/TNL/UniquePointer.h @@ -67,6 +67,12 @@ class UniquePointer< Object, Devices::Host > : public SmartPointer return this->pointer; } + __cuda_callable__ + bool operator!() const + { + return ! this->pointer; + } + template< typename Device = Devices::Host > const Object& getData() const { @@ -155,6 +161,12 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer return this->pd; } + __cuda_callable__ + bool operator!() const + { + return ! this->pd; + } + template< typename Device = Devices::Host > const Object& getData() const {