CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernelUpdateMulti2 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::TestSoA::ConstView input, portabletest::TestSoA2::ConstView input2, AlpakaESTestDataEDevice::ConstView esData, portabletest::TestSoA::View output, portabletest::TestSoA2::View output2) const
 

Detailed Description

Definition at line 186 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::TestAlgoKernelUpdateMulti2::operator() ( TAcc const &  acc,
portabletest::TestSoA::ConstView  input,
portabletest::TestSoA2::ConstView  input2,
AlpakaESTestDataEDevice::ConstView  esData,
portabletest::TestSoA::View  output,
portabletest::TestSoA2::View  output2 
) const
inline

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

References mps_fire::i, input, input2, cms::alpakatools::once_per_grid(), skim900GeV_StreamA_MinBiasPD_cfg::output2, cms::alpakatest::AlpakaESTestDataE< TDev >::ConstView::size(), cms::alpakatools::uniform_elements(), cms::alpakatest::AlpakaESTestDataE< TDev >::ConstView::val(), cms::alpakatest::AlpakaESTestDataE< TDev >::ConstView::val2(), and x.

194  {
195  // set this only once in the whole kernel grid
196  if (once_per_grid(acc)) {
197  output.r() = input.r();
198  output2.r2() = input2.r2();
199  }
200 
201  // make a strided loop over the kernel grid, covering up to "size" elements
202  for (int32_t i : uniform_elements(acc, output.metadata().size())) {
203  double x = input[i].x();
204  if (i < esData.size()) {
205  x += esData.val(i) + esData.val2(i);
206  }
207  output[i] = {x, input[i].y(), input[i].z(), input[i].id(), input[i].flags(), input[i].m()};
208  }
209  for (int32_t i : uniform_elements(acc, output2.metadata().size())) {
210  double x2 = input2[i].x2();
211  if (i < esData.size()) {
212  x2 += esData.val(i) + esData.val2(i);
213  }
214  output2[i] = {x2, input2[i].y2(), input2[i].z2(), input2[i].id2(), input2[i].m2()};
215  }
216  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
#define input2
Definition: AMPTWrapper.h:159
static std::string const input
Definition: EdmProvDump.cc:50
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)
Definition: output.py:1