Skip to content

Commit

Permalink
Remove deprecated code (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored Dec 13, 2024
1 parent ffd1ce5 commit 0f8473c
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 231 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ if("${DDC_BUILD_PDI_WRAPPER}")
)
target_link_libraries(ddc_pdi INTERFACE DDC::core PDI::PDI_C)

### PDI_Wrapper legacy target
add_library(PDI_Wrapper INTERFACE)
set_target_properties(PDI_Wrapper PROPERTIES DEPRECATION "Use DDC::pdi instead")
add_library(DDC::PDI_Wrapper ALIAS PDI_Wrapper)
install(TARGETS PDI_Wrapper EXPORT DDCTargets)
target_link_libraries(PDI_Wrapper INTERFACE DDC::pdi)

### DDC legacy target
target_link_libraries(DDC INTERFACE DDC::pdi)
endif()
Expand Down
5 changes: 0 additions & 5 deletions include/ddc/chunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ class Chunk<ElementType, DiscreteDomain<DDims...>, Allocator>

using discrete_domain_type = typename base_type::discrete_domain_type;

#if defined(DDC_BUILD_DEPRECATED_CODE)
using mdomain_type [[deprecated("Use `discrete_domain_type` instead")]] =
typename base_type::mdomain_type;
#endif

using memory_space = typename Allocator::memory_space;

using discrete_element_type = typename base_type::discrete_element_type;
Expand Down
5 changes: 0 additions & 5 deletions include/ddc/chunk_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class ChunkCommon<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy>
public:
using discrete_domain_type = DiscreteDomain<DDims...>;

#if defined(DDC_BUILD_DEPRECATED_CODE)
using mdomain_type [[deprecated("Use `discrete_domain_type` instead")]]
= DiscreteDomain<DDims...>;
#endif

/// The dereferenceable part of the co-domain but with a different domain, starting at 0
using allocation_mdspan_type = Kokkos::mdspan<
ElementType,
Expand Down
5 changes: 0 additions & 5 deletions include/ddc/chunk_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ class ChunkSpan<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy, Memo

using discrete_domain_type = typename base_type::discrete_domain_type;

#if defined(DDC_BUILD_DEPRECATED_CODE)
using mdomain_type [[deprecated("Use `discrete_domain_type` instead")]]
= DiscreteDomain<DDims...>;
#endif

using memory_space = MemorySpace;

/// The dereferenceable part of the co-domain but with a different domain, starting at 0
Expand Down
26 changes: 0 additions & 26 deletions include/ddc/discrete_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ class DiscreteDomain

using discrete_vector_type = DiscreteVector<DDims...>;

#if defined(DDC_BUILD_DEPRECATED_CODE)
using mlength_type [[deprecated("Use `discrete_vector_type` instead")]] = discrete_vector_type;
#endif

private:
DiscreteElement<DDims...> m_element_begin;

Expand Down Expand Up @@ -178,15 +174,6 @@ class DiscreteDomain
return DiscreteDomain(front() + n1, extents() - n1 - n2);
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
template <class... ODDims>
[[deprecated("Use `restrict_with` instead")]] KOKKOS_FUNCTION constexpr auto restrict(
DiscreteDomain<ODDims...> const& odomain) const
{
return restrict_with(odomain);
}
#endif

