Skip to content

Commit

Permalink
asserts to prevent overlapping allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
blegouix committed Jun 26, 2024
1 parent 406228f commit c56c130
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class SplinesLinearProblem3x3Blocks : public SplinesLinearProblem2x2Blocks<ExecS
{
std::size_t const nq = m_top_left_block->size(); // size of the center block

// prevent Kokkos::deep_copy(b_top_dst, b_top) to be a deep_copy between overlapping allocations
assert(nq >= m_top_size);

MultiRHS const b_top = Kokkos::
subview(b, std::pair<std::size_t, std::size_t> {0, m_top_size}, Kokkos::ALL);
MultiRHS const b_center = Kokkos::
Expand Down Expand Up @@ -138,6 +141,9 @@ class SplinesLinearProblem3x3Blocks : public SplinesLinearProblem2x2Blocks<ExecS
{
std::size_t const nq = m_top_left_block->size(); // size of the center block

// prevent Kokkos::deep_copy(b_top, b_top_src) to be a deep_copy between overlapping allocations
assert(nq >= m_top_size);

MultiRHS const b_center_src
= Kokkos::subview(b, std::pair<std::size_t, std::size_t> {0, nq}, Kokkos::ALL);
MultiRHS const b_top_src = Kokkos::
Expand Down

0 comments on commit c56c130

Please sign in to comment.