Skip to content

Commit

Permalink
fix lambda capture
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Aug 8, 2023
1 parent e7593a7 commit e550cb7
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ struct TestFunctorA {
auto it = KE::copy(member, KE::begin(myRowViewFrom),
KE::end(myRowViewFrom), KE::begin(myRowViewDest));

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it = KE::copy(member, myRowViewFrom, myRowViewDest);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamCopyBackward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ struct TestFunctorA {
KE::copy_backward(member, KE::cbegin(myRowViewFrom),
KE::cend(myRowViewFrom), KE::end(myRowViewDest));

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it = KE::copy_backward(member, myRowViewFrom, myRowViewDest);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamCopyIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ struct TestFunctorA {
KE::copy_if(member, KE::begin(myRowViewFrom), KE::end(myRowViewFrom),
KE::begin(myRowViewDest), predicate);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it = KE::copy_if(member, myRowViewFrom, myRowViewDest, predicate);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamCopy_n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ struct TestFunctorA {
auto it = KE::copy_n(member, KE::begin(myRowViewFrom), m_copyCount,
KE::begin(myRowViewDest));

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it = KE::copy_n(member, myRowViewFrom, m_copyCount, myRowViewDest);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamRemove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ struct TestFunctorA {
auto it = KE::remove(member, KE::begin(myRowView), KE::end(myRowView),
m_targetValue);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) = KE::distance(KE::begin(myRowView), it);
});
} else if (m_apiPick == 1) {
auto it = KE::remove(member, myRowView, m_targetValue);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) = KE::distance(KE::begin(myRowView), it);
});
}
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamRemoveCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ struct TestFunctorA {
KE::cend(myRowViewFrom),
KE::begin(myRowViewDest), m_targetValue);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it =
KE::remove_copy(member, myRowViewFrom, myRowViewDest, m_targetValue);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamRemoveCopyIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ struct TestFunctorA {
KE::cend(myRowViewFrom),
KE::begin(myRowViewDest), predicate);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it =
KE::remove_copy_if(member, myRowViewFrom, myRowViewDest, predicate);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down
4 changes: 2 additions & 2 deletions algorithms/unit_tests/TestStdAlgorithmsTeamRemoveIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ struct TestFunctorA {
auto it = KE::remove_if(member, KE::begin(myRowView), KE::end(myRowView),
predicate);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) = KE::distance(KE::begin(myRowView), it);
});
} else if (m_apiPick == 1) {
auto it = KE::remove_if(member, myRowView, predicate);
Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) = KE::distance(KE::begin(myRowView), it);
});
}
Expand Down
8 changes: 4 additions & 4 deletions algorithms/unit_tests/TestStdAlgorithmsTeamUniqueCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ struct TestFunctorA {
KE::unique_copy(member, KE::begin(myRowViewFrom),
KE::end(myRowViewFrom), KE::begin(myRowViewDest));

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
} else if (m_apiPick == 1) {
auto it = KE::unique_copy(member, myRowViewFrom, myRowViewDest);

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand All @@ -72,7 +72,7 @@ struct TestFunctorA {
KE::end(myRowViewFrom),
KE::begin(myRowViewDest), comparator_t());

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand All @@ -82,7 +82,7 @@ struct TestFunctorA {
auto it =
KE::unique_copy(member, myRowViewFrom, myRowViewDest, comparator_t());

Kokkos::single(Kokkos::PerTeam(member), [=]() {
Kokkos::single(Kokkos::PerTeam(member), [=, *this]() {
m_distancesView(myRowIndex) =
KE::distance(KE::begin(myRowViewDest), it);
});
Expand Down

0 comments on commit e550cb7

Please sign in to comment.