25namespace shamalgs::reduction::details {
27 template<
class T,
class BinaryOp>
29 const sham::DeviceScheduler_ptr &sched,
35 if (start_id >= end_id) {
37 "Empty range not supported for min/max operations");
41 T ret = acc[start_id];
42 for (
u32 i = start_id + 1; i < end_id; i++) {
43 ret = bop(ret, acc[i]);
50 const sham::DeviceScheduler_ptr &sched,
56 if (start_id >= end_id) {
60 return reduc_internal<T>(sched, buf1, start_id, end_id, [](T lhs, T rhs) {
67 const sham::DeviceScheduler_ptr &sched,
72 return reduc_internal<T>(sched, buf1, start_id, end_id, [](T lhs, T rhs) {
73 return sham::max(lhs, rhs);
79 const sham::DeviceScheduler_ptr &sched,
84 return reduc_internal<T>(sched, buf1, start_id, end_id, [](T lhs, T rhs) {
85 return sham::min(lhs, rhs);
115 template _arg_ shamalgs::reduction::details::sum_usm_fallback<_arg_>( \
116 const sham::DeviceScheduler_ptr &sched, \
117 const sham::DeviceBuffer<_arg_> &buf1, \
120 template _arg_ shamalgs::reduction::details::max_usm_fallback<_arg_>( \
121 const sham::DeviceScheduler_ptr &sched, \
122 const sham::DeviceBuffer<_arg_> &buf1, \
125 template _arg_ shamalgs::reduction::details::min_usm_fallback<_arg_>( \
126 const sham::DeviceScheduler_ptr &sched, \
127 const sham::DeviceBuffer<_arg_> &buf1, \
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
std::vector< T > copy_to_stdvec() const
Copy the content of the buffer to a std::vector.
This header file contains utility functions related to exception handling in the code.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
main include file for memory algorithms