Skip to content

Commit

Permalink
#1144 - More common_compatible suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed May 12, 2024
1 parent b3062ea commit bf58ce7
Show file tree
Hide file tree
Showing 43 changed files with 194 additions and 117 deletions.
1 change: 1 addition & 0 deletions include/eve/module/core/regular/impl/agm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <eve/module/core/regular/sign.hpp>
#include <eve/module/core/regular/sqrt.hpp>
#include <eve/traits/common_value.hpp>
#include <eve/traits/underlying_type.hpp>

namespace eve::detail
{
Expand Down
6 changes: 3 additions & 3 deletions include/eve/module/core/regular/impl/sqr_abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

namespace eve::detail
{
template<floating_real_value T>
template<value T>
EVE_FORCEINLINE constexpr auto
sqr_abs_(EVE_SUPPORTS(cpu_), T const& a) noexcept
{
return sqr(a);
return sqr(eve::abs(a));
}

template<floating_real_value T>
EVE_FORCEINLINE constexpr auto
sqr_abs_(EVE_SUPPORTS(cpu_), pedantic_type const&, T const& a) noexcept
{
return sqr(a);
return sqr(eve::abs(a));
}

// -----------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace eve
//! T ellint_1(T k) noexcept; //1
//!
//! template< eve::floating_real_value T, eve::floating_real_value U >
//! eve::common_compatible_value<T, U> ellint_1(T phi, U k) noexcept; //2
//! eve::common_value_t<T, U> ellint_1(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace eve
//! T ellint_2(T k) noexcept; //1
//!
//! template< eve::floating_real_value T, eve::floating_real_value U >
//! eve::common_compatible_value<T, U> ellint_2(T phi, U k) noexcept; //2
//! eve::common_value_t<T, U> ellint_2(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace eve
//! T ellint_d(T k) noexcept; //1
//!
//! template< eve::floating_real_value T, eve::floating_real_value U >
//! eve::common_compatible_value<T, U> ellint_d(T phi, U k) noexcept; //2
//! eve::common_value_t<T, U> ellint_d(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_rc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace eve
//! namespace eve
//! {
//! template< eve::floating_real_value T, eve::floating_real_value U >
//! eve::common_compatible_value<T, U> ellint_rc(T x, U y) noexcept;
//! eve::common_value_t<T, U> ellint_rc(T x, U y) noexcept;
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_rd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace eve
//! template< eve::floating_real_value T
//! , eve::floating_real_value U
//! , eve::floating_real_value V >
//! eve::common_compatible_value<T, U, V> ellint_rc(T x, U y, V z) noexcept;
//! eve::common_value_t<T, U, V> ellint_rc(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_rf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace eve
//! template< eve::floating_real_value T
//! , eve::floating_real_value U
//! , eve::floating_real_value V >
//! eve::common_compatible_value<T, U, V> ellint_rf(T x, U y, V z) noexcept;
//! eve::common_value_t<T, U, V> ellint_rf(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_rg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace eve
//! template< eve::floating_real_value T
//! , eve::floating_real_value U
//! , eve::floating_real_value V >
//! eve::common_compatible_value<T, U, V> ellint_rg(T x, U y, V z) noexcept;
//! eve::common_value_t<T, U, V> ellint_rg(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/elliptic/regular/ellint_rj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace eve
//! , eve::floating_real_value U
//! , eve::floating_real_value V
//! , eve::floating_real_value W>
//! eve::common_compatible_value<T, U, V, W> ellint_rj(T x, U y, V z, W p) noexcept;
//! eve::common_value_t<T, U, V, W> ellint_rj(T x, U y, V z, W p) noexcept;
//! }
//! @endcode
//!
Expand Down
20 changes: 12 additions & 8 deletions include/eve/module/elliptic/regular/impl/ellint_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <eve/module/core.hpp>
#include <eve/module/elliptic/regular/ellint_rf.hpp>
#include <eve/module/math.hpp>
#include <eve/traits/common_value.hpp>

namespace eve::detail
{
Expand Down Expand Up @@ -39,8 +40,9 @@ ellint_1_(EVE_SUPPORTS(cpu_), T x) noexcept
}

template<floating_real_value T, floating_real_value U>
EVE_FORCEINLINE common_compatible_t<T, U>
ellint_1_(EVE_SUPPORTS(cpu_), T phi, U x) noexcept requires compatible_values<T, U>
EVE_FORCEINLINE auto
ellint_1_(EVE_SUPPORTS(cpu_), T phi, U x) noexcept
-> common_value_t<T, U>
{
return arithmetic_call(ellint_1, phi, x);
}
Expand Down Expand Up @@ -86,17 +88,19 @@ ellint_1_(EVE_SUPPORTS(cpu_), T phi0, T x) noexcept requires has_native_abi_v<T>

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
template<conditional_expr C, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_1_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
ellint_1_(EVE_SUPPORTS(cpu_), C const& cond, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_1(t0, ts...), t0) )
{
return mask_op(cond, eve::ellint_1, ts ...);
return mask_op(cond, eve::ellint_1, t0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
template<conditional_expr C, decorator D, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
ellint_1_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_1(t0, ts...), t0) )
{
return mask_op(cond, d(eve::ellint_1), ts ...);
return mask_op(cond, d(eve::ellint_1), t0, ts ...);
}
}
18 changes: 11 additions & 7 deletions include/eve/module/elliptic/regular/impl/ellint_rc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#include <eve/detail/hz_device.hpp>
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>
#include <eve/traits/common_value.hpp>

