/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/kokkos.hh Source File#
|
DiFfRG
|
kokkos.hh
Go to the documentation of this file.
52 // We assume that this is true, and when switching to a different memory space, it is always unique.
55 static_assert(std::is_same_v<CPU_memory, TBB_memory>, "CPU memory space must be the same as TBB memory space");
58 using other_memory_space_t = std::conditional_t<std::is_same_v<MemorySpace, GPU_memory>, CPU_memory, GPU_memory>;
160 using KokkosNDView = Kokkos::View<typename GetKokkosNDStarType<dim, T>::type, // Get the star syntax for
166 Kokkos::View<typename GetKokkosNDStarType<dim, T>::type, // Get the star syntax for dimensionality recursively
174 Kokkos::View<typename GetKokkosNDStarType<dim, T>::type, // Get the star syntax for dimensionality recursively
183 return device::apply([&](const auto &...args) { return KokkosNDView<dim, T, ExecutionSpace>(label, args...); },
188 auto make_kokkos_nd_view_restrict(const std::string &label, const device::array<size_t, dim> &extents)
191 [&](const auto &...args) { return KokkosNDViewRestrict<dim, T, ExecutionSpace>(label, args...); }, extents);
203 template <int dim, typename ExecutionSpace> using KokkosNDRange = KokkosNDRangeHelper<dim, ExecutionSpace>::type;
210 device::array<size_t, dim> compute_tile_hints(const device::array<size_t, dim> &extents, size_t max_threads = 256)
263 KOKKOS_FORCEINLINE_FUNCTION auto make_kokkos_nd_thread_range(const TeamType &team, const device::array<size_t, dim> end)
329 KOKKOS_FORCEINLINE_FUNCTION void impl(device::integer_sequence<size_t, Is...>, Args &&...args) const
332 fun(device::array<size_t, dim>{{static_cast<size_t>(device::get<Is>(tuple))...}}, device::get<dim>(tuple));
Definition kokkos.hh:29
TBB_exec_space::memory_space TBB_memory_space
Definition kokkos.hh:38
Kokkos::DefaultExecutionSpace GPU_exec_space
Definition kokkos.hh:31
Threads_exec_space::memory_space Threads_memory_space
Definition kokkos.hh:35
GPU_exec_space::memory_space GPU_memory_space
Definition kokkos.hh:32
Kokkos::DefaultHostExecutionSpace Threads_exec_space
Definition kokkos.hh:34
Definition complex_math.hh:10
Kokkos::View< typename GetKokkosNDStarType< dim, T >::type, ExecutionSpace > KokkosNDView
Definition kokkos.hh:160
auto make_kokkos_nd_range(ExecutionSpace &space, const device::array< size_t, dim > start, const device::array< size_t, dim > end)
Definition kokkos.hh:227
device::array< size_t, dim > compute_tile_hints(const device::array< size_t, dim > &extents, size_t max_threads=256)
Compute clamped tile sizes for MDRangePolicy so that the product of tile dimensions does not exceed m...
Definition kokkos.hh:210
Kokkos::View< typename GetKokkosNDStarType< dim, T >::type, ExecutionSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > KokkosNDViewUnmanaged
Definition kokkos.hh:173
Kokkos::View< typename GetKokkosNDStarType< dim, T >::type, ExecutionSpace, Kokkos::MemoryTraits< Kokkos::Restrict > > KokkosNDViewRestrict
Definition kokkos.hh:165
std::conditional_t< std::is_same_v< MemorySpace, GPU_memory >, CPU_memory, GPU_memory > other_memory_space_t
Definition kokkos.hh:58
auto make_kokkos_nd_view_restrict(const std::string &label, const device::array< size_t, dim > &extents)
Definition kokkos.hh:188
KOKKOS_FORCEINLINE_FUNCTION auto make_kokkos_nd_thread_range(const TeamType &team, const device::array< size_t, dim > end)
Definition kokkos.hh:263
auto make_kokkos_nd_view(const std::string &label, const device::array< size_t, dim > &extents)
Definition kokkos.hh:181
KokkosNDRangeHelper< dim, ExecutionSpace >::type KokkosNDRange
Definition kokkos.hh:203
Definition kokkos.hh:340
Definition complex_math.hh:19
Definition kokkos.hh:148
typename GetKokkosNDStarType< dim - 1, T >::type * type
Definition kokkos.hh:149
This is a functor which wraps a lambda for reduction. Basically, this is necessary when one wants to ...
Definition kokkos.hh:314
KOKKOS_FORCEINLINE_FUNCTION void impl(device::integer_sequence< size_t, Is... >, Args &&...args) const
Definition kokkos.hh:329
KOKKOS_FUNCTION KokkosNDLambdaWrapperReduction(const FUN &_fun)
Definition kokkos.hh:316
KOKKOS_FORCEINLINE_FUNCTION void operator()(Args &&...args) const
Definition kokkos.hh:320
This is a functor which wraps a lambda. Basically, this is necessary when one wants to call a variadi...
Definition kokkos.hh:288
KOKKOS_FORCEINLINE_FUNCTION void operator()(Args &&...args) const
Definition kokkos.hh:294
KOKKOS_FUNCTION KokkosNDLambdaWrapper(const FUN &_fun)
Definition kokkos.hh:290
Kokkos::RangePolicy< ExecutionSpace > type
Definition kokkos.hh:201
Definition kokkos.hh:197
Kokkos::MDRangePolicy< Kokkos::Rank< dim >, ExecutionSpace > type
Definition kokkos.hh:198
An extension of the Kokkos::Sum reducer that adds a constant value to the result.
Definition kokkos.hh:66
KOKKOS_INLINE_FUNCTION SumPlus(value_type &value_, const saved_type &plus_value_)
Definition kokkos.hh:84
KOKKOS_INLINE_FUNCTION bool references_scalar() const
Definition kokkos.hh:109
KOKKOS_INLINE_FUNCTION SumPlus(const result_view_type &value_, const saved_type &plus_value_)
Definition kokkos.hh:90
KOKKOS_INLINE_FUNCTION value_type & reference() const
Definition kokkos.hh:103
Kokkos::View< value_type, Space > result_view_type
Definition kokkos.hh:74
KOKKOS_INLINE_FUNCTION void join(value_type &dest, const value_type &src) const
Definition kokkos.hh:97
KOKKOS_INLINE_FUNCTION void init(value_type &val) const
Definition kokkos.hh:100
This execution space is optimal when used in conjunction with the FE discretizations.
Definition kokkos.hh:23
Kokkos::DefaultHostExecutionSpace::memory_space memory_space
Definition kokkos.hh:24
static KOKKOS_FORCEINLINE_FUNCTION autodiff::Real< N, T > sum()
Definition kokkos.hh:342
Generated by