CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernelUpdate 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::ConstView input, AlpakaESTestDataEDevice::ConstView esData, portabletest::TestDeviceCollection::View output) const
 

Detailed Description

Definition at line 163 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::TestAlgoKernelUpdate::operator() ( TAcc const &  acc,
portabletest::TestDeviceCollection::ConstView  input,
AlpakaESTestDataEDevice::ConstView  esData,
portabletest::TestDeviceCollection::View  output 
) const
inline

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

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

169  {
170  // set this only once in the whole kernel grid
171  if (once_per_grid(acc)) {
172  output.r() = input.r();
173  }
174 
175  // make a strided loop over the kernel grid, covering up to "size" elements
176  for (int32_t i : uniform_elements(acc, output.metadata().size())) {
177  double x = input[i].x();
178  if (i < esData.size()) {
179  x += esData.val(i) + esData.val2(i);
180  }
181  output[i] = {x, input[i].y(), input[i].z(), input[i].id(), input[i].flags(), input[i].m()};
182  }
183  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
static std::string const input
Definition: EdmProvDump.cc:50
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)
Definition: output.py:1