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 164 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 167 of file TestAlgo.dev.cc.

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

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