template <class... ODDims>
KOKKOS_FUNCTION constexpr auto restrict_with(DiscreteDomain<ODDims...> const& odomain) const
{
Expand Down Expand Up @@ -270,10 +257,6 @@ class DiscreteDomain<>

using discrete_vector_type = DiscreteVector<>;

#if defined(DDC_BUILD_DEPRECATED_CODE)
using mlength_type [[deprecated("Use `discrete_vector_type` instead")]] = discrete_vector_type;
#endif

static KOKKOS_FUNCTION constexpr std::size_t rank()
{
return 0;
Expand Down Expand Up @@ -372,15 +355,6 @@ class DiscreteDomain<>
return *this;
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
template <class... ODims>
[[deprecated("Use `restrict_with` instead")]] KOKKOS_FUNCTION constexpr DiscreteDomain restrict(
DiscreteDomain<ODims...> const& odomain) const
{
return restrict_with(odomain);
}
#endif

template <class... ODims>
KOKKOS_FUNCTION constexpr DiscreteDomain restrict_with(
DiscreteDomain<ODims...> const& /* odomain */) const
Expand Down
27 changes: 0 additions & 27 deletions include/ddc/kernels/fft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,33 +361,6 @@ ddc::DiscreteDomain<DDimFx...> fourier_mesh(ddc::DiscreteDomain<DDimX...> x_mesh
ddc::detail::fft::N<DDimX>(x_mesh)))))...);
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
/**
* @brief Get the Fourier mesh.
*
* Compute the Fourier (or spectral) mesh on which the Discrete Fourier Transform of a
* discrete function is defined.
*
* @deprecated Use @ref fourier_mesh instead.
*
* @param x_mesh The DiscreteDomain representing the original mesh.
* @param C2C A flag indicating if a complex-to-complex DFT is going to be performed. Indeed,
* in this case the two meshes have same number of points, whereas for real-to-complex
* or complex-to-real DFT, each complex value of the Fourier-transformed function contains twice more
* information, and thus only half (actually Nx*Ny*(Nz/2+1) for 3D R2C FFT to take in account mode 0)
* values are needed (cf. DFT conjugate symmetry property for more information about this).
*
* @return The domain representing the Fourier mesh.
*/
template <typename... DDimFx, typename... DDimX>
[[deprecated("Use `fourier_mesh` instead")]] ddc::DiscreteDomain<DDimFx...> FourierMesh(
ddc::DiscreteDomain<DDimX...> x_mesh,
bool C2C)
{
return fourier_mesh<DDimFx...>(x_mesh, C2C);
}
#endif

/**
* @brief A structure embedding the configuration of the exposed FFT function with the type of normalization.
*
Expand Down
56 changes: 0 additions & 56 deletions include/ddc/kernels/splines/bsplines_non_uniform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,6 @@ class NonUniformBSplines : detail::NonUniformBSplinesBase
ddc::Coordinate<CDim> const& x,
std::size_t n) const;

#if defined(DDC_BUILD_DEPRECATED_CODE)
/** @brief Compute the integrals of the B-splines.
*
* The integral of each of the B-splines over their support within the domain on which this basis was defined.
*
* @deprecated Use @ref integrals instead.
*
* @param[out] int_vals The values of the integrals. It has to be a 1D Chunkspan of size (nbasis).
* @return The values of the integrals.
*/
template <class Layout, class MemorySpace2>
[[deprecated("Use `integrals` instead")]] KOKKOS_INLINE_FUNCTION ddc::
ChunkSpan<double, ddc::DiscreteDomain<DDim>, Layout, MemorySpace2>
integrals(ddc::ChunkSpan<double, discrete_domain_type, Layout, MemorySpace2>
int_vals) const;
#endif

/** @brief Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spline.
*
* Each B-spline has a support defined over (degree+2) knots. For a B-spline identified by the
Expand Down Expand Up @@ -697,43 +680,4 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement<NonUniformBsplinesKnots<DDim>> NonUn
return icell;
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
template <class CDim, std::size_t D>
template <class DDim, class MemorySpace>
template <class Layout, class MemorySpace2>
KOKKOS_INLINE_FUNCTION ddc::ChunkSpan<double, ddc::DiscreteDomain<DDim>, Layout, MemorySpace2>
NonUniformBSplines<CDim, D>::Impl<DDim, MemorySpace>::integrals(
ddc::ChunkSpan<double, discrete_domain_type, Layout, MemorySpace2> int_vals) const
{
assert([&]() -> bool {
if constexpr (is_periodic()) {
return int_vals.size() == nbasis() || int_vals.size() == size();
} else {
return int_vals.size() == nbasis();
}
}());

double const inv_deg = 1.0 / (degree() + 1);

discrete_domain_type const dom_bsplines(
full_domain().take_first(discrete_vector_type {nbasis()}));
for (auto ix : dom_bsplines) {
int_vals(ix) = double(ddc::coordinate(get_last_support_knot(ix))
- ddc::coordinate(get_first_support_knot(ix)))
* inv_deg;
}

if constexpr (is_periodic()) {
if (int_vals.size() == size()) {
discrete_domain_type const dom_bsplines_wrap(
full_domain().take_last(discrete_vector_type {degree()}));
for (auto ix : dom_bsplines_wrap) {
int_vals(ix) = 0;
}
}
}
return int_vals;
}
#endif

} // namespace ddc
77 changes: 0 additions & 77 deletions include/ddc/kernels/splines/bsplines_uniform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,6 @@ class UniformBSplines : detail::UniformBSplinesBase
ddc::Coordinate<CDim> const& x,
std::size_t n) const;

#if defined(DDC_BUILD_DEPRECATED_CODE)
/** @brief Compute the integrals of the B-splines.
*
* The integral of each of the B-splines over their support within the domain on which this basis was defined.
*
* @deprecated Use @ref integrals instead.
*
* @param[out] int_vals The values of the integrals. It has to be a 1D Chunkspan of size (nbasis).
* @return The values of the integrals.
*/
template <class Layout, class MemorySpace2>
[[deprecated("Use `integrals` instead")]] KOKKOS_INLINE_FUNCTION ddc::
ChunkSpan<double, ddc::DiscreteDomain<DDim>, Layout, MemorySpace2>
integrals(ddc::ChunkSpan<double, discrete_domain_type, Layout, MemorySpace2>
int_vals) const;
#endif

