Skip to content
Snippets Groups Projects
Commit a006571b authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Renaming allReduction to reduceAllSegments.

parent b936f2a5
No related branches found
No related tags found
1 merge request!105TO/matrices-adaptive-csr
Showing
with 22 additions and 22 deletions
......@@ -119,7 +119,7 @@ namespace TNL
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;
void reduceAllSegments(Fetch &fetch, const Reduction &reduction, ResultKeeper &keeper, const Real &zero, Args... args) const;
BiEllpack &operator=(const BiEllpack &source) = default;
......
......@@ -513,7 +513,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
BiEllpack< Device, Index, IndexAllocator, Organization, WarpSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -130,7 +130,7 @@ class BiEllpackView
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
BiEllpackView& operator=( const BiEllpackView& view );
......
......@@ -442,7 +442,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
BiEllpackView< Device, Index, Organization, WarpSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -127,7 +127,7 @@ class CSR
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
CSR& operator=( const CSR& rhsSegments ) = default;
......
......@@ -290,7 +290,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
CSR< Device, Index, Kernel, IndexAllocator >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -124,7 +124,7 @@ class CSRView
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
CSRView& operator=( const CSRView& view );
......
......@@ -258,7 +258,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
CSRView< Device, Index, Kernel >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -115,7 +115,7 @@ class ChunkedEllpack
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
ChunkedEllpack& operator=( const ChunkedEllpack& source ) = default;
......
......@@ -455,7 +455,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
ChunkedEllpack< Device, Index, IndexAllocator, Organization >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -144,7 +144,7 @@ class ChunkedEllpackView
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
ChunkedEllpackView& operator=( const ChunkedEllpackView& view );
......
......@@ -470,7 +470,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
ChunkedEllpackView< Device, Index, Organization >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -115,7 +115,7 @@ class Ellpack
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
Ellpack& operator=( const Ellpack& source ) = default;
......
......@@ -320,7 +320,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
Ellpack< Device, Index, IndexAllocator, Organization, Alignment >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -114,7 +114,7 @@ class EllpackView
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
EllpackView& operator=( const EllpackView& view );
......
......@@ -316,7 +316,7 @@ template< typename Device,
int Alignment >
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void EllpackView< Device, Index, Organization, Alignment >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -112,7 +112,7 @@ class SlicedEllpack
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
SlicedEllpack& operator=( const SlicedEllpack& source ) = default;
......
......@@ -152,8 +152,8 @@ setSegmentsSizes( const SizesHolder& sizes )
slices_view[ i ] = res * SliceSize;
slice_segment_size_view[ i ] = res;
};
ellpack.allReduction( fetch, reduce, keep, std::numeric_limits< IndexType >::min() );
inplaceExclusiveScan( this->sliceOffsets );
ellpack.reduceAllSegments( fetch, reduce, keep, std::numeric_limits< IndexType >::min() );
this->sliceOffsets.template scan< Algorithms::ScanType::Exclusive >();
this->size = sum( sizes );
this->alignedSize = this->sliceOffsets.getElement( slicesCount );
}
......@@ -354,7 +354,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
SlicedEllpack< Device, Index, IndexAllocator, Organization, SliceSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
......@@ -113,7 +113,7 @@ class SlicedEllpackView
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;
void reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const;
SlicedEllpackView& operator=( const SlicedEllpackView& view );
......
......@@ -378,7 +378,7 @@ template< typename Device,
template< typename Fetch, typename Reduction, typename ResultKeeper, typename Real, typename... Args >
void
SlicedEllpackView< Device, Index, Organization, SliceSize >::
allReduction( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
reduceAllSegments( Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
{
this->reduceSegments( 0, this->getSegmentsCount(), fetch, reduction, keeper, zero, args... );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment