File tree Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ Atomics
4
4
.. toctree ::
5
5
:maxdepth: 1
6
6
7
+ ./atomics/atomic_load
8
+ ./atomics/atomic_store
9
+ ./atomics/atomic_exchange
7
10
./atomics/atomic_compare_exchange
8
11
./atomics/atomic_compare_exchange_strong
9
- ./atomics/atomic_exchange
12
+ ./atomics/atomic_assign
10
13
./atomics/atomic_fetch_op
11
- ./atomics/atomic_load
12
14
./atomics/atomic_op
13
15
./atomics/atomic_op_fetch
14
- ./atomics/atomic_store
Original file line number Diff line number Diff line change
1
+ ``atomic_assign ``
2
+ =================
3
+
4
+ .. warning ::
5
+ Deprecated since Kokkos 4.5,
6
+ use `atomic_store <atomic_store.html >`_ instead.
7
+
8
+ .. role :: cppkokkos(code)
9
+ :language: cppkokkos
10
+
11
+ Defined in header ``<Kokkos_Atomic.hpp> `` which is included from ``<Kokkos_Core.hpp> ``
12
+
13
+ Usage
14
+ -----
15
+
16
+ .. code-block :: cpp
17
+
18
+ atomic_assign(&obj, desired);
19
+ // ^^^^^^
20
+ // deprecated since Kokkos 4.5,
21
+ // use atomic_store(&obj, desired) instead
22
+
23
+ Atomically replaces the current value of ``obj `` with ``desired ``.
24
+
25
+ Description
26
+ -----------
27
+
28
+ .. cppkokkos :function :: template<class T> void atomic_assign(T* ptr, std::type_identity_t<T> val);
29
+
30
+ Atomically writes ``val `` into ``*ptr ``.
31
+
32
+ ``{ *ptr = val; } ``
33
+
34
+ :param ptr: address of the object whose value is to be replaced
35
+ :param val: the value to store in the referenced object
36
+ :returns: (nothing)
37
+
Original file line number Diff line number Diff line change 13
13
14
14
auto old = atomic_exchange(&obj, desired);
15
15
16
- Atomically replaces the value of ``obj `` with ``desired `` and returs the value before the call.
16
+ Atomically replaces the value of ``obj `` with ``desired `` and returns the value before the call.
17
17
18
18
Description
19
19
-----------
Original file line number Diff line number Diff line change @@ -34,14 +34,6 @@ Description
34
34
35
35
* ``value ``: value with which to combine the original value.
36
36
37
- .. cppkokkos :function :: template<class T> void atomic_assign(T* const ptr_to_value, const T value);
38
-
39
- Atomically executes ``*ptr_to_value = value ``.
40
-
41
- * ``ptr_to_value ``: address of the to be updated value.
42
-
43
- * ``value ``: new value.
44
-
45
37
.. cppkokkos :function :: template<class T> void atomic_decrement(T* const ptr_to_value);
46
38
47
39
Atomically executes ``(*ptr_to_value)-- `` or calls ``atomic_fetch_sub(ptr_to_value, T(-1)) ``.
You can’t perform that action at this time.
0 commit comments