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 187 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 190 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.

195  {
196  // set this only once in the whole kernel grid
197  if (once_per_grid(acc)) {
198  output.r() = input.r();
199  output2.r2() = input2.r2();
200  }
201 
202  // make a strided loop over the kernel grid, covering up to "size" elements
203  for (int32_t i : uniform_elements(acc, output.metadata().size())) {
204  double x = input[i].x();
205  if (i < esData.size()) {
206  x += esData.val(i) + esData.val2(i);
207  }
208  output[i] = {x, input[i].y(), input[i].z(), input[i].id(), input[i].flags(), input[i].m()};
209  }
210  for (int32_t i : uniform_elements(acc, output2.metadata().size())) {
211  double x2 = input2[i].x2();
212  if (i < esData.size()) {
213  x2 += esData.val(i) + esData.val2(i);
214  }
215  output2[i] = {x2, input2[i].y2(), input2[i].z2(), input2[i].id2(), input2[i].m2()};
216  }
217  }
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