kokkos-execution 0.0.1
Loading...
Searching...
No Matches
atomic.hpp File Reference
#include "Kokkos_Core.hpp"

Go to the source code of this file.

Namespaces

namespace  Tests
namespace  Tests::Utils

Functions

template<typename Scope, typename Order, typename T>
auto Tests::Utils::atomic_fetch_add (T *ptr, const T val)
 Same effect as Kokkos::atomic_fetch_add, given memory scope and order.

Detailed Description

User-chosen memory scope and order atomic operations

Kokkos uses desul for atomics and defaults to device scope on all backends. That is sufficient when only GPU threads (of the same device) share a memory location, but yields undefined behaviour when both CPU and GPU threads atomically access the same address (e.g. a Kokkos::View in Kokkos::SharedSpace).

This file provides a portable, atomic add with user-chosen memory scope and order.

For more information:

Definition in file atomic.hpp.