Updating thrust scan documentation to warn about mixing input/output types
MODIFY
thrust/scan.h
thrust/scan.h
@@ -52,6 +52,10 @@ namespace thrust
* a serial summation order, while \p inclusive_scan requires associativity of
* the binary operation to parallelize the prefix sum.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by casting the input iterators to match the appropriate output type
+ * via transform_iterator().
+ *
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
@@ -108,7 +112,11 @@ __host__ __device__
* This version of \p inclusive_scan assumes plus as the associative operator.
* When the input and output sequences are the same, the scan is performed
* in-place.
-
+ *
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by casting the input iterators to match the appropriate output type
+ * via transform_iterator().
+ *
* \p inclusive_scan is similar to \c std::partial_sum in the STL. The primary
* difference between the two functions is that \c std::partial_sum guarantees
* a serial summation order, while \p inclusive_scan requires associativity of
@@ -162,6 +170,10 @@ template<typename InputIterator,
* a serial summation order, while \p inclusive_scan requires associativity of
* the binary operation to parallelize the prefix sum.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by casting the input iterators to match the appropriate output type
+ * via transform_iterator().
+ *
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
@@ -222,6 +234,10 @@ __host__ __device__
* a serial summation order, while \p inclusive_scan requires associativity of
* the binary operation to parallelize the prefix sum.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by casting the input iterators to match the appropriate output type
+ * via transform_iterator().
+ *
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.
@@ -273,6 +289,9 @@ template<typename InputIterator,
* associative operator and \c 0 as the initial value. When the input and
* output sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
@@ -329,6 +348,9 @@ __host__ __device__
* associative operator and \c 0 as the initial value. When the input and
* output sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.
@@ -375,6 +397,9 @@ template<typename InputIterator,
* operator but requires an initial value \p init. When the input and
* output sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
@@ -432,6 +457,9 @@ __host__ __device__
* operator but requires an initial value \p init. When the input and
* output sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.
@@ -480,6 +508,9 @@ template<typename InputIterator,
* operator and an initial value \p init. When the input and output
* sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
@@ -548,6 +579,9 @@ __host__ __device__
* operator and an initial value \p init. When the input and output
* sequences are the same, the scan is performed in-place.
*
+ * Note that currently mixing scan input and output types can cause undefined behaviour.
+ * This issue can be avoided by supplying an initial value type argument to exclusive_scan.
+ *
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.

Updating thrust scan documentation to warn about mixing input/output types