Commit 977f08fd authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed __cuda_callable__ from methods in DistributedArrayView,...

Removed __cuda_callable__ from methods in DistributedArrayView, DistributedVectorView and DistributedMatrix

Distributed data structures are not supposed to be passed to device
kernels. Distributed data structures are operated by the host, which
uses the device for parallel processing only in the local data
structures.
parent 87772050
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ public:


   // Initialization by raw data
   __cuda_callable__
   DistributedArrayView( const LocalRangeType& localRange, IndexType globalSize, CommunicationGroup group, LocalViewType localData )
   : localRange(localRange), globalSize(globalSize), group(group), localData(localData)
   {
@@ -56,31 +55,23 @@ public:
                     "The local array size does not match the local range of the distributed array." );
   }

   __cuda_callable__
   DistributedArrayView() = default;

   // Copy-constructor does shallow copy, so views can be passed-by-value into
   // CUDA kernels and they can be captured-by-value in __cuda_callable__
   // lambda functions.
   __cuda_callable__
   // Copy-constructor does shallow copy.
   DistributedArrayView( const DistributedArrayView& ) = default;

   // "Templated copy-constructor" accepting any cv-qualification of Value
   template< typename Value_ >
   __cuda_callable__
   DistributedArrayView( const DistributedArrayView< Value_, Device, Index, Communicator >& );

   // default move-constructor
   __cuda_callable__
   DistributedArrayView( DistributedArrayView&& ) = default;

   // method for rebinding (reinitialization) to raw data
   __cuda_callable__
   void bind( const LocalRangeType& localRange, IndexType globalSize, CommunicationGroup group, LocalViewType localData );

   // Note that you can also bind directly to DistributedArray and other types implicitly
   // convertible to DistributedArrayView.
   __cuda_callable__
   void bind( DistributedArrayView view );

   // binding to local array via raw pointer
@@ -91,13 +82,11 @@ public:
   /**
    * \brief Returns a modifiable view of the array view.
    */
   __cuda_callable__
   ViewType getView();

   /**
    * \brief Returns a non-modifiable view of the array view.
    */
   __cuda_callable__
   ConstViewType getConstView() const;


+0 −5
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ template< typename Value,
          typename Index,
          typename Communicator >
   template< typename Value_ >
__cuda_callable__
DistributedArrayView< Value, Device, Index, Communicator >::
DistributedArrayView( const DistributedArrayView< Value_, Device, Index, Communicator >& view )
: localRange( view.getLocalRange() ),
@@ -35,7 +34,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
void
DistributedArrayView< Value, Device, Index, Communicator >::
bind( const LocalRangeType& localRange, IndexType globalSize, CommunicationGroup group, LocalViewType localData )
@@ -53,7 +51,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
void
DistributedArrayView< Value, Device, Index, Communicator >::
bind( DistributedArrayView view )
@@ -82,7 +79,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
typename DistributedArrayView< Value, Device, Index, Communicator >::ViewType
DistributedArrayView< Value, Device, Index, Communicator >::
getView()
@@ -94,7 +90,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
typename DistributedArrayView< Value, Device, Index, Communicator >::ConstViewType
DistributedArrayView< Value, Device, Index, Communicator >::
getConstView() const
+0 −4
Original line number Diff line number Diff line
@@ -58,12 +58,10 @@ public:
   // In C++14, default constructors cannot be inherited, although Clang
   // and GCC since version 7.0 inherit them.
   // https://stackoverflow.com/a/51854172
   __cuda_callable__
   DistributedVectorView() = default;

   // initialization by base class is not a copy constructor so it has to be explicit
   template< typename Real_ >  // template catches both const and non-const qualified Element
   __cuda_callable__
   DistributedVectorView( const Containers::DistributedArrayView< Real_, Device, Index, Communicator >& view )
   : BaseType( view ) {}

@@ -74,13 +72,11 @@ public:
   /**
    * \brief Returns a modifiable view of the array view.
    */
   __cuda_callable__
   ViewType getView();

   /**
    * \brief Returns a non-modifiable view of the array view.
    */
   __cuda_callable__
   ConstViewType getConstView() const;

   /*
+0 −2
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
typename DistributedVectorView< Value, Device, Index, Communicator >::ViewType
DistributedVectorView< Value, Device, Index, Communicator >::
getView()
@@ -56,7 +55,6 @@ template< typename Value,
          typename Device,
          typename Index,
          typename Communicator >
__cuda_callable__
typename DistributedVectorView< Value, Device, Index, Communicator >::ConstViewType
DistributedVectorView< Value, Device, Index, Communicator >::
getConstView() const
+0 −9
Original line number Diff line number Diff line
@@ -72,16 +72,12 @@ public:

   void setDistribution( LocalRangeType localRowRange, IndexType rows, IndexType columns, CommunicationGroup group = Communicator::AllGroup );

   __cuda_callable__
   const LocalRangeType& getLocalRowRange() const;

   __cuda_callable__
   CommunicationGroup getCommunicationGroup() const;

   __cuda_callable__
   const Matrix& getLocalMatrix() const;

   __cuda_callable__
   Matrix& getLocalMatrix();


@@ -99,10 +95,8 @@ public:

   void reset();

   __cuda_callable__
   IndexType getRows() const;

   __cuda_callable__
   IndexType getColumns() const;

   template< typename RowCapacitiesVector >
@@ -120,14 +114,11 @@ public:
   RealType getElement( IndexType row,
                        IndexType column ) const;

   __cuda_callable__
   RealType getElementFast( IndexType row,
                            IndexType column ) const;

   __cuda_callable__
   MatrixRow getRow( IndexType row );

   __cuda_callable__
   ConstMatrixRow getRow( IndexType row ) const;

   // multiplication with a global vector
Loading