namespace eve::detail
{
template<floating_real_value T, floating_real_value U>
EVE_FORCEINLINE auto
ellint_rc_(EVE_SUPPORTS(cpu_), T x, U y) noexcept requires compatible_values<T, U>
ellint_rc_(EVE_SUPPORTS(cpu_), T x, U y) noexcept
-> common_value_t<T, U>
{
return arithmetic_call(ellint_rc, x, y);
}
Expand Down Expand Up @@ -70,17 +72,19 @@ ellint_rc_(EVE_SUPPORTS(cpu_), T x, T y) noexcept requires has_native_abi_v<T>

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
template<conditional_expr C, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rc_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
ellint_rc_(EVE_SUPPORTS(cpu_), C const& cond, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rc(t0, ts...), t0) )
{
return mask_op(cond, eve::ellint_rc, ts ...);
return mask_op(cond, eve::ellint_rc, t0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
template<conditional_expr C, decorator D, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rc_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
ellint_rc_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rc(t0, ts...), t0) )
{
return mask_op(cond, d(eve::ellint_rc), ts ...);
return mask_op(cond, d(eve::ellint_rc), t0, ts ...);
}
}
23 changes: 13 additions & 10 deletions include/eve/module/elliptic/regular/impl/ellint_rd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <eve/detail/hz_device.hpp>
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>
#include <eve/traits/common_value.hpp>

namespace eve::detail
{
Expand All @@ -18,16 +19,16 @@ EVE_FORCEINLINE auto
ellint_rd_(EVE_SUPPORTS(cpu_),
T x,
U y,
V z) noexcept requires compatible_values<T, U> && compatible_values<V, U>
V z) noexcept
-> common_value_t<T, U, V>
{
return arithmetic_call(ellint_rd, x, y, z);
}

template<floating_real_value T, floating_real_value U, floating_real_value V>
EVE_FORCEINLINE auto
ellint_rd_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept requires
compatible_values<T, U> && compatible_values<V, U>
{
ellint_rd_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept
-> common_value_t<T, U, V>{
return arithmetic_call(raw(ellint_rd), x, y, z);
}

Expand Down Expand Up @@ -112,17 +113,19 @@ ellint_rd_(EVE_SUPPORTS(cpu_), T x, T y, T z) noexcept requires has_native_abi_v

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
template<conditional_expr C, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rd_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
ellint_rd_(EVE_SUPPORTS(cpu_), C const& cond, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rd(t0, ts...), t0) )
{
return mask_op(cond, eve::ellint_rd, ts ...);
return mask_op(cond, eve::ellint_rd, t0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
template<conditional_expr C, decorator D, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rd_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
ellint_rd_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rd(t0, ts...), t0) )
{
return mask_op(cond, d(eve::ellint_rd), ts ...);
return mask_op(cond, d(eve::ellint_rd), t0, ts ...);
}
}
22 changes: 13 additions & 9 deletions include/eve/module/elliptic/regular/impl/ellint_rf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <eve/detail/hz_device.hpp>
#include <eve/module/core.hpp>
#include <eve/module/math.hpp>
#include <eve/traits/common_value.hpp>

