cub::internal::ThreadReduce

Defined in /home/runner/work/cccl/cccl/cub/cub/thread/thread_reduce.cuh

template<int LENGTH, typename T, typename ReductionOp, typename PrefixT, typename AccumT = detail::accumulator_t<ReductionOp, PrefixT, T>>
AccumT cub::internal::ThreadReduce(T *input, ReductionOp reduction_op, PrefixT prefix)

Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified prefix.

The aggregate is returned.

Template Parameters
  • LENGTH – LengthT of input array

  • T[inferred] The data type to be reduced.

  • ReductionOp[inferred] Binary reduction operator type having member T operator()(const T &a, const T &b)

Parameters
  • input[in] Input array

  • reduction_op[in] Binary reduction operator

  • prefix[in] Prefix to seed reduction with