atomic_load#

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

Usage#

auto current = atomic_load(&obj);

Atomically obtains the current value of obj.

Description#

template<class T>
T atomic_load(T *ptr);#

Atomically reads the content of *ptr and returns it.

{ T val = *ptr; return val; }

Parameters:

ptr – address of the object whose current value is to be returned

Returns:

the value that is held by the object pointed to by ptr

See also#

  • atomic_store: atomically replaces the value of the referenced object with a non-atomic argument

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