Skip to content

Commit

Permalink
Remove SVD from Interpolation namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Nov 11, 2024
1 parent a890abb commit d398b6d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <detail/ArborX_AccessTraits.hpp>
#include <detail/ArborX_InterpDetailsCompactRadialBasisFunction.hpp>
#include <detail/ArborX_InterpDetailsPolynomialBasis.hpp>
#include <detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp>
#include <kokkos_ext/ArborX_KokkosExtAccessibilityTraits.hpp>
#include <misc/ArborX_SymmetricSVD.hpp>

#include <Kokkos_Core.hpp>
#include <Kokkos_Profiling_ScopedRegion.hpp>
Expand Down Expand Up @@ -110,7 +110,8 @@ class MovingLeastSquaresCoefficientsKernel

// We need the inverse of P^T.PHI.P, and because it is symmetric, we can use
// the symmetric SVD algorithm to get it.
symmetricPseudoInverseSVDKernel(moment, svd_diag, svd_unit);
::ArborX::Details::symmetricPseudoInverseSVDKernel(moment, svd_diag,
svd_unit);
// Now, the moment has [P^T.PHI.P]^-1

// Finally, the result is produced by computing p(0).[P^T.PHI.P]^-1.P^T.PHI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
* SPDX-License-Identifier: BSD-3-Clause *
****************************************************************************/

#ifndef ARBORX_INTERP_SYMMETRIC_PSEUDO_INVERSE_SVD_HPP
#define ARBORX_INTERP_SYMMETRIC_PSEUDO_INVERSE_SVD_HPP
#ifndef ARBORX_SYMMETRIC_SVD_HPP
#define ARBORX_SYMMETRIC_SVD_HPP

#include <kokkos_ext/ArborX_KokkosExtAccessibilityTraits.hpp>
#include <misc/ArborX_Exception.hpp>

#include <Kokkos_Core.hpp>
#include <Kokkos_Profiling_ScopedRegion.hpp>

namespace ArborX::Interpolation::Details
namespace ArborX::Details
{

template <typename Matrix>
Expand Down Expand Up @@ -246,6 +246,6 @@ KOKKOS_FUNCTION void symmetricPseudoInverseSVDKernel(Matrix &mat, Diag &diag,
}
}

} // namespace ArborX::Interpolation::Details
} // namespace ArborX::Details

#endif
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_executable(ArborX_Test_DetailsUtils.exe
tstAttachIndices.cpp
tstDetailsVector.cpp
tstDetailsUtils.cpp
tstDetailsSVD.cpp
tstDetailsGeometryReducer.cpp
utf_main.cpp
)
Expand Down Expand Up @@ -255,7 +256,6 @@ target_link_libraries(ArborX_Test_BoostAdapters.exe PRIVATE ArborX Boost::unit_t
add_test(NAME ArborX_Test_BoostAdapters COMMAND ArborX_Test_BoostAdapters.exe)

add_executable(ArborX_Test_InterpMovingLeastSquares.exe
tstInterpDetailsSVD.cpp
tstInterpDetailsCompactRadialBasisFunction.cpp
tstInterpDetailsPolyBasis.cpp
tstInterpDetailsMLSCoefficients.cpp
Expand Down
7 changes: 3 additions & 4 deletions test/tstInterpDetailsSVD.cpp → test/tstDetailsSVD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "ArborX_EnableDeviceTypes.hpp"
#include "ArborX_EnableViewComparison.hpp"
#include <detail/ArborX_InterpDetailsSymmetricPseudoInverseSVD.hpp>
#include <misc/ArborX_SymmetricSVD.hpp>

#include "BoostTest_CUDA_clang_workarounds.hpp"
#include <boost/test/unit_test.hpp>
Expand Down Expand Up @@ -45,7 +45,7 @@ void makeCase(ExecutionSpace const &exec, Value const (&src_arr)[M][N][N],
Kokkos::parallel_for(
"Testing::run_svd", Kokkos::RangePolicy<ExecutionSpace>(exec, 0, 1),
KOKKOS_LAMBDA(int) {
ArborX::Interpolation::Details::symmetricSVDKernel(inv, diag, unit);
ArborX::Details::symmetricSVDKernel(inv, diag, unit);
for (int p = 0; p < N; ++p)
for (int q = 0; q < N; ++q)
{
Expand All @@ -61,8 +61,7 @@ void makeCase(ExecutionSpace const &exec, Value const (&src_arr)[M][N][N],
Kokkos::parallel_for(
"Testing::run_inverse", Kokkos::RangePolicy<ExecutionSpace>(exec, 0, 1),
KOKKOS_LAMBDA(int) {
ArborX::Interpolation::Details::symmetricPseudoInverseSVDKernel(
inv, diag, unit);
ArborX::Details::symmetricPseudoInverseSVDKernel(inv, diag, unit);
});
ARBORX_MDVIEW_TEST_TOL(ref, inv, Kokkos::Experimental::epsilon_v<float>);
}
Expand Down

0 comments on commit d398b6d

Please sign in to comment.