diff --git a/docs/source/API/algorithms/std-algorithms/all/StdFill.rst b/docs/source/API/algorithms/std-algorithms/all/StdFill.rst index 22cb32c42..be21d9d33 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdFill.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdFill.rst @@ -41,22 +41,39 @@ Interface const Kokkos::View& view, const T& value); + // + // overload set accepting a team handle + // Note: for now omit the overloads accepting a label + // since they cause issues on device because of the string allocation. + // + template + KOKKOS_FUNCTION + void fill(const TeamHandleType& th, + IteratorType first, IteratorType last, + const T& value); + + template + KOKKOS_FUNCTION + void fill(const TeamHandleType& th, + const Kokkos::View& view, + const T& value); + Parameters and Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ``exespace``: - - - execution space instance +- ``exespace``: execution space instance -- ``label``: +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy - - used to name the implementation kernels for debugging purposes +- ``label``: string forwarded to internal parallel kernels for debugging purposes - for 1, the default string is: "Kokkos::fill_iterator_api_default" - for 3, the default string is: "Kokkos::fill_view_api_default" + - NOTE: overloads accepting a team handle do not use a label internally + - ``first, last``: range of elements to search in - range of elements to assign to @@ -65,7 +82,7 @@ Parameters and Requirements - must represent a valid range, i.e., ``last >= first`` (checked in debug mode) - - must be accessible from ``exespace`` + - must be accessible from ``exespace`` or from the execution space associated with the team handle - ``view``: @@ -73,9 +90,7 @@ Parameters and Requirements - must be accessible from ``exespace`` -- ``value``: - - - value to assign to each element +- ``value``: value to assign to each element Return Value diff --git a/docs/source/API/algorithms/std-algorithms/all/StdFill_n.rst b/docs/source/API/algorithms/std-algorithms/all/StdFill_n.rst index cd0e23e49..c4560559e 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdFill_n.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdFill_n.rst @@ -41,24 +41,43 @@ Interface const Kokkos::View& view, SizeType n, const T& value); + // + // overload set accepting a team handle + // + template + KOKKOS_FUNCTION + IteratorType fill_n(const TeamHandleType& th, + IteratorType first, SizeType n, + const T& value); + + template < + class TeamHandleType, class DataType, class... Properties, class SizeType, + class T, int> + KOKKOS_FUNCTION + IteratorType fill_n(const TeamHandleType& th, + const Kokkos::View& view, + SizeType n, + const T& value); + Parameters and Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ``exespace``, ``first``, ``view``, ``value``: same as in [``fill``](./StdFill): execution space instance -- ``label``: +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy - - used to name the implementation kernels for debugging purposes +- ``label``: used to name the implementation kernels for debugging purposes - for 1, the default string is: "Kokkos::fill_n_iterator_api_default" - for 3, the default string is: "Kokkos::fill_n_view_api_default" -- ``n``: + - NOTE: overloads accepting a team handle do not use a label internally - - number of elements to modify (must be non-negative) +- ``n``: number of elements to modify (must be non-negative) +- ``value``: value to assign to each element Return Value ~~~~~~~~~~~~ diff --git a/docs/source/API/algorithms/std-algorithms/all/StdReplace.rst b/docs/source/API/algorithms/std-algorithms/all/StdReplace.rst index bb82409c3..739361ecf 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdReplace.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdReplace.rst @@ -42,23 +42,38 @@ Interface const Kokkos::View& view, const T& old_value, const T& new_value); + // + // overload set accepting a team handle + // + template + KOKKOS_FUNCTION + void replace(const TeamHandleType& teamHandle, + Iterator first, Iterator last, + const ValueType& old_value, const ValueType& new_value); + + template + KOKKOS_FUNCTION + void replace(const TeamHandleType& teamHandle, + const ::Kokkos::View& view, + const ValueType& old_value, const ValueType& new_value); Parameters and Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ``exespace``: +- ``exespace``: execution space instance - - execution space instance +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy -- ``label``: - - - used to name the implementation kernels for debugging purposes +- ``label``: used to name the implementation kernels for debugging purposes - for 1, the default string is: "Kokkos::replace_iterator_api_default" - for 3, the default string is: "Kokkos::replace_view_api_default" + - NOTE: overloads accepting a team handle do not use a label internally + - ``first, last``: - range of elements to search in @@ -75,9 +90,7 @@ Parameters and Requirements - must be accessible from ``exespace`` -- ``old_value``, ``new_value``: - - - self-explanatory +- ``old_value``, ``new_value``: self-explanatory Return Value diff --git a/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopy.rst b/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopy.rst index 168c6ad8e..b616100ce 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopy.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopy.rst @@ -59,21 +59,42 @@ Interface const Kokkos::View& view_to, const T& old_value, const T& new_value); + // + // overload set accepting a team handle + // + template + KOKKOS_FUNCTION + OutputIterator replace_copy(const TeamHandleType& teamHandle, + InputIterator first_from, InputIterator last_from, + OutputIterator first_dest, + const ValueType& old_value, const ValueType& new_value); + + template < + class TeamHandleType, class DataType1, class... Properties1, + class DataType2, class... Properties2, class ValueType, int> + KOKKOS_FUNCTION + auto replace_copy(const TeamHandleType& teamHandle, + const Kokkos::View& view_from, + const Kokkos::View& view_dest, + const ValueType& old_value, const ValueType& new_value); + + Parameters and Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ``exespace``: - - - execution space instance +- ``exespace``: execution space instance -- ``label``: +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy - - used to name the implementation kernels for debugging purposes +- ``label``: used to name the implementation kernels for debugging purposes - for 1, the default string is: "Kokkos::replace_copy_iterator_api_default" - for 3, the default string is: "Kokkos::replace_copy_view_api_default" + - NOTE: overloads accepting a team handle do not use a label internally + - ``first_from, last_from``: - range of elements to copy from @@ -100,9 +121,7 @@ Parameters and Requirements - must be accessible from ``exespace`` -- ``old_value``, ``new_value``: - - - self-explanatory +- ``old_value``, ``new_value``: self-explanatory Return Value diff --git a/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopyIf.rst b/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopyIf.rst index 7ec48c358..e482e4ab7 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopyIf.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdReplaceCopyIf.rst @@ -62,13 +62,31 @@ Interface class DataType2, class... Properties2, class UnaryPredicateType, class T > - auto replace_copy_if(const std::string& label, (4) - const ExecutionSpace& exespace, - const Kokkos::View& view_from, - const Kokkos::View& view_to, - UnaryPredicateType pred, const T& new_value); - + auto replace_copy_if(const std::string& label, (4) + const ExecutionSpace& exespace, + const Kokkos::View& view_from, + const Kokkos::View& view_to, + UnaryPredicateType pred, const T& new_value); + // + // overload set accepting a team handle + // + template + KOKKOS_FUNCTION + OutputIterator + replace_copy_if(const TeamHandleType& teamHandle, InputIterator first_from, + InputIterator last_from, OutputIterator first_dest, + PredicateType pred, const ValueType& new_value); + + template + KOKKOS_FUNCTION + auto replace_copy_if(const TeamHandleType& teamHandle, + const ::Kokkos::View& view_from, + const ::Kokkos::View& view_dest, + PredicateType pred, const ValueType& new_value); Parameters and Requirements @@ -78,12 +96,16 @@ Parameters and Requirements - same as in [``replace_copy``](./StdReplaceCopy) -- ``label``: +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy + +- ``label``: used to name the implementation kernels for debugging purposes - for 1, the default string is: "Kokkos::replace_copy_if_iterator_api_default" - for 3, the default string is: "Kokkos::replace_copy_if_view_api_default" + - NOTE: overloads accepting a team handle do not use a label internally + - ``pred``: - unary predicate which returns ``true`` for the required element; ``pred(v)`` diff --git a/docs/source/API/algorithms/std-algorithms/all/StdReplaceIf.rst b/docs/source/API/algorithms/std-algorithms/all/StdReplaceIf.rst index 8126ffcc3..b0fa8666e 100644 --- a/docs/source/API/algorithms/std-algorithms/all/StdReplaceIf.rst +++ b/docs/source/API/algorithms/std-algorithms/all/StdReplaceIf.rst @@ -41,6 +41,22 @@ Interface const Kokkos::View& view, UnaryPredicateType pred, const T& new_value); + // + // overload set accepting a team handle + // + template + KOKKOS_FUNCTION + void replace_if(const TeamHandleType& teamHandle, + InputIterator first, InputIterator last, + Predicate pred, const ValueType& new_value); + + template + KOKKOS_FUNCTION + void replace_if(const TeamHandleType& teamHandle, + const ::Kokkos::View& view, + Predicate pred, const ValueType& new_value); Parameters and Requirements @@ -48,12 +64,16 @@ Parameters and Requirements - ``exespace``, ``first``, ``last``, ``view``, ``new_value``: same as in [``replace``](./StdReplace) -- ``label``: +- ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy + +- ``label``: used to name the implementation kernels for debugging purposes - for 1, the default string is: "Kokkos::replace_if_iterator_api_default" - for 3, the default string is: "Kokkos::replace_if_view_api_default" + - NOTE: overloads accepting a team handle do not use a label internally + - ``pred``: - *unary* predicate returning ``true`` for the required element to replace; ``pred(v)`` @@ -78,6 +98,7 @@ Parameters and Requirements bool operator()(value_type v) const { return /* ... */; } }; + Return Value ~~~~~~~~~~~~