CMS 3D CMS Logo

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

Detailed Description

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

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

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

229  {
230  // set this only once in the whole kernel grid
231  if (once_per_grid(acc)) {
232  output.r() = input.r();
233  output2.r2() = input2.r2();
234  output3.r3() = input3.r3();
235  }
236 
237  // make a strided loop over the kernel grid, covering up to "size" elements
238  for (int32_t i : uniform_elements(acc, output.metadata().size())) {
239  double x = input[i].x();
240  if (i < esData.size()) {
241  x += esData.val(i) + esData.val2(i);
242  if (0 == i)
243  printf("Setting x[0] to %f\n", x);
244  }
245  output[i] = {x, input[i].y(), input[i].z(), input[i].id(), input[i].flags(), input[i].m()};
246  }
247  for (int32_t i : uniform_elements(acc, output2.metadata().size())) {
248  double x2 = input2[i].x2();
249  if (i < esData.size()) {
250  x2 += esData.val(i) + esData.val2(i);
251  }
252  output2[i] = {x2, input2[i].y2(), input2[i].z2(), input2[i].id2(), input2[i].m2()};
253  }
254  for (int32_t i : uniform_elements(acc, output3.metadata().size())) {
255  double x3 = input3[i].x3();
256  if (i < esData.size()) {
257  x3 += esData.val(i) + esData.val2(i);
258  }
259  output3[i] = {x3, input3[i].y3(), input3[i].z3(), input3[i].id3(), input3[i].m3()};
260  }
261  }
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