@@ -450,22 +450,22 @@ template <class DDim, class MemorySpace>
450450KOKKOS_INLINE_FUNCTION ddc::DiscreteElement<DDim> NonUniformBSplines<CDim, D>::
451451 Impl<DDim, MemorySpace>::eval_basis(DSpan1D values, ddc::Coordinate<CDim> const & x) const
452452{
453- assert ( values.size () == D + 1 );
453+ KOKKOS_ASSERT (( values.size () == D + 1 ))
454454
455455 std::array<double , degree ()> left;
456456 std::array<double , degree ()> right;
457457
458- assert ( x - rmin () >= -length () * 1e-14 );
459- assert ( rmax () - x >= -length () * 1e-14 );
460- assert ( values.size () == degree () + 1 );
458+ KOKKOS_ASSERT (( x - rmin () >= -length () * 1e-14 ))
459+ KOKKOS_ASSERT (( rmax () - x >= -length () * 1e-14 ))
460+ KOKKOS_ASSERT (( values.size () == degree () + 1 ))
461461
462462 // 1. Compute cell index 'icell'
463463 ddc::DiscreteElement<knot_discrete_dimension_type> const icell = find_cell_start (x);
464464
465- assert ( icell >= m_break_point_domain.front ());
466- assert ( icell <= m_break_point_domain.back ());
467- assert ( ddc::coordinate (icell) - x <= length () * 1e-14 );
468- assert ( x - ddc::coordinate (icell + 1 ) <= length () * 1e-14 );
465+ KOKKOS_ASSERT (( icell >= m_break_point_domain.front ()))
466+ KOKKOS_ASSERT (( icell <= m_break_point_domain.back ()))
467+ KOKKOS_ASSERT (( ddc::coordinate (icell) - x <= length () * 1e-14 ))
468+ KOKKOS_ASSERT (( x - ddc::coordinate (icell + 1 ) <= length () * 1e-14 ))
469469
470470 // 2. Compute values of B-splines with support over cell 'icell'
471471 double temp;
@@ -493,17 +493,17 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement<DDim> NonUniformBSplines<CDim, D>::
493493 std::array<double , degree ()> left;
494494 std::array<double , degree ()> right;
495495
496- assert ( x - rmin () >= -length () * 1e-14 );
497- assert ( rmax () - x >= -length () * 1e-14 );
498- assert ( derivs.size () == degree () + 1 );
496+ KOKKOS_ASSERT (( x - rmin () >= -length () * 1e-14 ))
497+ KOKKOS_ASSERT (( rmax () - x >= -length () * 1e-14 ))
498+ KOKKOS_ASSERT (( derivs.size () == degree () + 1 ))
499499
500500 // 1. Compute cell index 'icell'
501501 ddc::DiscreteElement<knot_discrete_dimension_type> const icell = find_cell_start (x);
502502
503- assert ( icell >= m_break_point_domain.front ());
504- assert ( icell <= m_break_point_domain.back ());
505- assert ( ddc::coordinate (icell) <= x);
506- assert ( ddc::coordinate (icell + 1 ) >= x);
503+ KOKKOS_ASSERT (( icell >= m_break_point_domain.front ()))
504+ KOKKOS_ASSERT (( icell <= m_break_point_domain.back ()))
505+ KOKKOS_ASSERT (( ddc::coordinate (icell) <= x))
506+ KOKKOS_ASSERT (( ddc::coordinate (icell + 1 ) >= x))
507507
508508 // 2. Compute values of derivatives of B-splines with support over cell 'icell'
509509
@@ -563,20 +563,20 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement<DDim> NonUniformBSplines<CDim, D>::
563563 Kokkos::mdspan<double , Kokkos::extents<std::size_t , degree () + 1 , degree () + 1 >> const ndu (
564564 ndu_ptr.data ());
565565
566- assert ( x - rmin () >= -length () * 1e-14 );
567- assert ( rmax () - x >= -length () * 1e-14 );
568- // assert( n >= 0); as long as n is unsigned
569- assert ( n <= degree ());
570- assert ( derivs.extent (0 ) == 1 + degree ());
571- assert ( derivs.extent (1 ) == 1 + n);
566+ KOKKOS_ASSERT (( x - rmin () >= -length () * 1e-14 ))
567+ KOKKOS_ASSERT (( rmax () - x >= -length () * 1e-14 ))
568+ // KOKKOS_ASSERT(( n >= 0)) as long as n is unsigned
569+ KOKKOS_ASSERT (( n <= degree ()))
570+ KOKKOS_ASSERT (( derivs.extent (0 ) == 1 + degree ()))
571+ KOKKOS_ASSERT (( derivs.extent (1 ) == 1 + n))
572572
573573 // 1. Compute cell index 'icell' and x_offset
574574 ddc::DiscreteElement<knot_discrete_dimension_type> const icell = find_cell_start (x);
575575
576- assert ( icell >= m_break_point_domain.front ());
577- assert ( icell <= m_break_point_domain.back ());
578- assert ( ddc::coordinate (icell) <= x);
579- assert ( ddc::coordinate (icell + 1 ) >= x);
576+ KOKKOS_ASSERT (( icell >= m_break_point_domain.front ()))
577+ KOKKOS_ASSERT (( icell <= m_break_point_domain.back ()))
578+ KOKKOS_ASSERT (( ddc::coordinate (icell) <= x))
579+ KOKKOS_ASSERT (( ddc::coordinate (icell + 1 ) >= x))
580580
581581 // 2. Compute nonzero basis functions and knot differences for splines
582582 // up to degree (degree-1) which are needed to compute derivative
@@ -658,8 +658,8 @@ KOKKOS_INLINE_FUNCTION ddc::DiscreteElement<NonUniformBsplinesKnots<DDim>> NonUn
658658 CDim,
659659 D>::Impl<DDim, MemorySpace>::find_cell_start(ddc::Coordinate<CDim> const & x) const
660660{
661- assert ( x - rmin () >= -length () * 1e-14 );
662- assert ( rmax () - x >= -length () * 1e-14 );
661+ KOKKOS_ASSERT (( x - rmin () >= -length () * 1e-14 ))
662+ KOKKOS_ASSERT (( rmax () - x >= -length () * 1e-14 ))
663663
664664 if (x <= rmin ()) {
665665 return m_break_point_domain.front ();
0 commit comments