CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernel Class Reference

Public Member Functions

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void operator() (TAcc const &acc, portabletest::TestDeviceCollection::View view, double xvalue) const
 

Detailed Description

Definition at line 18 of file TestAlgo.dev.cc.

Member Function Documentation

◆ operator()()

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernel::operator() ( TAcc const &  acc,
portabletest::TestDeviceCollection::View  view,
double  xvalue 
) const
inline

Definition at line 21 of file TestAlgo.dev.cc.

References HLT_2024v14_cff::flags, mps_fire::i, makeMuonMisalignmentScenario::matrix, cms::alpakatools::once_per_grid(), and cms::alpakatools::uniform_elements().

21  {
22  // global index of the thread within the grid
23  const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
24  const portabletest::Array flags = {{6, 4, 2, 0}};
25 
26  // set this only once in the whole kernel grid
27  if (once_per_grid(acc)) {
28  view.r() = 1.;
29  }
30 
31  // make a strided loop over the kernel grid, covering up to "size" elements
32  for (int32_t i : uniform_elements(acc, view.metadata().size())) {
33  view[i] = {xvalue, 0., 0., i, flags, matrix * i};
34  }
35  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
Eigen::Matrix< double, 3, 6 > Matrix
Definition: TestSoA.h:19
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)