#include <sycl/reduction.hpp>
Public Types | |
using | reducer_type = reducer< T, BinaryOperation, Dims, Extent > |
using | result_type = T |
using | binary_operation = BinaryOperation |
Public Member Functions | |
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_t > | getReadWriteAccessorToInitializedGroupsCounter (handler &CGH) |
auto | getGroupsCounterAccDiscrete (handler &CGH) |
RedOutVar & | getUserRedVar () |
![]() | |
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 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 | |
![]() | |
reduction_impl_common (const T &Identity, BinaryOperation BinaryOp, bool Init=false) | |
![]() | |
const T | MIdentity |
Identity of the BinaryOperation. More... | |
BinaryOperation | MBinaryOp |
bool | InitializeToIdentity |
Definition at line 554 of file reduction.hpp.
using sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::binary_operation = BinaryOperation |
Definition at line 561 of file reduction.hpp.
using sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::reducer_type = reducer<T, BinaryOperation, Dims, Extent> |
Definition at line 559 of file reduction.hpp.
using sycl::_V1::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, RedOutVar >::result_type = T |
Definition at line 560 of file reduction.hpp.
|
inline |
Definition at line 575 of file reduction.hpp.
|
inline |
Definition at line 706 of file reduction.hpp.
References sycl::_V1::handler::depends_on(), sycl::_V1::detail::usm::free(), sycl::_V1::queue::get_device(), and sycl::_V1::queue::memset().
|
inline |
Definition at line 579 of file reduction.hpp.
|
inline |
Definition at line 695 of file reduction.hpp.
|
inline |
Definition at line 597 of file reduction.hpp.
|
inline |
Definition at line 720 of file reduction.hpp.
|
inline |
Returns an accessor accessing the memory that will hold the reduction partial sums.
If Size
is equal to one, then the reduction result is the final and needs to be written to user's read-write accessor (if there is such). Otherwise, a new buffer is created and accessor to that buffer is returned.
Definition at line 609 of file reduction.hpp.
|
inline |
Definition at line 585 of file reduction.hpp.
|
inline |
Provide Func
with a properly initialized memory to write the reduction result to.
It can either be original user's reduction variable or a newly allocated memory initialized with reduction's identity. In the later case, after the Func
finishes, update original user's variable accordingly (i.e., honoring initialize_to_identity property).
Definition at line 634 of file reduction.hpp.
References sycl::_V1::detail::associateWithHandler(), sycl::_V1::handler::copy(), sycl::_V1::handler::single_task(), and sycl::_V1::detail::reduction::withAuxHandler().
|
staticconstexpr |
Definition at line 563 of file reduction.hpp.
|
staticconstexpr |
Definition at line 566 of file reduction.hpp.
|
staticconstexpr |
Definition at line 568 of file reduction.hpp.
|
staticconstexpr |
Definition at line 564 of file reduction.hpp.
|
staticconstexpr |
Definition at line 571 of file reduction.hpp.
|
staticconstexpr |
Definition at line 573 of file reduction.hpp.