CMS 3D CMS Logo

Namespaces | Classes | Functions
alpaka Namespace Reference

Namespaces

 trait
 

Classes

class  HostOnlyTask
 

Functions

template<typename TDim , typename TVal , typename... Vecs, typename = std::enable_if_t<(std::is_same_v<Vec<TDim, TVal>, Vecs> && ...)>>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto elementwise_max (Vec< TDim, TVal > const &p, Vecs const &... qs) -> Vec< TDim, TVal >
 
template<typename TDim , typename TVal , typename... Vecs, typename = std::enable_if_t<(std::is_same_v<Vec<TDim, TVal>, Vecs> && ...)>>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto elementwise_min (Vec< TDim, TVal > const &p, Vecs const &... qs) -> Vec< TDim, TVal >
 

Function Documentation

◆ elementwise_max()

template<typename TDim , typename TVal , typename... Vecs, typename = std::enable_if_t<(std::is_same_v<Vec<TDim, TVal>, Vecs> && ...)>>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto alpaka::elementwise_max ( Vec< TDim, TVal > const &  p,
Vecs const &...  qs 
) -> Vec<TDim, TVal>
Returns
The element-wise maximum of one or more vectors.

Definition at line 31 of file vec.h.

References mps_fire::i, SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, and relativeConstraints::value.

31  {
32  Vec<TDim, TVal> r;
33  if constexpr (TDim::value > 0) {
34  for (typename TDim::value_type i = 0; i < TDim::value; ++i)
35  r[i] = std::max({p[i], qs[i]...});
36  }
37  return r;
38  }

◆ elementwise_min()

template<typename TDim , typename TVal , typename... Vecs, typename = std::enable_if_t<(std::is_same_v<Vec<TDim, TVal>, Vecs> && ...)>>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto alpaka::elementwise_min ( Vec< TDim, TVal > const &  p,
Vecs const &...  qs 
) -> Vec<TDim, TVal>
Returns
The element-wise minimum of one or more vectors.

Definition at line 16 of file vec.h.

References mps_fire::i, SiStripPI::min, AlCaHLTBitMon_ParallelJobs::p, and relativeConstraints::value.

16  {
17  Vec<TDim, TVal> r;
18  if constexpr (TDim::value > 0) {
19  for (typename TDim::value_type i = 0; i < TDim::value; ++i)
20  r[i] = std::min({p[i], qs[i]...});
21  }
22  return r;
23  }