CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernel Class Reference

Public Member Functions

template<typename TAcc , typename = std::enable_if_t<is_accelerator_v<TAcc>>>
ALPAKA_FN_ACC void operator() (TAcc const &acc, portabletest::TestDeviceCollection::View view, int32_t size) const
 

Detailed Description

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

Member Function Documentation

◆ operator()()

template<typename TAcc , typename = std::enable_if_t<is_accelerator_v<TAcc>>>
ALPAKA_FN_ACC void ALPAKA_ACCELERATOR_NAMESPACE::TestAlgoKernel::operator() ( TAcc const &  acc,
portabletest::TestDeviceCollection::View  view,
int32_t  size 
) const
inline

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

References mps_fire::i, makeMuonMisalignmentScenario::matrix, and findQualityFiles::size.

22  {
23  // global index of the thread within the grid
24  const int32_t thread = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc)[0u];
25  const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
26 
27  // set this only once in the whole kernel grid
28  if (thread == 0) {
29  view.r() = 1.;
30  }
31 
32  // make a strided loop over the kernel grid, covering up to "size" elements
33  for (int32_t i : elements_with_stride(acc, size)) {
34  view[i] = {0., 0., 0., i, matrix * i};
35  }
36  }
size
Write out results.
Eigen::Matrix< double, 3, 6 > Matrix
Definition: TestSoA.h:13