Skip to content

Commit

Permalink
Use Policy for all parallel_for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gojakuch committed Apr 9, 2024
1 parent 17fc64b commit ca62619
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions unittests/Kokkos/ParallelFor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ TEST(ParallelFor, HelloWorldLambdaLoopForward) {
// const double tau = 1e-6; // tolerance

std::function<double(double)> _f = [](double x) {
using Policy = Kokkos::RangePolicy<Kokkos::DefaultHostExecutionSpace>;
double res[5] = {0};
Kokkos::parallel_for("HelloWorld-forward", 5,
Kokkos::parallel_for("HelloWorld-forward", Policy(0, 5),
[&res, x](const int i) {
res[i] = x*x;
});
Expand All @@ -34,8 +35,9 @@ TEST(ParallelFor, HelloWorldLambdaLoopReverse) {
// const double tau = 1e-6; // tolerance

std::function<double(double)> _f = [](double x) {
using Policy = Kokkos::RangePolicy<Kokkos::DefaultHostExecutionSpace>;
double res[5] = {0};
Kokkos::parallel_for("HelloWorld-reverse", 5,
Kokkos::parallel_for("HelloWorld-reverse", Policy(0, 5),
[&res, x](const int i) {
res[i] = x*x;
});
Expand Down

0 comments on commit ca62619

Please sign in to comment.