Skip to content

Commit

Permalink
Explicitly capture some variables in test_matrix_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Jul 12, 2023
1 parent 2010844 commit 5729b2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/unit/matrix/test_matrix_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ TYPED_TEST(MatrixRefTest, NonConstRefFromNonConstMatrix) {
constexpr Type el_submatrix(1);
constexpr Type el_border(-1);

const auto f_el_submatrix = [](const GlobalElementIndex&) { return el_submatrix; };
const auto f_el_border = [](const GlobalElementIndex&) { return el_border; };
const auto f_el_submatrix = [el_submatrix](const GlobalElementIndex&) { return el_submatrix; };
const auto f_el_border = [el_border](const GlobalElementIndex&) { return el_border; };

for (const auto& comm_grid : this->commGrids()) {
for (const auto& test : tests_sub_matrix) {
Expand All @@ -136,7 +136,7 @@ TYPED_TEST(MatrixRefTest, NonConstRefFromNonConstMatrix) {
for (const auto& ij_local : iterate_range2d(mat_ref.distribution().localNrTiles())) {
ex::start_detached(mat_ref.readwrite(ij_local) |
dlaf::internal::transform(dlaf::internal::Policy<Backend::MC>(),
[&](const auto& tile) {
[el_submatrix](const auto& tile) {
set(tile, el_submatrix);
}));
}
Expand All @@ -153,7 +153,7 @@ TYPED_TEST(MatrixRefTest, ConstRefFromNonConstMatrix) {
constexpr Type el_submatrix(1);
constexpr Type el_border(-1);

const auto f_el_submatrix = [](const GlobalElementIndex&) { return el_submatrix; };
const auto f_el_submatrix = [el_submatrix](const GlobalElementIndex&) { return el_submatrix; };

for (const auto& comm_grid : this->commGrids()) {
for (const auto& test : tests_sub_matrix) {
Expand All @@ -180,7 +180,7 @@ TYPED_TEST(MatrixRefTest, ConstRefFromConstMatrix) {
constexpr Type el_submatrix(1);
constexpr Type el_border(-1);

const auto f_el_submatrix = [](const GlobalElementIndex&) { return el_submatrix; };
const auto f_el_submatrix = [el_submatrix](const GlobalElementIndex&) { return el_submatrix; };

for (const auto& comm_grid : this->commGrids()) {
for (const auto& test : tests_sub_matrix) {
Expand Down

0 comments on commit 5729b2a

Please sign in to comment.