From 26c0428f240edb506a5b6a7aba96d2f25cddcf75 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Thu, 26 Dec 2024 10:22:48 +0100 Subject: [PATCH] Remove ddc::select calls --- benchmarks/deepcopy.cpp | 2 +- benchmarks/splines.cpp | 8 +++-- examples/characteristics_advection.cpp | 11 ++++--- examples/game_of_life.cpp | 16 ++++------ examples/heat_equation.cpp | 14 ++++---- examples/non_uniform_heat_equation.cpp | 6 ++-- include/ddc/discrete_domain.hpp | 4 +-- .../splines/constant_extrapolation_rule.hpp | 15 +++++---- .../ddc/kernels/splines/spline_evaluator.hpp | 6 ++-- .../kernels/splines/spline_evaluator_2d.hpp | 6 ++-- tests/chunk.cpp | 2 +- tests/discrete_domain.cpp | 12 +++---- tests/fft/fft.cpp | 6 ++-- tests/splines/batched_2d_spline_builder.cpp | 32 +++++++++---------- tests/splines/batched_spline_builder.cpp | 8 ++--- tests/splines/evaluator_2d.hpp | 12 +++---- tests/splines/extrapolation_rule.cpp | 8 ++--- tests/tagged_vector.cpp | 6 ++-- 18 files changed, 81 insertions(+), 93 deletions(-) diff --git a/benchmarks/deepcopy.cpp b/benchmarks/deepcopy.cpp index 0bdcc99c5..6e73c6a9e 100644 --- a/benchmarks/deepcopy.cpp +++ b/benchmarks/deepcopy.cpp @@ -115,7 +115,7 @@ static void deepcopy_subchunk_2d(benchmark::State& state) ChunkSpanXY const src(src_data.data(), dom); ChunkSpanXY const dst(dst_data.data(), dom); for (auto _ : state) { - for (DElemX const i : ddc::select(dom)) { + for (DElemX const i : DDomX(dom)) { ddc::ChunkSpan const dst_i = dst[i]; ddc::ChunkSpan const src_i = src[i]; ddc::parallel_deepcopy(dst_i, src_i); diff --git a/benchmarks/splines.cpp b/benchmarks/splines.cpp index 7727bd1b3..2df30f2c4 100644 --- a/benchmarks/splines.cpp +++ b/benchmarks/splines.cpp @@ -149,8 +149,9 @@ static void characteristics_advection_unitary(benchmark::State& state) ExecSpace(), x_mesh, KOKKOS_LAMBDA(ddc::DiscreteElement, DDimY> const ixy) { - double const x = ddc::coordinate(ddc::select>(ixy)); - double const y = ddc::coordinate(ddc::select(ixy)); + double const x = ddc::coordinate( + ddc::DiscreteElement>(ixy)); + double const y = ddc::coordinate(ddc::DiscreteElement(ixy)); density(ixy) = 9.999 * Kokkos::exp(-(x * x + y * y) / 0.1 / 2); // initial_density(ixy) = 9.999 * ((x * x + y * y) < 0.25); }); @@ -191,7 +192,8 @@ static void characteristics_advection_unitary(benchmark::State& state) KOKKOS_LAMBDA( ddc::DiscreteElement, DDimY> const e) { feet_coords(e) - = ddc::coordinate(ddc::select>(e)) + = ddc::coordinate( + ddc::DiscreteElement>(e)) - ddc::Coordinate(0.0176429863); }); Kokkos::Profiling::popRegion(); diff --git a/examples/characteristics_advection.cpp b/examples/characteristics_advection.cpp index fb3dd824f..72e5c714e 100644 --- a/examples/characteristics_advection.cpp +++ b/examples/characteristics_advection.cpp @@ -194,10 +194,10 @@ int main(int argc, char** argv) ddc::parallel_for_each( x_mesh, KOKKOS_LAMBDA(ddc::DiscreteElement const ixy) { - double const x - = ddc::coordinate(ddc::select(ixy)); - double const y - = ddc::coordinate(ddc::select(ixy)); + double const x = ddc::coordinate( + ddc::DiscreteElement(ixy)); + double const y = ddc::coordinate( + ddc::DiscreteElement(ixy)); initial_density(ixy) = 9.999 * Kokkos::exp(-(x * x + y * y) / 0.1 / 2); @@ -280,7 +280,8 @@ int main(int argc, char** argv) KOKKOS_LAMBDA( ddc::DiscreteElement const e) { feet_coords(e) - = ddc::coordinate(ddc::select(e)) + = ddc::coordinate( + ddc::DiscreteElement(e)) - ddc::Coordinate( vx * ddc::step()); }); diff --git a/examples/game_of_life.cpp b/examples/game_of_life.cpp index 94c2bade9..69b6e1692 100644 --- a/examples/game_of_life.cpp +++ b/examples/game_of_life.cpp @@ -35,10 +35,8 @@ void blinker_init( ddc::parallel_for_each( domain, KOKKOS_LAMBDA(ddc::DiscreteElement const ixy) { - ddc::DiscreteElement const ix - = ddc::select(ixy); - ddc::DiscreteElement const iy - = ddc::select(ixy); + ddc::DiscreteElement const ix(ixy); + ddc::DiscreteElement const iy(ixy); if (iy == ddc::DiscreteElement(2) && (ix >= ddc::DiscreteElement(1) && ix <= ddc::DiscreteElement(3))) { @@ -56,10 +54,10 @@ std::ostream& print_2DChunk( chunk) { ddc::for_each( - ddc::select(chunk.domain()), + ddc::DiscreteDomain(chunk.domain()), [&](ddc::DiscreteElement const iy) { ddc::for_each( - ddc::select(chunk.domain()), + ddc::DiscreteDomain(chunk.domain()), [&](ddc::DiscreteElement const ix) { os << (chunk(ix, iy) ? "*" : "."); }); @@ -108,10 +106,8 @@ int main() inner_domain_xy, KOKKOS_LAMBDA( ddc::DiscreteElement const ixy) { - ddc::DiscreteElement const ix - = ddc::select(ixy); - ddc::DiscreteElement const iy - = ddc::select(ixy); + ddc::DiscreteElement const ix(ixy); + ddc::DiscreteElement const iy(ixy); int alive_neighbors = 0; // Iterate on neighbors and increase the count of alive neighbors when necessary for (int i = -1; i < 2; ++i) { diff --git a/examples/heat_equation.cpp b/examples/heat_equation.cpp index 361ba971f..688d58cc1 100644 --- a/examples/heat_equation.cpp +++ b/examples/heat_equation.cpp @@ -259,10 +259,10 @@ int main(int argc, char** argv) ddc::parallel_for_each( ddc::DiscreteDomain(x_domain, y_domain), KOKKOS_LAMBDA(ddc::DiscreteElement const ixy) { - double const x - = ddc::coordinate(ddc::select(ixy)); - double const y - = ddc::coordinate(ddc::select(ixy)); + double const x = ddc::coordinate( + ddc::DiscreteElement(ixy)); + double const y = ddc::coordinate( + ddc::DiscreteElement(ixy)); ghosted_initial_temp(ixy) = 9.999 * ((x * x + y * y) < 0.25); }); @@ -334,10 +334,8 @@ int main(int argc, char** argv) next_temp.domain(), KOKKOS_LAMBDA( ddc::DiscreteElement const ixy) { - ddc::DiscreteElement const ix - = ddc::select(ixy); - ddc::DiscreteElement const iy - = ddc::select(ixy); + ddc::DiscreteElement const ix(ixy); + ddc::DiscreteElement const iy(ixy); double const dx_l = ddc::distance_at_left(ix); double const dx_r = ddc::distance_at_right(ix); double const dx_m = 0.5 * (dx_l + dx_r); diff --git a/examples/non_uniform_heat_equation.cpp b/examples/non_uniform_heat_equation.cpp index 40ba881dc..d64981da3 100644 --- a/examples/non_uniform_heat_equation.cpp +++ b/examples/non_uniform_heat_equation.cpp @@ -352,10 +352,8 @@ int main(int argc, char** argv) next_temp.domain(), KOKKOS_LAMBDA( ddc::DiscreteElement const ixy) { - ddc::DiscreteElement const ix - = ddc::select(ixy); - ddc::DiscreteElement const iy - = ddc::select(ixy); + ddc::DiscreteElement const ix(ixy); + ddc::DiscreteElement const iy(ixy); double const dx_l = ddc::distance_at_left(ix); double const dx_r = ddc::distance_at_right(ix); double const dx_m = 0.5 * (dx_l + dx_r); diff --git a/include/ddc/discrete_domain.hpp b/include/ddc/discrete_domain.hpp index 456e312e4..1b8cdc30c 100644 --- a/include/ddc/discrete_domain.hpp +++ b/include/ddc/discrete_domain.hpp @@ -467,7 +467,7 @@ replace_dim_of_1d( [[maybe_unused]] DiscreteDomain const& DDom_b) noexcept { if constexpr (std::is_same_v) { - return ddc::select(DDom_b); + return ddc::DiscreteDomain(DDom_b); } else { return DDom_a; } @@ -492,7 +492,7 @@ KOKKOS_FUNCTION constexpr auto replace_dim_of( DDim1, DDim2, DDimsA, - DDimsB...>(ddc::select(DDom_a), DDom_b)...); + DDimsB...>(ddc::DiscreteDomain(DDom_a), DDom_b)...); } // Replace dimensions from a domain type diff --git a/include/ddc/kernels/splines/constant_extrapolation_rule.hpp b/include/ddc/kernels/splines/constant_extrapolation_rule.hpp index 966b7d1a7..366c0b7cf 100644 --- a/include/ddc/kernels/splines/constant_extrapolation_rule.hpp +++ b/include/ddc/kernels/splines/constant_extrapolation_rule.hpp @@ -142,10 +142,10 @@ struct ConstantExtrapolationRule * * In the dimension defined in the constructor Dim1 (or Dim2), it sets the coordinate pos_1 (or pos_2) * given at the m_eval_pos coordinate if it is outside the domain. - * If the coordinate on the complementary dimension of the boundary condition dimension ddc::select(coord_extrap) is + * If the coordinate on the complementary dimension of the boundary condition dimension ddc::Coordinate(coord_extrap) is * outside the domain, then it also sets the coordinate at eval_pos_not_interest_min - * (if ddc::select(coord_extrap) @f$ < @f$ eval_pos_not_interest_min) or - * at eval_pos_not_interest_max (if ddc::select(coord_extrap) @f$ > @f$ eval_pos_not_interest_max). + * (if ddc::Coordinate(coord_extrap) @f$ < @f$ eval_pos_not_interest_min) or + * at eval_pos_not_interest_max (if ddc::Coordinate(coord_extrap) @f$ > @f$ eval_pos_not_interest_max). * * @param[in] coord_extrap * The coordinates where we want to evaluate the function on B-splines @@ -169,12 +169,13 @@ struct ConstantExtrapolationRule ddc::Coordinate eval_pos; if constexpr (DimNI::PERIODIC) { - eval_pos = ddc::Coordinate(m_eval_pos, ddc::select(coord_extrap)); + eval_pos = ddc:: + Coordinate(m_eval_pos, ddc::Coordinate(coord_extrap)); } else { eval_pos = ddc::Coordinate( m_eval_pos, Kokkos:: - clamp(ddc::select(coord_extrap), + clamp(ddc::Coordinate(coord_extrap), m_eval_pos_not_interest_min, m_eval_pos_not_interest_max)); } @@ -188,10 +189,10 @@ struct ConstantExtrapolationRule ddc::DiscreteElement const idx1 = ddc::discrete_space().eval_basis( vals1, - ddc::select(eval_pos)); + ddc::Coordinate(eval_pos)); ddc::DiscreteElement const idx2 = ddc::discrete_space().eval_basis( vals2, - ddc::select(eval_pos)); + ddc::Coordinate(eval_pos)); double y = 0.0; for (std::size_t i = 0; i < BSplines1::degree() + 1; ++i) { diff --git a/include/ddc/kernels/splines/spline_evaluator.hpp b/include/ddc/kernels/splines/spline_evaluator.hpp index b688a1c08..ad8d9568c 100644 --- a/include/ddc/kernels/splines/spline_evaluator.hpp +++ b/include/ddc/kernels/splines/spline_evaluator.hpp @@ -486,8 +486,7 @@ class SplineEvaluator ddc::ChunkSpan const spline_coef) const { - ddc::Coordinate coord_eval_interest - = ddc::select(coord_eval); + ddc::Coordinate coord_eval_interest(coord_eval); if constexpr (bsplines_type::is_periodic()) { if (coord_eval_interest < ddc::discrete_space().rmin() || coord_eval_interest > ddc::discrete_space().rmax()) { @@ -520,8 +519,7 @@ class SplineEvaluator std::array vals_ptr; Kokkos::mdspan> const vals(vals_ptr.data()); - ddc::Coordinate const coord_eval_interest - = ddc::select(coord_eval); + ddc::Coordinate const coord_eval_interest(coord_eval); if constexpr (std::is_same_v) { jmin = ddc::discrete_space().eval_basis(vals, coord_eval_interest); } else if constexpr (std::is_same_v) { diff --git a/include/ddc/kernels/splines/spline_evaluator_2d.hpp b/include/ddc/kernels/splines/spline_evaluator_2d.hpp index 24bc67230..64afe2465 100644 --- a/include/ddc/kernels/splines/spline_evaluator_2d.hpp +++ b/include/ddc/kernels/splines/spline_evaluator_2d.hpp @@ -1186,10 +1186,8 @@ class SplineEvaluator2D std::array vals2_ptr; Kokkos::mdspan> const vals2(vals2_ptr.data()); - ddc::Coordinate const coord_eval_interest1 - = ddc::select(coord_eval); - ddc::Coordinate const coord_eval_interest2 - = ddc::select(coord_eval); + ddc::Coordinate const coord_eval_interest1(coord_eval); + ddc::Coordinate const coord_eval_interest2(coord_eval); if constexpr (std::is_same_v) { jmin1 = ddc::discrete_space().eval_basis(vals1, coord_eval_interest1); diff --git a/tests/chunk.cpp b/tests/chunk.cpp index 1eeba82ae..5ef7133ab 100644 --- a/tests/chunk.cpp +++ b/tests/chunk.cpp @@ -590,7 +590,7 @@ TEST(Chunk2DTest, DeepcopyReordered) chunk(ix, iy) = 1.739 * ix.uid() + 1.412 * iy.uid(); } } - ChunkYX chunk2(ddc::select(chunk.domain())); + ChunkYX chunk2(DDomYX(chunk.domain())); ddc::ChunkSpan const chunk2_view(chunk2.data_handle(), chunk.domain()); ddc::parallel_deepcopy(chunk2_view, chunk); diff --git a/tests/discrete_domain.cpp b/tests/discrete_domain.cpp index 95076f03a..b6e93fe07 100644 --- a/tests/discrete_domain.cpp +++ b/tests/discrete_domain.cpp @@ -280,12 +280,12 @@ TEST(DiscreteDomainTest, Transpose3DConstructor) DDomZ const dom_z(lbound_z, nelems_z); DDomXYZ const dom_x_y_z(dom_x, dom_y, dom_z); DDomZYX const dom_z_y_x(dom_x_y_z); - EXPECT_EQ(ddc::select(dom_x_y_z.front()), ddc::select(dom_z_y_x.front())); - EXPECT_EQ(ddc::select(dom_x_y_z.front()), ddc::select(dom_z_y_x.front())); - EXPECT_EQ(ddc::select(dom_x_y_z.front()), ddc::select(dom_z_y_x.front())); - EXPECT_EQ(ddc::select(dom_x_y_z.back()), ddc::select(dom_z_y_x.back())); - EXPECT_EQ(ddc::select(dom_x_y_z.back()), ddc::select(dom_z_y_x.back())); - EXPECT_EQ(ddc::select(dom_x_y_z.back()), ddc::select(dom_z_y_x.back())); + EXPECT_EQ(DElemX(dom_x_y_z.front()), DElemX(dom_z_y_x.front())); + EXPECT_EQ(DElemY(dom_x_y_z.front()), DElemY(dom_z_y_x.front())); + EXPECT_EQ(DElemZ(dom_x_y_z.front()), DElemZ(dom_z_y_x.front())); + EXPECT_EQ(DElemX(dom_x_y_z.back()), DElemX(dom_z_y_x.back())); + EXPECT_EQ(DElemY(dom_x_y_z.back()), DElemY(dom_z_y_x.back())); + EXPECT_EQ(DElemZ(dom_x_y_z.back()), DElemZ(dom_z_y_x.back())); } TEST(DiscreteDomainTest, CartesianProduct) diff --git a/tests/fft/fft.cpp b/tests/fft/fft.cpp index 7788983cf..1ec1b84e8 100644 --- a/tests/fft/fft.cpp +++ b/tests/fft/fft.cpp @@ -100,8 +100,7 @@ static void test_fft() exec_space, f.domain(), KOKKOS_LAMBDA(DElem...> const e) { - ddc::Real const xn2 - = (Kokkos::pow(ddc::coordinate(ddc::select>(e)), 2) + ...); + ddc::Real const xn2 = (Kokkos::pow(ddc::coordinate(DElem>(e)), 2) + ...); f(e) = Kokkos::exp(-xn2 / 2); }); ddc::Chunk f_bis_alloc(f.domain(), ddc::KokkosAllocator()); @@ -144,8 +143,7 @@ static void test_fft() 0., ddc::reducer::sum(), [=](DElem>...> const e) { - double const xn2 - = (pow2(ddc::coordinate(ddc::select>>(e))) + ...); + double const xn2 = (pow2(ddc::coordinate(DElem>>(e))) + ...); double const diff = Kokkos::abs(Ff_host(e)) - Kokkos::exp(-xn2 / 2); std::size_t const denom = (ddc::detail::fft::LastSelector(Nx / 2, Nx) * ...); diff --git a/tests/splines/batched_2d_spline_builder.cpp b/tests/splines/batched_2d_spline_builder.cpp index a14ae3dfd..bdd7aa1b7 100644 --- a/tests/splines/batched_2d_spline_builder.cpp +++ b/tests/splines/batched_2d_spline_builder.cpp @@ -305,7 +305,7 @@ static void Batched2dSplineTest() exec_space, vals.domain(), KOKKOS_LAMBDA(Index...> const e) { - vals(e) = vals_1d(ddc::select, IDim>(e)); + vals(e) = vals_1d(Index, IDim>(e)); }); #if defined(BC_HERMITE) @@ -337,8 +337,7 @@ static void Batched2dSplineTest() derivs_1d_lhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs_1d_lhs.domain())::discrete_element_type const e) { - derivs_1d_lhs(e) - = derivs_1d_lhs1(ddc::select, IDim>(e)); + derivs_1d_lhs(e) = derivs_1d_lhs1(Index, IDim>(e)); }); } @@ -368,8 +367,7 @@ static void Batched2dSplineTest() derivs_1d_rhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs_1d_rhs.domain())::discrete_element_type const e) { - derivs_1d_rhs(e) - = derivs_1d_rhs1(ddc::select, IDim>(e)); + derivs_1d_rhs(e) = derivs_1d_rhs1(Index, IDim>(e)); }); } @@ -398,7 +396,7 @@ static void Batched2dSplineTest() derivs2_lhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs2_lhs.domain())::discrete_element_type const e) { - derivs2_lhs(e) = derivs2_lhs1(ddc::select, ddc::Deriv>(e)); + derivs2_lhs(e) = derivs2_lhs1(Index, ddc::Deriv>(e)); }); } @@ -427,7 +425,7 @@ static void Batched2dSplineTest() derivs2_rhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs2_rhs.domain())::discrete_element_type const e) { - derivs2_rhs(e) = derivs2_rhs1(ddc::select, ddc::Deriv>(e)); + derivs2_rhs(e) = derivs2_rhs1(Index, ddc::Deriv>(e)); }); } @@ -492,13 +490,13 @@ static void Batched2dSplineTest() dom_derivs, KOKKOS_LAMBDA(typename decltype(dom_derivs)::discrete_element_type const e) { derivs_mixed_lhs_lhs(e) - = derivs_mixed_lhs_lhs1(ddc::select, ddc::Deriv>(e)); + = derivs_mixed_lhs_lhs1(Index, ddc::Deriv>(e)); derivs_mixed_rhs_lhs(e) - = derivs_mixed_rhs_lhs1(ddc::select, ddc::Deriv>(e)); + = derivs_mixed_rhs_lhs1(Index, ddc::Deriv>(e)); derivs_mixed_lhs_rhs(e) - = derivs_mixed_lhs_rhs1(ddc::select, ddc::Deriv>(e)); + = derivs_mixed_lhs_rhs1(Index, ddc::Deriv>(e)); derivs_mixed_rhs_rhs(e) - = derivs_mixed_rhs_rhs1(ddc::select, ddc::Deriv>(e)); + = derivs_mixed_rhs_rhs1(Index, ddc::Deriv>(e)); }); } #endif @@ -602,8 +600,8 @@ static void Batched2dSplineTest() 0., ddc::reducer::max(), KOKKOS_LAMBDA(Index...> const e) { - Coord const x = ddc::coordinate(ddc::select>(e)); - Coord const y = ddc::coordinate(ddc::select>(e)); + Coord const x = ddc::coordinate(Index>(e)); + Coord const y = ddc::coordinate(Index>(e)); return Kokkos::abs(spline_eval_deriv1(e) - evaluator.deriv(x, y, 1, 0)); }); double const max_norm_error_diff2 = ddc::parallel_transform_reduce( @@ -612,8 +610,8 @@ static void Batched2dSplineTest() 0., ddc::reducer::max(), KOKKOS_LAMBDA(Index...> const e) { - Coord const x = ddc::coordinate(ddc::select>(e)); - Coord const y = ddc::coordinate(ddc::select>(e)); + Coord const x = ddc::coordinate(Index>(e)); + Coord const y = ddc::coordinate(Index>(e)); return Kokkos::abs(spline_eval_deriv2(e) - evaluator.deriv(x, y, 0, 1)); }); double const max_norm_error_diff12 = ddc::parallel_transform_reduce( @@ -622,8 +620,8 @@ static void Batched2dSplineTest() 0., ddc::reducer::max(), KOKKOS_LAMBDA(Index...> const e) { - Coord const x = ddc::coordinate(ddc::select>(e)); - Coord const y = ddc::coordinate(ddc::select>(e)); + Coord const x = ddc::coordinate(Index>(e)); + Coord const y = ddc::coordinate(Index>(e)); return Kokkos::abs(spline_eval_deriv12(e) - evaluator.deriv(x, y, 1, 1)); }); diff --git a/tests/splines/batched_spline_builder.cpp b/tests/splines/batched_spline_builder.cpp index 114a3708b..19588634b 100644 --- a/tests/splines/batched_spline_builder.cpp +++ b/tests/splines/batched_spline_builder.cpp @@ -256,7 +256,7 @@ static void BatchedSplineTest() exec_space, vals.domain(), KOKKOS_LAMBDA(Index...> const e) { - vals(e) = vals_1d(ddc::select>(e)); + vals(e) = vals_1d(Index>(e)); }); #if defined(BC_HERMITE) @@ -280,7 +280,7 @@ static void BatchedSplineTest() derivs_lhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs_lhs.domain())::discrete_element_type const e) { - derivs_lhs(e) = derivs_lhs1(ddc::select>(e)); + derivs_lhs(e) = derivs_lhs1(Index>(e)); }); } @@ -303,7 +303,7 @@ static void BatchedSplineTest() derivs_rhs.domain(), KOKKOS_LAMBDA( typename decltype(derivs_rhs.domain())::discrete_element_type const e) { - derivs_rhs(e) = derivs_rhs1(ddc::select>(e)); + derivs_rhs(e) = derivs_rhs1(Index>(e)); }); } #endif @@ -381,7 +381,7 @@ static void BatchedSplineTest() 0., ddc::reducer::max(), KOKKOS_LAMBDA(Index...> const e) { - Coord const x = ddc::coordinate(ddc::select>(e)); + Coord const x = ddc::coordinate(Index>(e)); return Kokkos::abs(spline_eval_deriv(e) - evaluator.deriv(x, 1)); }); double const max_norm_error_integ = ddc::parallel_transform_reduce( diff --git a/tests/splines/evaluator_2d.hpp b/tests/splines/evaluator_2d.hpp index 0aa481771..4a21f2393 100644 --- a/tests/splines/evaluator_2d.hpp +++ b/tests/splines/evaluator_2d.hpp @@ -18,8 +18,8 @@ struct Evaluator2D public: template explicit Evaluator(Domain domain) - : eval_func1(ddc::select(domain)) - , eval_func2(ddc::select(domain)) + : eval_func1(ddc::DiscreteDomain(domain)) + , eval_func2(ddc::DiscreteDomain(domain)) { } @@ -39,8 +39,8 @@ struct Evaluator2D { auto const& domain = chunk.domain(); - for (ddc::DiscreteElement const i : ddc::select(domain)) { - for (ddc::DiscreteElement const j : ddc::select(domain)) { + for (ddc::DiscreteElement const i : ddc::DiscreteDomain(domain)) { + for (ddc::DiscreteElement const j : ddc::DiscreteDomain(domain)) { chunk(i, j) = eval_func1(ddc::coordinate(i)) * eval_func2(ddc::coordinate(j)); } } @@ -73,8 +73,8 @@ struct Evaluator2D { auto const& domain = chunk.domain(); - for (ddc::DiscreteElement const i : ddc::select(domain)) { - for (ddc::DiscreteElement const j : ddc::select(domain)) { + for (ddc::DiscreteElement const i : ddc::DiscreteDomain(domain)) { + for (ddc::DiscreteElement const j : ddc::DiscreteDomain(domain)) { chunk(i, j) = eval_func1.deriv(ddc::coordinate(i), derivative_x) * eval_func2.deriv(ddc::coordinate(j), derivative_y); } diff --git a/tests/splines/extrapolation_rule.cpp b/tests/splines/extrapolation_rule.cpp index efeea2581..391750b78 100644 --- a/tests/splines/extrapolation_rule.cpp +++ b/tests/splines/extrapolation_rule.cpp @@ -254,7 +254,7 @@ static void ExtrapolationRuleSplineTest() exec_space, vals.domain(), KOKKOS_LAMBDA(Index...> const e) { - vals(e) = vals_1d(ddc::select, IDim>(e)); + vals(e) = vals_1d(Index, IDim>(e)); }); // Instantiate chunk of spline coefs to receive output of spline_builder @@ -336,11 +336,11 @@ static void ExtrapolationRuleSplineTest() coords_eval(e) = ddc::coordinate(e); // Set coords_eval outside of the domain (+1 to ensure left bound is outside domain) ddc::get(coords_eval(e)) - = xN() + (ddc::select(ddc::coordinate(e)) - x0()) + 1; + = xN() + (Coord(ddc::coordinate(e)) - x0()) + 1; // Set coords_eval outside of the domain (this point should be found on the grid in // the periodic case) ddc::get(coords_eval(e)) - = 2 * xN() + (ddc::select(ddc::coordinate(e)) - x0()); + = 2 * xN() + (Coord(ddc::coordinate(e)) - x0()); }); @@ -366,7 +366,7 @@ static void ExtrapolationRuleSplineTest() vals.template domain>()))::discrete_element_type const e_without_interest(e); double tmp; - if (ddc::select(coords_eval(e)) > xN()) { + if (Coord(coords_eval(e)) > xN()) { #if defined(BC_PERIODIC) tmp = vals(ddc::DiscreteElement...>( vals.template domain>().back(), diff --git a/tests/tagged_vector.cpp b/tests/tagged_vector.cpp index b982a4016..0fb30a8e8 100644 --- a/tests/tagged_vector.cpp +++ b/tests/tagged_vector.cpp @@ -26,8 +26,8 @@ TEST(TaggedVector, ConstructorFromTaggedVectors) TEST(TaggedVector, ReorderingConstructor) { ddc::detail::TaggedVector const map_ref(1, 2); - ddc::detail::TaggedVector const submap_double = ddc::select(map_ref); - ddc::detail::TaggedVector const submap_float = ddc::select(map_ref); + ddc::detail::TaggedVector const submap_double(map_ref); + ddc::detail::TaggedVector const submap_float(map_ref); ddc::detail::TaggedVector const map_v1(submap_double, submap_float); ddc::detail::TaggedVector const map_v2(submap_float, submap_double); ddc::detail::TaggedVector const map_v3(map_ref); @@ -70,7 +70,7 @@ TEST(TaggedVector, Operators) { ddc::detail::TaggedVector const a(1, 2); ddc::detail::TaggedVector const b(3, 4); - ddc::detail::TaggedVector const c = ddc::select(a); + ddc::detail::TaggedVector const c(a); EXPECT_EQ(a + b, (ddc::detail::TaggedVector(5, 5))); EXPECT_EQ(b - a, (ddc::detail::TaggedVector(3, 1))); EXPECT_EQ(c + 4, (ddc::detail::TaggedVector(5)));