cub::internal::ThreadReduce

Defined in cub/thread/thread_reduce.cuh

template<typename Input, typename ReductionOp, typename PrefixT, typename AccumT = ::cuda::std::__accumulator_t<ReductionOp, ValueT, PrefixT>>
AccumT cub::internal::ThreadReduce(const Input &input, ReductionOp reduction_op, PrefixT prefix)

Reduction over statically-sized array-like types, seeded with the specified prefix.

Template Parameters
  • Input[inferred] The data type to be reduced having member operator[](int i) and must be statically-sized (size() method or static array)

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

  • PrefixT[inferred] The prefix type

Parameters
  • input[in] Input array

  • reduction_op[in] Binary reduction operator

  • prefix[in] Prefix to seed reduction with

Returns

Aggregate of type cuda::std::__accumulator_t<ReductionOp, ValueT, PrefixT>