From 744c7fc0470a72e5f8296b00bc5d0e95f3d16bec Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Mon, 4 Nov 2024 17:54:43 -0500 Subject: [PATCH 1/4] Fix typo retur[n]s --- docs/source/API/core/atomics/atomic_exchange.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/API/core/atomics/atomic_exchange.rst b/docs/source/API/core/atomics/atomic_exchange.rst index 6095c9592..ebae4597f 100644 --- a/docs/source/API/core/atomics/atomic_exchange.rst +++ b/docs/source/API/core/atomics/atomic_exchange.rst @@ -13,7 +13,7 @@ Usage auto old = atomic_exchange(&obj, desired); -Atomically replaces the value of ``obj`` with ``desired`` and returs the value before the call. +Atomically replaces the value of ``obj`` with ``desired`` and returns the value before the call. Description ----------- From 1c80c87d30c39fc563fc829855d4b2f12b1744f4 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Mon, 4 Nov 2024 18:01:27 -0500 Subject: [PATCH 2/4] Document atomic_assign --- .../source/API/core/atomics/atomic_assign.rst | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/source/API/core/atomics/atomic_assign.rst diff --git a/docs/source/API/core/atomics/atomic_assign.rst b/docs/source/API/core/atomics/atomic_assign.rst new file mode 100644 index 000000000..d677bea23 --- /dev/null +++ b/docs/source/API/core/atomics/atomic_assign.rst @@ -0,0 +1,37 @@ +``atomic_assign`` +================= + +.. warning:: + Deprecated since Kokkos 4.5, + use `atomic_store `_ instead. + +.. role:: cppkokkos(code) + :language: cppkokkos + +Defined in header ```` which is included from ```` + +Usage +----- + +.. code-block:: cpp + + atomic_assign(&obj, desired); + // ^^^^^^ + // deprecated since Kokkos 4.5, + // use atomic_store(&obj, desired) instead + +Atomically replaces the current value of ``obj`` with ``desired``. + +Description +----------- + +.. cppkokkos:function:: template void atomic_assign(T* ptr, std::type_identity_t val); + + Atomically writes ``val`` into ``*ptr``. + + ``{ *ptr = val; }`` + + :param ptr: address of the object whose value is to be replaced + :param val: the value to store in the referenced object + :returns: (nothing) + From 6fb3112bfaa708b453d77e5cc3fe0b36828c5b07 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Mon, 4 Nov 2024 18:01:44 -0500 Subject: [PATCH 3/4] Fiddle with atomics TOC --- docs/source/API/core/atomics.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/API/core/atomics.rst b/docs/source/API/core/atomics.rst index fd2843bb6..fe8ea4e82 100644 --- a/docs/source/API/core/atomics.rst +++ b/docs/source/API/core/atomics.rst @@ -4,11 +4,12 @@ Atomics .. toctree:: :maxdepth: 1 + ./atomics/atomic_load + ./atomics/atomic_store + ./atomics/atomic_exchange ./atomics/atomic_compare_exchange ./atomics/atomic_compare_exchange_strong - ./atomics/atomic_exchange + ./atomics/atomic_assign ./atomics/atomic_fetch_op - ./atomics/atomic_load ./atomics/atomic_op ./atomics/atomic_op_fetch - ./atomics/atomic_store From 011f058aa96b80efef17879ecb92d9591aed0fc9 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Fri, 8 Nov 2024 08:52:37 -0500 Subject: [PATCH 4/4] Remove old doc for atomic_assign --- docs/source/API/core/atomics/atomic_op.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/source/API/core/atomics/atomic_op.rst b/docs/source/API/core/atomics/atomic_op.rst index acc02631a..4a04cdd7d 100644 --- a/docs/source/API/core/atomics/atomic_op.rst +++ b/docs/source/API/core/atomics/atomic_op.rst @@ -34,14 +34,6 @@ Description * ``value``: value with which to combine the original value. -.. cppkokkos:function:: template void atomic_assign(T* const ptr_to_value, const T value); - - Atomically executes ``*ptr_to_value = value``. - - * ``ptr_to_value``: address of the to be updated value. - - * ``value``: new value. - .. cppkokkos:function:: template void atomic_decrement(T* const ptr_to_value); Atomically executes ``(*ptr_to_value)--`` or calls ``atomic_fetch_sub(ptr_to_value, T(-1))``.