This class encapsulates the reduction variable/accessor, the reduction operator and an optional operator identity. More...
#include <sycl/reduction.hpp>
Public Member Functions | |
template<bool ExplicitIdentityRelay = ExplicitIdentity, typename = std::enable_if_t<!ExplicitIdentityRelay>> | |
reduction_impl (RedOutVar Var, BinaryOperation BOp, bool InitializeToIdentity=false) | |
Constructs reduction_impl when no identity is specified. More... | |
template<bool ExplicitIdentityRelay = ExplicitIdentity, typename = std::enable_if_t<ExplicitIdentityRelay>> | |
reduction_impl (RedOutVar &Var, const T &Identity, BinaryOperation BOp, bool InitializeToIdentity) | |
Constructs reduction_impl with an explicit identity value. More... | |
Public Member Functions inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar > | |
reduction_impl_algo (const T &Identity, BinaryOperation BinaryOp, bool Init, RedOutVar RedOut) | |
template<typename RelayT = T, typename RelayBinaryOperation = BinaryOperation> | |
reduction_impl_algo (BinaryOperation BinaryOp, bool Init, RedOutVar RedOut, std::enable_if_t< IsKnownIdentityOp< RelayT, RelayBinaryOperation >::value, int >=0) | |
template<typename RelayT = T, typename RelayBinaryOperation = BinaryOperation> | |
reduction_impl_algo (BinaryOperation BinaryOp, bool Init, RedOutVar RedOut, std::enable_if_t<!IsKnownIdentityOp< RelayT, RelayBinaryOperation >::value, int >=0) | |
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 , bool HasIdentity = has_identity> | |
std::enable_if_t< HasIdentity > | withInitializedMem (handler &CGH, FuncTy Func) |
Provide Func with a properly initialized memory to write the reduction result to. More... | |
template<typename KernelName , typename FuncTy , bool HasIdentity = has_identity> | |
std::enable_if_t<!HasIdentity > | withInitializedMem (handler &CGH, FuncTy Func) |
const identity_container_type & | getIdentityContainer () |
accessor< int, 1, access::mode::read_write, access::target::device, access::placeholder::false_t > | getReadWriteAccessorToInitializedGroupsCounter (handler &CGH) |
auto | getGroupsCounterAccDiscrete (handler &CGH) |
BinaryOperation | getBinaryOperation () const |
Returns the binary operation associated with the reduction. More... | |
bool | initializeToIdentity () const |
auto | getUserRedVarAccess (handler &CGH) |
Static Public Attributes | |
static constexpr bool | is_known_identity |
static constexpr bool | is_usm |
Static Public Attributes inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar > | |
static constexpr bool | is_known_identity |
static constexpr bool | has_identity = is_known_identity || ExplicitIdentity |
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 | |
Public Types inherited from sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar > | |
using | identity_container_type = ReductionIdentityContainer< T, BinaryOperation, ExplicitIdentity > |
using | reducer_token_type = detail::ReducerToken< BinaryOperation, identity_container_type > |
using | reducer_type = reducer< T, BinaryOperation, Dims, Extent, identity_container_type > |
using | reducer_element_type = typename ReducerTraits< reducer_type >::element_type |
using | result_type = T |
using | binary_operation = BinaryOperation |
This class encapsulates the reduction variable/accessor, the reduction operator and an optional operator identity.
Definition at line 1107 of file reduction.hpp.
|
inline |
Constructs reduction_impl when no identity is specified.
This is only available when ExplicitIdentity is false.
Definition at line 1128 of file reduction.hpp.
References sycl::_V1::detail::InitializeToIdentity, sycl::_V1::invalid, sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar >::is_known_identity, sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar >::is_usm, and sycl::_V1::make_error_code().
|
inline |
Constructs reduction_impl with an explicit identity value.
This is only available when ExplicitIdentity is true.
Definition at line 1146 of file reduction.hpp.
References sycl::_V1::detail::InitializeToIdentity, sycl::_V1::invalid, sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar >::is_usm, and sycl::_V1::make_error_code().
|
staticconstexpr |
Definition at line 858 of file reduction.hpp.
Referenced by sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar >::reduction_impl().
|
staticconstexpr |
Definition at line 881 of file reduction.hpp.
Referenced by sycl::_V1::detail::reduction_impl< T, BinaryOperation, Dims, Extent, ExplicitIdentity, RedOutVar >::reduction_impl().