2 #ifdef ALPAKA_HOST_ONLY 3 #error ALPAKA_HOST_ONLY defined in device compilation 6 #include <alpaka/alpaka.hpp> 20 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
22 const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
39 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
41 portabletest::TestDeviceMultiCollection2::View<1>
view,
42 double xvalue)
const {
43 const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
59 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
61 portabletest::TestDeviceMultiCollection3::View<2>
view,
62 double xvalue)
const {
63 const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
87 auto workDiv = make_workdiv<Acc1D>(groups,
items);
103 auto workDiv = make_workdiv<Acc1D>(groups,
items);
104 auto workDiv2 = make_workdiv<Acc1D>(groups2,
items);
112 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
114 portabletest::TestDeviceObject::Product*
data,
132 auto workDiv = make_workdiv<Acc1D>(1, 1);
149 auto workDiv = make_workdiv<Acc1D>(groups,
items);
150 auto workDiv2 = make_workdiv<Acc1D>(groups2,
items);
151 auto workDiv3 = make_workdiv<Acc1D>(groups3,
items);
160 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
162 portabletest::TestDeviceCollection::ConstView
input,
173 if (
i < esData.
size()) {
183 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
199 if (
i < esData.
size()) {
206 if (
i < esData.
size()) {
216 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
235 if (
i < esData.
size()) {
238 printf(
"Setting x[0] to %f\n",
x);
244 if (
i < esData.
size()) {
250 double x3 = input3[
i].x3();
251 if (
i < esData.
size()) {
254 output3[
i] = {x3, input3[
i].y3(), input3[
i].z3(), input3[
i].id3(), input3[
i].m3()};
273 auto workDiv = make_workdiv<Acc1D>(groups,
items);
290 uint32_t groups =
divide_up_by(*std::max_element(sizes.begin(), sizes.end()),
items);
295 auto workDiv = make_workdiv<Acc1D>(groups,
items);
297 alpaka::exec<Acc1D>(
queue,
319 uint32_t groups =
divide_up_by(*std::max_element(sizes.begin(), sizes.end()),
items);
324 auto workDiv = make_workdiv<Acc1D>(groups,
items);
326 alpaka::exec<Acc1D>(
queue,
342 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
343 ALPAKA_FN_ACC
void operator()(TAcc
const& acc, portabletest::TestDeviceCollection::ConstView
view)
const {
344 const portabletest::Matrix matrix{{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
349 ALPAKA_ASSERT(
view.r() == 0.);
354 auto element =
view[
i];
355 ALPAKA_ASSERT(element.x() == 0.);
356 ALPAKA_ASSERT(element.y() == 0.);
357 ALPAKA_ASSERT(element.z() == 0.);
358 ALPAKA_ASSERT(element.id() == 0.);
359 ALPAKA_ASSERT(element.flags() ==
flags);
360 ALPAKA_ASSERT(element.m() ==
matrix);
367 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
368 ALPAKA_FN_ACC
void operator()(TAcc
const& acc, portabletest::TestDeviceMultiCollection2::ConstView<1>
view)
const {
369 const portabletest::Matrix matrix{{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
373 ALPAKA_ASSERT(
view.r2() == 0.);
378 auto element =
view[
i];
379 ALPAKA_ASSERT(element.x2() == 0.);
380 ALPAKA_ASSERT(element.y2() == 0.);
381 ALPAKA_ASSERT(element.z2() == 0.);
382 ALPAKA_ASSERT(element.id2() == 0.);
383 ALPAKA_ASSERT(element.m2() ==
matrix);
390 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
391 ALPAKA_FN_ACC
void operator()(TAcc
const& acc, portabletest::TestDeviceMultiCollection3::ConstView<2>
view)
const {
392 const portabletest::Matrix matrix{{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
396 ALPAKA_ASSERT(
view.r3() == 0.);
401 auto element =
view[
i];
402 ALPAKA_ASSERT(element.x3() == 0.);
403 ALPAKA_ASSERT(element.y3() == 0.);
404 ALPAKA_ASSERT(element.z3() == 0.);
405 ALPAKA_ASSERT(element.id3() == 0.);
406 ALPAKA_ASSERT(element.m3() ==
matrix);
413 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
414 ALPAKA_FN_ACC
void operator()(TAcc
const& acc, portabletest::TestDeviceObject::Product
const*
data)
const {
417 ALPAKA_ASSERT(
data->x == 0.);
418 ALPAKA_ASSERT(
data->y == 0.);
419 ALPAKA_ASSERT(
data->z == 0.);
420 ALPAKA_ASSERT(
data->id == 0);
430 auto workDiv = make_workdiv<Acc1D>(1, 32);
441 auto workDiv = make_workdiv<Acc1D>(1, 32);
454 auto workDiv = make_workdiv<Acc1D>(1, 32);
469 auto workDiv = make_workdiv<Acc1D>(1, 32);
void fillObject(Queue &queue, portabletest::TestDeviceObject &object, double x, double y, double z, int32_t id) const
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceCollection::View view, double xvalue) const
constexpr auto size() const
Eigen::Matrix< double, 3, 6 > Matrix
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceMultiCollection3::ConstView< 2 > view) const
portabletest::TestDeviceCollection update(Queue &queue, portabletest::TestDeviceCollection const &input, AlpakaESTestDataEDevice const &esData) const
PortableCollection< TestSoA > TestDeviceCollection
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceCollection::ConstView view) const
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceObject::Product *data, double x, double y, double z, int32_t id) const
static std::string const input
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceMultiCollection2::View< 1 > view, double xvalue) const
PortableObject< TestStruct > TestDeviceObject
void fillMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 &collection, double xvalue=0.) const
portabletest::TestDeviceMultiCollection2 updateMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 const &input, AlpakaESTestDataEDevice const &esData) const
constexpr int val(int i) const
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceMultiCollection2::ConstView< 1 > view) const
PortableCollection3< TestSoA, TestSoA2, TestSoA3 > TestDeviceMultiCollection3
void fill(Queue &queue, portabletest::TestDeviceCollection &collection, double xvalue=0.) const
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceObject::Product const *data) const
void checkZero(Queue &queue, portabletest::TestDeviceCollection const &collection) const
char data[epos_bytes_allocation]
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
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceCollection::ConstView input, AlpakaESTestDataEDevice::ConstView esData, portabletest::TestDeviceCollection::View output) const
constexpr int val2(int i) const
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
ALPAKA_FN_ACC void operator()(TAcc const &acc, portabletest::TestDeviceMultiCollection3::View< 2 > view, double xvalue) const
portabletest::TestDeviceMultiCollection3 updateMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 const &input, AlpakaESTestDataEDevice const &esData) const
PortableCollection2< TestSoA, TestSoA2 > TestDeviceMultiCollection2
void fillMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 &collection, double xvalue=0.) const