14#ifndef CHEMISTRY_LANES_H
15#define CHEMISTRY_LANES_H
19#include <Kokkos_Core.hpp>
24template <
bool ColumnMajor>
68 double largest = Kokkos::fabs(f(first));
70 const double v = Kokkos::fabs(f(
i));
88template <
typename Member>
104 partial =
static_cast<double *
>(
m.team_scratch(0).get_shmem(
shares(
L) *
sizeof(
double)));
108 template <
typename F>
110 Kokkos::parallel_for(Kokkos::TeamVectorRange(
member, n), f);
115 template <
typename F>
117 Kokkos::single(Kokkos::PerTeam(
member), f);
120 template <
typename F>
123 Kokkos::parallel_for(Kokkos::TeamVectorRange(
member,
S), [&](
const uint32_t l) {
135 template <
typename F>
139 Kokkos::parallel_for(Kokkos::TeamVectorRange(
member,
L), [&](
const uint32_t l) {
143 const double v = Kokkos::fabs(f(
i));
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
KOKKOS_INLINE_FUNCTION constexpr uint32_t dense_index(const uint32_t n, const uint32_t r, const uint32_t c)
Index of entry (r, c) of an n x n matrix stored by rows, or by columns.
Definition lanes.h:25
One thread does all the work of a cell.
Definition lanes.h:38
static constexpr bool column_major
Definition lanes.h:40
KOKKOS_INLINE_FUNCTION void single(const F &f) const
Definition lanes.h:51
static constexpr bool parallel
Definition lanes.h:41
static constexpr uint32_t lanes
Definition lanes.h:39
KOKKOS_INLINE_FUNCTION void for_each(const uint32_t n, const F &f) const
Definition lanes.h:44
KOKKOS_INLINE_FUNCTION double argmax_abs(const uint32_t first, const uint32_t n, const F &f, uint32_t &index) const
The largest |f(i)| for first <= i < n and the first i that has it.
Definition lanes.h:65
KOKKOS_INLINE_FUNCTION double sum(const uint32_t n, const F &f) const
sum_i f(i), in order.
Definition lanes.h:57
KOKKOS_INLINE_FUNCTION void sync() const
Definition lanes.h:48
All threads and vector lanes of a team (TeamPolicy(cells, T, V), T * V lanes) share the work of a cel...
Definition lanes.h:89
uint32_t lanes
Definition lanes.h:94
double * partial
Definition lanes.h:95
static constexpr uint32_t SUM_SHARES
Definition lanes.h:92
uint32_t * where
Definition lanes.h:96
static KOKKOS_INLINE_FUNCTION constexpr uint32_t shares(const uint32_t L)
Definition lanes.h:98
static constexpr bool column_major
Definition lanes.h:90
static constexpr size_t scratch_bytes(const uint32_t L)
Definition lanes.h:99
KOKKOS_INLINE_FUNCTION double argmax_abs(const uint32_t first, const uint32_t n, const F &f, uint32_t &index) const
Definition lanes.h:136
KOKKOS_INLINE_FUNCTION double sum(const uint32_t n, const F &f) const
Definition lanes.h:121
KOKKOS_INLINE_FUNCTION void single(const F &f) const
Definition lanes.h:116
KOKKOS_INLINE_FUNCTION void for_each(const uint32_t n, const F &f) const
Definition lanes.h:109
KOKKOS_INLINE_FUNCTION TeamLanes(const Member &m, const uint32_t L)
Definition lanes.h:103
static constexpr bool parallel
Definition lanes.h:91
KOKKOS_INLINE_FUNCTION void sync() const
Definition lanes.h:113
const Member & member
Definition lanes.h:93
CellSetup< ExecSpace > c
Definition teno_setup.cpp:1810
uint8_t r
Definition teno_setup.cpp:687