Skip to content

Commit

Permalink
Removing reallocation for approx_values
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlag31 committed Dec 27, 2023
1 parent 5b86976 commit 27dd128
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/interpolation/ArborX_InterpMovingLeastSquares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ class MovingLeastSquares
int const num_targets = _values_indices.extent(0);
int const num_neighbors = _values_indices.extent(1);

KokkosExt::reallocWithoutInitializing(space, approx_values, num_targets);
// Approx values must have the correct size
KOKKOS_ASSERT(approx_values.extent_int(0) == num_targets);

Kokkos::parallel_for(
"ArborX::MovingLeastSquares::target_interpolation",
Expand Down
8 changes: 4 additions & 4 deletions test/tstInterpMovingLeastSquares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(moving_least_squares, DeviceType,
Kokkos::View<Point0 *, MemorySpace> tgtp0("Testing::tgtp0", 3);
Kokkos::View<double *, MemorySpace> srcv0("Testing::srcv0", 4);
Kokkos::View<double *, MemorySpace> tgtv0("Testing::tgtv0", 3);
Kokkos::View<double *, MemorySpace> eval0("Testing::eval0", 0);
Kokkos::View<double *, MemorySpace> eval0("Testing::eval0", 3);
Kokkos::parallel_for(
"Testing::moving_least_squares::for0",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, 4),
Expand Down Expand Up @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(moving_least_squares, DeviceType,
Kokkos::View<Point1 *, MemorySpace> tgtp1("Testing::tgtp1", 4);
Kokkos::View<double *, MemorySpace> srcv1("Testing::srcv1", 9);
Kokkos::View<double *, MemorySpace> tgtv1("Testing::tgtv1", 4);
Kokkos::View<double *, MemorySpace> eval1("Testing::eval1", 0);
Kokkos::View<double *, MemorySpace> eval1("Testing::eval1", 4);
Kokkos::parallel_for(
"Testing::moving_least_squares::for1",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, 9),
Expand Down Expand Up @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(moving_least_squares_edge_cases, DeviceType,
Kokkos::View<Point0 *, MemorySpace> tgtp0("Testing::tgtp0", 3);
Kokkos::View<double *, MemorySpace> srcv0("Testing::srcv0", 4);
Kokkos::View<double *, MemorySpace> tgtv0("Testing::tgtv0", 3);
Kokkos::View<double *, MemorySpace> eval0("Testing::eval0", 0);
Kokkos::View<double *, MemorySpace> eval0("Testing::eval0", 3);
Kokkos::parallel_for(
"Testing::moving_least_squares_edge_cases::for0",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, 4),
Expand Down Expand Up @@ -137,7 +137,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(moving_least_squares_edge_cases, DeviceType,
Kokkos::View<Point1 *, MemorySpace> tgtp1("Testing::tgtp1", 4);
Kokkos::View<double *, MemorySpace> srcv1("Testing::srcv1", 9);
Kokkos::View<double *, MemorySpace> tgtv1("Testing::tgtv1", 4);
Kokkos::View<double *, MemorySpace> eval1("Testing::eval1", 0);
Kokkos::View<double *, MemorySpace> eval1("Testing::eval1", 4);
Kokkos::parallel_for(
"Testing::moving_least_squares_edge_cases::for0",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, 9),
Expand Down

0 comments on commit 27dd128

Please sign in to comment.