namespace eve::detail
{
Expand All @@ -18,15 +19,16 @@ EVE_FORCEINLINE auto
ellint_rf_(EVE_SUPPORTS(cpu_),
T x,
U y,
V z) noexcept requires compatible_values<T, U> && compatible_values<V, U>
V z) noexcept
-> common_value_t<T, U, V>
{
return arithmetic_call(ellint_rf, x, y, z);
}

template<floating_real_value T, floating_real_value U, floating_real_value V>
EVE_FORCEINLINE auto
ellint_rf_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept requires
compatible_values<T, U> && compatible_values<V, U>
ellint_rf_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept
-> common_value_t<T, U, V>
{
return arithmetic_call(raw(ellint_rf), x, y, z);
}
Expand Down Expand Up @@ -100,17 +102,19 @@ ellint_rf_(EVE_SUPPORTS(cpu_), T x, T y, T z) noexcept requires has_native_abi_v

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
template<conditional_expr C, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rf_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
ellint_rf_(EVE_SUPPORTS(cpu_), C const& cond, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rf(t0, ts...), t0) )
{
return mask_op(cond, eve::ellint_rf, ts ...);
return mask_op(cond, eve::ellint_rf, t0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
template<conditional_expr C, decorator D, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rf_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
ellint_rf_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rf(t0, ts...), t0) )
{
return mask_op(cond, d(eve::ellint_rf), ts ...);
return mask_op(cond, d(eve::ellint_rf), t0, ts ...);
}
}
22 changes: 13 additions & 9 deletions include/eve/module/elliptic/regular/impl/ellint_rg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <eve/module/elliptic/regular/ellint_rd.hpp>
#include <eve/module/elliptic/regular/ellint_rf.hpp>
#include <eve/module/math.hpp>
#include <eve/traits/common_value.hpp>

namespace eve::detail
{
Expand All @@ -20,15 +21,16 @@ EVE_FORCEINLINE auto
ellint_rg_(EVE_SUPPORTS(cpu_),
T x,
U y,
V z) noexcept requires compatible_values<T, U> && compatible_values<V, U>
V z) noexcept
-> common_value_t<T, U, V>
{
return arithmetic_call(ellint_rg, x, y, z);
}

template<floating_real_value T, floating_real_value U, floating_real_value V>
EVE_FORCEINLINE auto
ellint_rg_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept requires
compatible_values<T, U> && compatible_values<V, U>
ellint_rg_(EVE_SUPPORTS(cpu_), raw_type const&, T x, U y, V z) noexcept
-> common_value_t<T, U, V>
{
return arithmetic_call(raw(ellint_rg), x, y, z);
}
Expand Down Expand Up @@ -66,17 +68,19 @@ ellint_rg_(EVE_SUPPORTS(cpu_), T x, T y, T z) noexcept requires has_native_abi_v

// -----------------------------------------------------------------------------------------------
// Masked cases
template<conditional_expr C, typename ... Ts>
template<conditional_expr C, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rg_(EVE_SUPPORTS(cpu_), C const& cond, Ts ... ts) noexcept
ellint_rg_(EVE_SUPPORTS(cpu_), C const& cond, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rg(t0, ts...), t0) )
{
return mask_op(cond, eve::ellint_rg, ts ...);
return mask_op(cond, eve::ellint_rg, t0, ts ...);
}

template<conditional_expr C, decorator D, typename ... Ts>
template<conditional_expr C, decorator D, typename T0, typename ... Ts>
EVE_FORCEINLINE auto
ellint_rg_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, Ts ... ts) noexcept
ellint_rg_(EVE_SUPPORTS(cpu_), C const& cond, D const & d, T0 t0, Ts ... ts) noexcept
-> decltype( if_else(cond, ellint_rg(t0, ts...), t0) )
{
return mask_op(cond, d(eve::ellint_rg), ts ...);
return mask_op(cond, d(eve::ellint_rg), t0, ts ...);
}
}
Loading

0 comments on commit bf58ce7

Please sign in to comment.