Commit 6c37ac30 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed operator bool from DistributedArray and DistributedArrayView

parent bd87fc2c
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -365,6 +365,14 @@ class Array
       */
      void reset();

      /**
       * \brief Returns \e true if the current array size is zero.
       *
       * This method can be called from device kernels.
       */
      __cuda_callable__
      bool empty() const;

      /**
       * \brief Returns a \e const-qualified raw pointer to the data.
       *
@@ -599,14 +607,6 @@ class Array
                              IndexType begin = 0,
                              IndexType end = 0 ) const;

      /**
       * \brief Returns \e true if the current array size is zero.
       *
       * This method can be called from device kernels.
       */
      __cuda_callable__
      bool empty() const;

      /**
       * \brief Method for saving the array to a binary file \e fileName.
       *
+12 −12
Original line number Diff line number Diff line
@@ -436,6 +436,18 @@ reset()
   this->releaseData();
}

template< typename Value,
          typename Device,
          typename Index,
          typename Allocator >
bool
__cuda_callable__
Array< Value, Device, Index, Allocator >::
empty() const
{
   return data == nullptr;
}

template< typename Value,
          typename Device,
          typename Index,
@@ -719,18 +731,6 @@ containsOnlyValue( const ValueType& v,
   return Algorithms::ArrayOperations< Device >::containsOnlyValue( &this->getData()[ begin ], end - begin, v );
}

template< typename Value,
          typename Device,
          typename Index,
          typename Allocator >
bool
__cuda_callable__
Array< Value, Device, Index, Allocator >::
empty() const
{
   return ( data == nullptr );
}

template< typename Value,
          typename Device,
          typename Index,
+8 −8
Original line number Diff line number Diff line
@@ -246,6 +246,14 @@ public:
   __cuda_callable__
   void reset();

   /**
    * \brief Returns \e true if the current array view size is zero.
    *
    * This method can be called from device kernels.
    */
   __cuda_callable__
   bool empty() const;

   /**
    * \brief Returns a \e const-qualified raw pointer to the data.
    *
@@ -441,14 +449,6 @@ public:
                           const Index begin = 0,
                           Index end = 0  ) const;

   /**
    * \brief Returns \e true if the current array view size is zero.
    *
    * This method can be called from device kernels.
    */
   __cuda_callable__
   bool empty() const;

   /**
    * \brief Method for saving the data to a binary file \e fileName.
    *
+11 −11
Original line number Diff line number Diff line
@@ -165,6 +165,17 @@ reset()
   size = 0;
}

template< typename Value,
          typename Device,
          typename Index >
__cuda_callable__
bool
ArrayView< Value, Device, Index >::
empty() const
{
   return data == nullptr;
}

template< typename Value,
          typename Device,
          typename Index >
@@ -360,17 +371,6 @@ containsOnlyValue( Value value,
   return Algorithms::ArrayOperations< Device >::containsOnlyValue( &this->getData()[ begin ], end - begin, value );
}

template< typename Value,
          typename Device,
          typename Index >
__cuda_callable__
bool
ArrayView< Value, Device, Index >::
empty() const
{
   return ( data == nullptr );
}

template< typename Value, typename Device, typename Index >
std::ostream& operator<<( std::ostream& str, const ArrayView< Value, Device, Index >& view )
{
+4 −3
Original line number Diff line number Diff line
@@ -134,8 +134,12 @@ public:
   template< typename Array >
   void setLike( const Array& array );

   // Resets the array to the empty state.
   void reset();

   // Returns true if the current array size is zero.
   bool empty() const;

   // TODO: swap

   // Returns the *global* size
@@ -177,9 +181,6 @@ public:
   // Checks if all elements in this array have the same given value
   bool containsOnlyValue( ValueType value ) const;

   // Returns true iff non-zero size is set
   operator bool() const;

   // TODO: serialization (save, load)

protected:
Loading