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
6
#include "
kokkos-utils/concepts/View.hpp
"
7
8
namespace
Kokkos::utils::atomics
9
{
10
16
struct
InsertMin
17
{
18
template
<concepts::View ViewType, std::
int
egral 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
View.hpp
Kokkos::utils::atomics
Definition
InsertOp.hpp:9
Kokkos::utils::atomics::InsertMin
Insert an element in a view at a specific index using Kokkos::atomic_min.
Definition
InsertOp.hpp:17
Kokkos::utils::atomics::InsertMin::op
KOKKOS_FUNCTION void op(const ViewType &values, const IndexType index, ValueType &&value) const
Definition
InsertOp.hpp:20
include
kokkos-utils
atomics
InsertOp.hpp
Generated on Thu Apr 17 2025 12:50:27 for kokkos-utils by
1.13.2