cub::internal::ThreadScanInclusive

Defined in cub/thread/thread_scan.cuh

template<int LENGTH, typename T, typename ScanOp>
T cub::internal::ThreadScanInclusive(T *input, T *output, ScanOp scan_op, T prefix, bool apply_prefix = true)

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

The aggregate is returned.

Template Parameters
  • LENGTH – LengthT of input and output arrays

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

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

Parameters
  • input[in] Input array

  • output[out] Output array (may be aliased to input)

  • scan_op[in] Binary scan operator

  • prefix[in] Prefix to seed scan with

  • apply_prefix[in] Whether or not the calling thread should apply its prefix. (Handy for preventing thread-0 from applying a prefix.)