Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masked #1384

Merged
merged 15 commits into from
Aug 18, 2022
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/airy_ai.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,20 @@ airy_ai_(EVE_SUPPORTS(cpu_), T x) noexcept
else return apply_over(airy_ai, x);
}
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
airy_ai_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::airy_ai, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
airy_ai_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::airy_ai), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/airy_bi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,20 @@ airy_bi_(EVE_SUPPORTS(cpu_), T x) noexcept
else return apply_over(airy_bi, x);
}
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
airy_bi_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::airy_bi, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
airy_bi_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::airy_bi), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_i0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,20 @@ cyl_bessel_i0_(EVE_SUPPORTS(cpu_), T x) noexcept
}
else return apply_over(cyl_bessel_i0, x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_i0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_i0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_i0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_i0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_i1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,20 @@ cyl_bessel_i1_(EVE_SUPPORTS(cpu_), T x) noexcept
}
else return apply_over(cyl_bessel_i1, x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_i1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_i1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_i1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_i1), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_j0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,20 @@ cyl_bessel_j0_(EVE_SUPPORTS(cpu_), T a0) noexcept
}
else return apply_over(cyl_bessel_j0, a0);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_j0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_j0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_j0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_j0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_j1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,20 @@ cyl_bessel_j1_(EVE_SUPPORTS(cpu_), T x) noexcept
}
else return apply_over(eve::cyl_bessel_j1, x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_j1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_j1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_j1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_j1), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_k0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,20 @@ cyl_bessel_k0_(EVE_SUPPORTS(cpu_), T x) noexcept
}
else return apply_over(cyl_bessel_k0, x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_k0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_k0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_k0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_k0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_k1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,20 @@ cyl_bessel_k1_(EVE_SUPPORTS(cpu_), T x) noexcept
}
else return apply_over(cyl_bessel_k1, x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_k1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_k1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_k1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_k1), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_y0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,20 @@ cyl_bessel_y0_(EVE_SUPPORTS(cpu_), T x) noexcept
else return apply_over(cyl_bessel_y0, x);
}
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_y0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_y0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_y0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_y0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/cyl_bessel_y1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,20 @@ cyl_bessel_y1_(EVE_SUPPORTS(cpu_), T x) noexcept
else return apply_over(cyl_bessel_y1, x);
}
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_y1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::cyl_bessel_y1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
cyl_bessel_y1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::cyl_bessel_y1), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/sph_bessel_j0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@ sph_bessel_j0_(EVE_SUPPORTS(cpu_), T x) noexcept
{
return sinc(x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_j0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::sph_bessel_j0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_j0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::sph_bessel_j0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/sph_bessel_j1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@ sph_bessel_j1_(EVE_SUPPORTS(cpu_), T x) noexcept
{
return if_else((abs(x) <= eps(as(x))) || (x == inf(as(x))), zero, (sinc(x) - cos(x)) / x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_j1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::sph_bessel_j1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_j1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::sph_bessel_j1), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/sph_bessel_y0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@ sph_bessel_y0_(EVE_SUPPORTS(cpu_), T x) noexcept
{
return if_else(x == inf(as(x)), zero, -cos(x) / x);
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_y0_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::sph_bessel_y0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_y0_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::sph_bessel_y0), ts ...);
}
}
16 changes: 16 additions & 0 deletions include/eve/module/bessel/regular/impl/sph_bessel_y1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@ sph_bessel_y1_(EVE_SUPPORTS(cpu_), T x) noexcept
{
return if_else(x == inf(as(x)), zero, -cos(x) / sqr(x) - sinc(x));
}

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_y1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
{
return mask_op(cond, eve::sph_bessel_y1, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
EVE_FORCEINLINE auto
sph_bessel_y1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
{
return mask_op(cond, d(eve::sph_bessel_y1), ts ...);
}
}
3 changes: 2 additions & 1 deletion include/eve/module/core/regular/binarize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ namespace eve
//! @godbolt{doc/core/regular/binarize.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(binarize_, binarize);

jfalcou marked this conversation as resolved.
Show resolved Hide resolved
EVE_MAKE_CALLABLE(binarize_, binarize);
}

