|
| reduction_impl_algo (const T &Identity, BinaryOperation BinaryOp, bool Init, std::shared_ptr< rw_accessor_type > AccPointer) |
|
| reduction_impl_algo (const T &Identity, BinaryOperation BinaryOp, bool Init, std::shared_ptr< dw_accessor_type > AccPointer) |
|
| reduction_impl_algo (const T &Identity, BinaryOperation BinaryOp, bool Init, T *USMPointer) |
|
void | associateWithHandler (handler &CGH) |
| Associates the reduction accessor to user's memory with CGH handler to keep the accessor alive until the command group finishes the work. More...
|
|
accessor< T, buffer_dim, access::mode::read > | getReadAccToPreviousPartialReds (handler &CGH) const |
|
template<bool IsOneWG, bool _IsUSM = is_usm> |
std::enable_if_t< IsOneWG &&_IsUSM, result_type * > | getWriteMemForPartialReds (size_t, handler &) |
| Returns user's USM pointer passed to reduction for editing. More...
|
|
template<bool IsOneWG, bool _IsUSM = is_usm> |
std::enable_if_t< IsOneWG &&!_IsUSM, rw_accessor_type > | getWriteMemForPartialReds (size_t, handler &CGH) |
| Returns user's accessor passed to reduction for editing if that is the read-write accessor. More...
|
|
template<bool IsOneWG> |
std::enable_if_t<!IsOneWG, rw_accessor_type > | getWriteMemForPartialReds (size_t Size, handler &CGH) |
| Constructs a new temporary buffer to hold partial sums and returns the accessor for that buffer. More...
|
|
rw_accessor_type | getWriteAccForPartialReds (size_t Size, handler &CGH) |
| Returns an accessor accessing the memory that will hold the reduction partial sums. More...
|
|
template<bool HasFastAtomics = (has_fast_atomics || has_atomic_add_float64)> |
std::enable_if_t< HasFastAtomics, rw_accessor_type > | getReadWriteAccessorToInitializedMem (handler &CGH) |
| If reduction is initialized with read-write accessor, which does not require initialization with identity value, then return user's read-write accessor. More...
|
|
accessor< int, 1, access::mode::read_write, access::target::device, access::placeholder::false_t > | getReadWriteAccessorToInitializedGroupsCounter (handler &CGH) |
|
bool | hasUserDiscardWriteAccessor () |
|
template<bool _IsUSM = IsUSM> |
std::enable_if_t<!_IsUSM, rw_accessor_type & > | getUserReadWriteAccessor () |
|
template<bool _IsUSM = IsUSM> |
std::enable_if_t<!_IsUSM, dw_accessor_type & > | getUserDiscardWriteAccessor () |
|
result_type * | getUSMPointer () |
|
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 |
|
template<typename T, class BinaryOperation, int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
class cl::sycl::ext::oneapi::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, default_reduction_algorithm< IsUSM, IsPlaceholder, AccessorDims > >
Original reduction algorithm is the default.
It supports both USM and accessors via a single class
Definition at line 503 of file reduction.hpp.
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
Associates the reduction accessor to user's memory with CGH
handler to keep the accessor alive until the command group finishes the work.
This function does not do anything for USM reductions.
Definition at line 555 of file reduction.hpp.
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
template<bool HasFastAtomics = (has_fast_atomics || has_atomic_add_float64)>
If reduction is initialized with read-write accessor, which does not require initialization with identity value, then return user's read-write accessor.
Otherwise, create global buffer with 'num_elements' initialized with identity value and return an accessor to that buffer.
Definition at line 635 of file reduction.hpp.
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
template<typename _T = result_type>
static accessor<_T, buffer_dim, access::mode::read_write, access::target::local> cl::sycl::ext::oneapi::detail::reduction_impl_algo< T, BinaryOperation, Dims, Extent, default_reduction_algorithm< IsUSM, IsPlaceholder, AccessorDims > >::getReadWriteLocalAcc |
( |
size_t |
Size, |
|
|
handler & |
CGH |
|
) |
| |
|
inlinestatic |
Creates and returns a local accessor with the Size
elements.
By default the local accessor elements are of the same type as the elements processed by the reduction, but may it be altered by specifying _T
explicitly if need an accessor with elements of different type.
Definition at line 573 of file reduction.hpp.
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
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 617 of file reduction.hpp.
References cl::sycl::detail::associateWithHandler().
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
template<bool IsOneWG, bool _IsUSM = is_usm>
Returns user's USM pointer passed to reduction for editing.
Definition at line 586 of file reduction.hpp.
template<typename T , class BinaryOperation , int Dims, size_t Extent, bool IsUSM, access::placeholder IsPlaceholder, int AccessorDims>
template<bool IsOneWG, bool _IsUSM = is_usm>
Returns user's accessor passed to reduction for editing if that is the read-write accessor.
Otherwise, create a new buffer and return read-write accessor to it.
Definition at line 595 of file reduction.hpp.