kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
InsertOp.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_UTILS_ATOMICS_INSERTOP_HPP
2#define KOKKOS_UTILS_ATOMICS_INSERTOP_HPP
3
4#include <concepts>
5
7
9{
10
17{
18 template <concepts::View ViewType, std::integral IndexType, typename ValueType>
19 KOKKOS_FUNCTION
20 void op(const ViewType& values, const IndexType index, ValueType&& value) const {
21 Kokkos::atomic_min(&values(index), std::forward<ValueType>(value));
22 }
23};
24
25} // namespace Kokkos::utils::atomics
26
27#endif // KOKKOS_UTILS_ATOMICS_INSERTOP_HPP
Insert an element in a view at a specific index using Kokkos::atomic_min.
Definition InsertOp.hpp:17
KOKKOS_FUNCTION void op(const ViewType &values, const IndexType index, ValueType &&value) const
Definition InsertOp.hpp:20