atomic_store#

Defined in header <Kokkos_Atomic.hpp> which is included from <Kokkos_Core.hpp>

Usage#

atomic_store(&obj, desired);

Atomically replaces the current value of obj with desired.

Description#

template<class T>
void atomic_store(T *ptr, std::type_identity_t<T> val);#

Atomically writes val into *ptr.

{ *ptr = val; }

Parameters:
  • ptr – address of the object whose value is to be replaced

  • val – the value to store in the referenced object

Returns:

(nothing)

See also#

  • atomic_load: atomically obtains the value of the referenced object

  • atomic_exchange: atomically replaces the value of the referenced object and obtains the value held previously