/** @brief Returns the coordinate of the first support knot associated to a DiscreteElement identifying a B-spline.
*
* Each B-spline has a support defined over (degree+2) knots. For a B-spline identified by the
Expand Down Expand Up @@ -600,64 +583,4 @@ KOKKOS_INLINE_FUNCTION void UniformBSplines<CDim, D>::Impl<DDim, MemorySpace>::g
}
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
template <class CDim, std::size_t D>
template <class DDim, class MemorySpace>
template <class Layout, class MemorySpace2>
KOKKOS_INLINE_FUNCTION ddc::ChunkSpan<double, ddc::DiscreteDomain<DDim>, Layout, MemorySpace2>
UniformBSplines<CDim, D>::Impl<DDim, MemorySpace>::integrals(
ddc::ChunkSpan<double, discrete_domain_type, Layout, MemorySpace2> int_vals) const
{
assert([&]() -> bool {
if constexpr (is_periodic()) {
return int_vals.size() == nbasis() || int_vals.size() == size();
} else {
return int_vals.size() == nbasis();
}
}());

discrete_domain_type const full_dom_splines(full_domain());

if constexpr (is_periodic()) {
discrete_domain_type const dom_bsplines(
full_dom_splines.take_first(discrete_vector_type {nbasis()}));
for (auto ix : dom_bsplines) {
int_vals(ix) = ddc::step<knot_discrete_dimension_type>();
}
if (int_vals.size() == size()) {
discrete_domain_type const dom_bsplines_repeated(
full_dom_splines.take_last(discrete_vector_type {degree()}));
for (auto ix : dom_bsplines_repeated) {
int_vals(ix) = 0;
}
}
} else {
discrete_domain_type const dom_bspline_entirely_in_domain
= full_dom_splines
.remove(discrete_vector_type(degree()), discrete_vector_type(degree()));
for (auto ix : dom_bspline_entirely_in_domain) {
int_vals(ix) = ddc::step<knot_discrete_dimension_type>();
}

std::array<double, degree() + 2> edge_vals_ptr;
Kokkos::mdspan<double, Kokkos::extents<std::size_t, degree() + 2>> const edge_vals(
edge_vals_ptr.data());

eval_basis(edge_vals, rmin(), degree() + 1);

double const d_eval = ddc::detail::sum(edge_vals);

for (std::size_t i = 0; i < degree(); ++i) {
double const c_eval = ddc::detail::sum(edge_vals, 0, degree() - i);

double const edge_value = ddc::step<knot_discrete_dimension_type>() * (d_eval - c_eval);

int_vals(discrete_element_type(i)) = edge_value;
int_vals(discrete_element_type(nbasis() - 1 - i)) = edge_value;
}
}
return int_vals;
}
#endif

} // namespace ddc
23 changes: 0 additions & 23 deletions include/ddc/kernels/splines/spline_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,29 +360,6 @@ class SplineBuilder
ddc::DiscreteVector<deriv_type>(s_nbc_xmax)));
}

#if defined(DDC_BUILD_DEPRECATED_CODE)
/**
* @brief Get the interpolation matrix.
*
* This can be useful for debugging (as it allows
* one to print the matrix) or for more complex quadrature schemes.
*
* @deprecated Use @ref quadrature_coefficients instead.
*
* @warning the returned detail::Matrix class is not supposed to be exposed
* to user, which means its usage is not supported out of the scope of current class.
* Use at your own risk.
*
* @return A reference to the interpolation matrix.
*/
[[deprecated("Use quadrature_coefficients() instead.")]] const ddc::detail::
SplinesLinearProblem<exec_space>&
get_interpolation_matrix() const noexcept
{
return *matrix;
}
#endif

/**
* @brief Compute a spline approximation of a function.
*
Expand Down

0 comments on commit 0f8473c

Please sign in to comment.