#include <eve/module/core/regular/impl/binarize.hpp>
8 changes: 8 additions & 0 deletions include/eve/module/core/regular/binarize_not.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ namespace eve
//! @godbolt{doc/core/regular/binarize_not.cpp}
//! @}
//================================================================================================

namespace tag
{
struct binarize_not_;
}
template<> struct supports_conditional<tag::binarize_not_> : std::false_type
{};

EVE_MAKE_CALLABLE(binarize_not_, binarize_not);
}

Expand Down
13 changes: 12 additions & 1 deletion include/eve/module/core/regular/bit_shr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@ namespace detail
{
template<typename T, typename S>
EVE_FORCEINLINE void
check(EVE_MATCH_CALL(eve::tag::bit_shr_), T const&, [[maybe_unused]] S const& s)
check(EVE_MATCH_CALL(eve::tag::bit_shr_), T const&,
[[maybe_unused]] S const& s)
{
EVE_ASSERT(assert_good_shift<T>(s),
"[eve::bit_shr] Shifting by " << s << " is out of the range [0, "
<< sizeof(element_type_t<T>) * 8 << "[.");
}

template<conditional_expr C, typename T, typename S>
EVE_FORCEINLINE void
check(EVE_MATCH_CALL(eve::tag::bit_shr_), C const& , T const&,
[[maybe_unused]] S const& s)
{
EVE_ASSERT(assert_good_shift<T>(s),
"[eve::bit_shr] Shifting by " << s << " is out of the range [0, "
Expand Down
9 changes: 9 additions & 0 deletions include/eve/module/core/regular/clamp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ namespace detail
{
EVE_ASSERT(eve::all(lo <= hi), "[eve::clamp] Unordered clamp boundaries");
}
template<conditional_expr C, typename X, typename L, typename H>
EVE_FORCEINLINE void check(EVE_MATCH_CALL(eve::tag::clamp_),
X const&,
C const&,
[[maybe_unused]] L const& lo,
[[maybe_unused]] H const& hi)
{
EVE_ASSERT(eve::all(lo <= hi), "[eve::clamp] Unordered clamp boundaries");
}
}
EVE_MAKE_CALLABLE(clamp_, clamp);

Expand Down
17 changes: 16 additions & 1 deletion include/eve/module/core/regular/fracscale.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ namespace tag
namespace detail
{
template<typename T>
EVE_FORCEINLINE void check(EVE_MATCH_CALL(eve::tag::fracscale_), T const&, [[maybe_unused]] int s)
EVE_FORCEINLINE void check(EVE_MATCH_CALL(eve::tag::fracscale_), T const&,
[[maybe_unused]] int s)
{
EVE_ASSERT(s >= 0 && s < 16, "[eve::fracscale] - parameter s out of range [0, 15]: " << s);
}
Expand All @@ -91,6 +92,20 @@ namespace detail
EVE_ASSERT(S >= 0 && S < 16,
"[eve::fracscale] - integral constant out of range [0, 15]: " << S);
}

template<conditional_expr C, typename T>
EVE_FORCEINLINE void check(EVE_MATCH_CALL(eve::tag::fracscale_),
C const&, T const&, [[maybe_unused]] int s)
{
EVE_ASSERT(s >= 0 && s < 16, "[eve::fracscale] - parameter s out of range [0, 15]: " << s);
}
template<conditional_expr C, int S, typename T>
EVE_FORCEINLINE void check(EVE_MATCH_CALL(eve::tag::fracscale_),
C const&, T const&, std::integral_constant<int, S> const&)
{
EVE_ASSERT(S >= 0 && S < 16,
"[eve::fracscale] - integral constant out of range [0, 15]: " << S);
}
}

EVE_MAKE_CALLABLE(fracscale_, fracscale);
Expand Down
Loading