8#include "select_from_type_seq.hpp"
9#include "type_seq_ext.hpp"
17template <
class CommonSeq>
20template <
class... CommonDDim>
21struct ClampToDomain<ddc::detail::TypeSeq<CommonDDim...>>
23 template <
class BatchDomain,
class Elem>
24 KOKKOS_FUNCTION
static Elem run(BatchDomain
const& batch_domain, Elem elem)
26 ddc::DiscreteDomain<CommonDDim...>
const common_domain
28 ddc::DiscreteElement<CommonDDim...>
const front = common_domain.front();
29 ddc::DiscreteElement<CommonDDim...>
const back = common_domain.back();
31 ((elem.template uid<CommonDDim>() = std::
32 min(std::max(elem.template uid<CommonDDim>(), front.template uid<CommonDDim>()),
33 back.template uid<CommonDDim>())),
41template <
class BatchDomain,
class Elem>
42KOKKOS_FUNCTION Elem
clamp_to_domain(BatchDomain
const& batch_domain, Elem
const& elem)
46 return detail::ClampToDomain<CommonSeq>::run(batch_domain, elem);
KOKKOS_FUNCTION Elem clamp_to_domain(BatchDomain const &batch_domain, Elem const &elem)
ddc::type_seq_remove_t< TagSeqA, ddc::type_seq_remove_t< TagSeqA, TagSeqB > > type_seq_intersect_t
KOKKOS_FUNCTION auto select_from_type_seq(T t)
The top-level namespace of SimiLie.