Skip to content

Commit

Permalink
Merge pull request #479 from dalg24/min_max_clamp
Browse files Browse the repository at this point in the history
Document `Kokkos::{min,max,minmax,clamp}`
  • Loading branch information
crtrott authored Jan 2, 2024
2 parents a2bb64f + 4f45dad commit 5fc68c6
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/API/core/Utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Utilities
./utilities/all
./utilities/assert
./utilities/complex
./utilities/min_max_clamp
./utilities/printf
./utilities/timer
./utilities/device_id
Expand Down
63 changes: 63 additions & 0 deletions docs/source/API/core/utilities/min_max_clamp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Minimum/maximum operations
==========================

.. role:: cppkokkos(code)
:language: cpp

.. _StandarLibraryHeaderAlgorithm: https://en.cppreference.com/w/cpp/header/algorithm

.. |StandarLibraryHeaderAlgorithm| replace:: ``<algorithm>``

Defined in header ``<Kokkos_Core.hpp>``

Provides minimum/maximum and related operations from the standard library header |StandarLibraryHeaderAlgorithm|_.

The min/max and clamp function templates are defined in the ``Kokkos::`` namespace since Kokkos 3.7

.. _min: https://en.cppreference.com/w/cpp/algorithm/min

.. |min| replace:: ``min``

.. _max: https://en.cppreference.com/w/cpp/algorithm/max

.. |max| replace:: ``max``

.. _minmax: https://en.cppreference.com/w/cpp/algorithm/minmax

.. |minmax| replace:: ``minmax``

.. _clamp: https://en.cppreference.com/w/cpp/algorithm/clamp

.. |clamp| replace:: ``clamp``


========== ============================================================
|min|_ returns the smaller of the given values
|max|_ returns the greater of the given values
|minmax|_ returns the smaller and larger of the given values
|clamp|_ clamps a value between a pair of boundary values
========== ============================================================

----

See also
--------

.. _min_element: ../../algorithms/std-algorithms/all/StdMinElement.html

.. |min_element| replace:: ``min_element``

.. _max_element: ../../algorithms/std-algorithms/all/StdMaxElement.html

.. |max_element| replace:: ``max_element``

.. _minmax_element: ../../algorithms/std-algorithms/all/StdMinMaxElement.html

.. |minmax_element| replace:: ``minmax_element``

|min_element|_: returns the smallest element in a range

|max_element|_: returns the largest element in a range

|minmax_element|_: returns the smallest and the largest elements in a range

0 comments on commit 5fc68c6

Please sign in to comment.