DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar > Class Template Reference

This class encapsulates the reduction variable/accessor, the reduction operator and an optional operator identity. More...

#include <sycl/reduction.hpp>

Inheritance diagram for sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >:
Collaboration diagram for sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >:

Public Types

using reducer_type = typename algo::reducer_type
 
- Public Types inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >
using reducer_type = reducer< T, BinaryOperation, Dims, Extent >
 
using result_type = T
 
using binary_operation = BinaryOperation
 

Public Member Functions

template<typename _self = self, enable_if_t< _self::is_known_identity > * = nullptr>
 reduction_impl (RedOutVar Var, bool InitializeToIdentity=false)
 Constructs reduction_impl when the identity value is statically known. More...
 
 reduction_impl (RedOutVar &Var, const T &Identity, BinaryOperation BOp, bool InitializeToIdentity)
 Constructs reduction_impl when the identity value is unknown. More...
 
- Public Member Functions inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >
 reduction_impl_algo (const T &Identity, BinaryOperation BinaryOp, bool Init, RedOutVar RedOut)
 
auto getReadAccToPreviousPartialReds (handler &CGH) const
 
template<bool IsOneWG>
auto getWriteMemForPartialReds (size_t Size, handler &CGH)
 
template<class _T = T>
auto & getTempBuffer (size_t Size, handler &CGH)
 
auto getWriteAccForPartialReds (size_t Size, handler &CGH)
 Returns an accessor accessing the memory that will hold the reduction partial sums. More...
 
template<typename KernelName , typename FuncTy >
void withInitializedMem (handler &CGH, FuncTy Func)
 Provide Func with a properly initialized memory to write the reduction result to. More...
 
accessor< int, 1, access::mode::read_write, access::target::device, access::placeholder::false_tgetReadWriteAccessorToInitializedGroupsCounter (handler &CGH)
 
auto getGroupsCounterAccDiscrete (handler &CGH)
 
RedOutVar & getUserRedVar ()
 
- Public Member Functions inherited from sycl::_V1::detail::reduction_impl_common< T, BinaryOperation >
template<typename _T = T, class _BinaryOperation = BinaryOperation>
constexpr enable_if_t< IsKnownIdentityOp< _T, _BinaryOperation >::value, _T > getIdentity ()
 Returns the statically known identity value. More...
 
template<typename _T = T, class _BinaryOperation = BinaryOperation>
enable_if_t<!IsKnownIdentityOp< _T, _BinaryOperation >::value, _T > getIdentity ()
 Returns the identity value given by user. More...
 
BinaryOperation getBinaryOperation () const
 Returns the binary operation associated with the reduction. More...
 
bool initializeToIdentity () const
 

Static Public Attributes

static constexpr bool is_usm
 
- Static Public Attributes inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >
static constexpr size_t dims = Dims
 
static constexpr bool has_float64_atomics
 
static constexpr bool has_fast_atomics
 
static constexpr bool has_fast_reduce
 
static constexpr bool is_usm = std::is_same_v<RedOutVar, T *>
 
static constexpr size_t num_elements = Extent
 

Additional Inherited Members

- Protected Member Functions inherited from sycl::_V1::detail::reduction_impl_common< T, BinaryOperation >
 reduction_impl_common (const T &Identity, BinaryOperation BinaryOp, bool Init=false)
 
- Protected Attributes inherited from sycl::_V1::detail::reduction_impl_common< T, BinaryOperation >
const T MIdentity
 Identity of the BinaryOperation. More...
 
BinaryOperation MBinaryOp
 
bool InitializeToIdentity
 

Detailed Description

template<typename T, class BinaryOperation, int Dims, size_t Extent, typename RedOutVar>
class sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >

This class encapsulates the reduction variable/accessor, the reduction operator and an optional operator identity.

Definition at line 810 of file reduction.hpp.

Member Typedef Documentation

◆ reducer_type

template<typename T , class BinaryOperation , int Dims, size_t Extent, typename RedOutVar >
using sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >::reducer_type = typename algo::reducer_type

Definition at line 844 of file reduction.hpp.

Constructor & Destructor Documentation

◆ reduction_impl() [1/2]

template<typename T , class BinaryOperation , int Dims, size_t Extent, typename RedOutVar >
template<typename _self = self, enable_if_t< _self::is_known_identity > * = nullptr>
sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >::reduction_impl ( RedOutVar  Var,
bool  InitializeToIdentity = false 
)
inline

Constructs reduction_impl when the identity value is statically known.

Definition at line 852 of file reduction.hpp.

◆ reduction_impl() [2/2]

template<typename T , class BinaryOperation , int Dims, size_t Extent, typename RedOutVar >
sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, RedOutVar >::reduction_impl ( RedOutVar &  Var,
const T Identity,
BinaryOperation  BOp,
bool  InitializeToIdentity 
)
inline

Constructs reduction_impl when the identity value is unknown.

Definition at line 863 of file reduction.hpp.

Member Data Documentation

◆ is_usm

template<typename T , class BinaryOperation , int Dims, size_t Extent, typename RedOutVar >
constexpr bool sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::is_usm
staticconstexpr

Definition at line 647 of file reduction.hpp.


The documentation for this class was generated from the following file: