Skip to content

Commit

Permalink
Adding bitwise reproducibility documentation (#403)
Browse files Browse the repository at this point in the history
* Adding bitwise reproducibility documentation

* fix typo

* Change wording

* Grammar fix

* Add notes to individual function documentation
  • Loading branch information
stanleytsang-amd authored Apr 23, 2024
1 parent 2813b11 commit f3a28e4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/bitwise-repro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. meta::
:description: rocThrust documentation and API reference
:keywords: rocThrust, ROCm, API, reference, data type, support

.. _bitwise-repro:

******************************************
Bitwise reproducibility
******************************************

With the exception of the following functions, all rocThrust API functions are bitwise reproducible. That is, given identical inputs, the function will return the exact same result in repeated invocations.

* scan (inclusive & exclusive)
* scan_by_key (inclusive & exclusive)
* reduce_by_key
* transform_scan
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The documentation is structured as follows:
.. grid-item-card:: API reference

* :ref:`data-type-support`
* :ref:`bitwise-repro`
* :ref:`api-reference`
* :ref:`genindex`

Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ subtrees:
- caption: API reference
entries:
- file: data-type-support
- file: bitwise-repro
- file: cpp_api

- caption: About
Expand Down
12 changes: 12 additions & 0 deletions thrust/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ template<typename InputIterator,
* This version of \p reduce_by_key uses the function object \c equal_to
* to test for equality and \c plus to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
Expand Down Expand Up @@ -421,6 +423,8 @@ __host__ __device__
* This version of \p reduce_by_key uses the function object \c equal_to
* to test for equality and \c plus to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* \param keys_first The beginning of the input key range.
* \param keys_last The end of the input key range.
* \param values_first The beginning of the input value range.
Expand Down Expand Up @@ -482,6 +486,8 @@ template<typename InputIterator1,
* This version of \p reduce_by_key uses the function object \c binary_pred
* to test for equality and \c plus to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
Expand Down Expand Up @@ -557,6 +563,8 @@ __host__ __device__
* This version of \p reduce_by_key uses the function object \c binary_pred
* to test for equality and \c plus to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* \param keys_first The beginning of the input key range.
* \param keys_last The end of the input key range.
* \param values_first The beginning of the input value range.
Expand Down Expand Up @@ -626,6 +634,8 @@ template<typename InputIterator1,
* This version of \p reduce_by_key uses the function object \c binary_pred
* to test for equality and \c binary_op to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
Expand Down Expand Up @@ -710,6 +720,8 @@ __host__ __device__
* This version of \p reduce_by_key uses the function object \c binary_pred
* to test for equality and \c binary_op to reduce values with equal keys.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* \param keys_first The beginning of the input key range.
* \param keys_last The end of the input key range.
* \param values_first The beginning of the input value range.
Expand Down
8 changes: 8 additions & 0 deletions thrust/transform_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ THRUST_NAMESPACE_BEGIN
* assigned to <tt>\*(result + 1)</tt>, and so on. The transform scan
* operation is permitted to be in-place.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
Expand Down Expand Up @@ -121,6 +123,8 @@ __host__ __device__
* assigned to <tt>\*(result + 1)</tt>, and so on. The transform scan
* operation is permitted to be in-place.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.
Expand Down Expand Up @@ -181,6 +185,8 @@ template<typename InputIterator,
* to <tt>\*(result + 1)</tt>, and so on. The transform scan operation is
* permitted to be in-place.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* The algorithm's execution is parallelized as determined by \p exec.
*
* \param exec The execution policy to use for parallelization.
Expand Down Expand Up @@ -255,6 +261,8 @@ __host__ __device__
* to <tt>\*(result + 1)</tt>, and so on. The transform scan operation is
* permitted to be in-place.
*
* Results from this function may vary from run to run depending on the inputs provided.
*
* \param first The beginning of the input sequence.
* \param last The end of the input sequence.
* \param result The beginning of the output sequence.
Expand Down

0 comments on commit f3a28e4

Please sign in to comment.