Commit b936f2a5 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Renaming segmentsReduction to reduceSegments.

parent 9bb000f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ namespace TNL
       * \brief Go over all segments and perform a reduction in each of them.
       */
            template <typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args>
            void segmentsReduction(IndexType first, IndexType last, Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero, Args... args) const;
            void reduceSegments(IndexType first, IndexType last, Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero, Args... args) const;

            template <typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args>
            void allReduction(Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero, Args... args) const;
+3 −3
Original line number Diff line number Diff line
@@ -500,9 +500,9 @@ template< typename Device,
   template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
BiEllpack< Device, Index, IndexAllocator, Organization, WarpSize >::
segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceSegments( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
   this->getConstView().segmentsReduction( first, last, fetch, reduction, keeper, zero, args... );
   this->getConstView().reduceSegments( first, last, fetch, reduction, keeper, zero, args... );
}

template< typename Device,
@@ -515,7 +515,7 @@ void
BiEllpack< Device, Index, IndexAllocator, Organization, WarpSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
   this->segmentsReduction( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
   this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}

template< typename Device,
+5 −5
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ class BiEllpackView
       * \brief Go over all segments and perform a reduction in each of them.
       */
      template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
      void segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
      void reduceSegments( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;

      template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
      void allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
@@ -162,7 +162,7 @@ class BiEllpackView
                int BlockDim,
                typename... Args >
      __device__
      void segmentsReductionKernelWithAllParameters( IndexType gridIdx,
      void reduceSegmentsKernelWithAllParameters( IndexType gridIdx,
                                                     IndexType first,
                                                     IndexType last,
                                                     Fetch fetch,
@@ -178,7 +178,7 @@ class BiEllpackView
                int BlockDim,
                typename... Args >
      __device__
      void segmentsReductionKernel( IndexType gridIdx,
      void reduceSegmentsKernel( IndexType gridIdx,
                                    IndexType first,
                                    IndexType last,
                                    Fetch fetch,
@@ -196,7 +196,7 @@ class BiEllpackView
                int BlockDim,
                typename... Args_ >
      friend __global__
      void BiEllpackSegmentsReductionKernel( View_ chunkedEllpack,
      void BiEllpackreduceSegmentsKernel( View_ chunkedEllpack,
                                             Index_ gridIdx,
                                             Index_ first,
                                             Index_ last,
@@ -207,7 +207,7 @@ class BiEllpackView
                                             Args_... args );

      template< typename Index_, typename Fetch_, int BlockDim_, int WarpSize_, bool B_ >
      friend struct detail::BiEllpackSegmentsReductionDispatcher;
      friend struct details::BiEllpackreduceSegmentsDispatcher;
#endif
};
      } // namespace Segments
+5 −5
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ template< typename Device,
   template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
BiEllpackView< Device, Index, Organization, WarpSize >::
segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceSegments( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
   using RealType = typename detail::FetchLambdaAdapter< Index, Fetch >::ReturnType;
   if( this->getStorageSize() == 0 )
@@ -425,7 +425,7 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reductio
         dim3 cudaGridSize = Cuda::getMaxGridSize();
         if( gridIdx == cudaGrids - 1 )
            cudaGridSize.x = cudaBlocks % Cuda::getMaxGridSize();
         detail::BiEllpackSegmentsReductionKernel< ViewType, IndexType, Fetch, Reduction, ResultKeeper, Real, BlockDim, Args...  >
         details::BiEllpackreduceSegmentsKernel< ViewType, IndexType, Fetch, Reduction, ResultKeeper, Real, BlockDim, Args...  >
            <<< cudaGridSize, cudaBlockSize, sharedMemory >>>
            ( *this, gridIdx, first, last, fetch, reduction, keeper, zero, args... );
         cudaThreadSynchronize();
@@ -444,7 +444,7 @@ void
BiEllpackView< Device, Index, Organization, WarpSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
   this->segmentsReduction( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
   this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}

template< typename Device,
@@ -518,7 +518,7 @@ template< typename Device,
__device__
void
BiEllpackView< Device, Index, Organization, WarpSize >::
segmentsReductionKernelWithAllParameters( IndexType gridIdx,
reduceSegmentsKernelWithAllParameters( IndexType gridIdx,
                                          IndexType first,
                                          IndexType last,
                                          Fetch fetch,
@@ -574,7 +574,7 @@ template< typename Device,
__device__
void
BiEllpackView< Device, Index, Organization, WarpSize >::
segmentsReductionKernel( IndexType gridIdx,
reduceSegmentsKernel( IndexType gridIdx,
                         IndexType first,
                         IndexType last,
                         Fetch fetch,
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ class CSR
       * \brief Go over all segments and perform a reduction in each of them.
       */
      template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
      void segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
      void reduceSegments( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;

      template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
      void allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
Loading