From 08bf58a96466fa1ee80c8048f2ba48e8cd93b809 Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Mon, 23 Sep 2024 21:26:27 +0200 Subject: [PATCH] Granularize Boost.MAth dependencies in tests --- cmake/config/dependencies.cmake | 1 - test/unit/CMakeLists.txt | 11 --------- test/unit/module/bessel/airy_ai.cpp | 10 ++++++++ test/unit/module/bessel/airy_bi.cpp | 12 +++++++++- test/unit/module/elliptic/ellint_1.cpp | 11 +++++++++ test/unit/module/elliptic/ellint_2.cpp | 10 ++++++++ test/unit/module/elliptic/ellint_d.cpp | 11 +++++++++ test/unit/module/elliptic/ellint_rc.cpp | 11 +++++++++ test/unit/module/elliptic/ellint_rd.cpp | 11 +++++++++ test/unit/module/elliptic/ellint_rf.cpp | 10 ++++++++ test/unit/module/elliptic/ellint_rg.cpp | 11 +++++++++ test/unit/module/elliptic/ellint_rj.cpp | 11 +++++++++ test/unit/module/polynomial/gegenbauer.cpp | 11 +++++++++ test/unit/module/polynomial/hermite.cpp | 23 ++++++++++++++----- test/unit/module/polynomial/jacobi.cpp | 12 +++++++++- test/unit/module/polynomial/laguerre.cpp | 18 ++++++++++++--- test/unit/module/polynomial/tchebytchev.cpp | 13 ++++++++++- test/unit/module/special/double_factorial.cpp | 10 ++++++++ test/unit/module/special/erf_inv.cpp | 11 +++++++++ test/unit/module/special/erfc_inv.cpp | 13 ++++++++++- test/unit/module/special/exp_int.cpp | 11 ++++++++- test/unit/module/special/gamma_p.cpp | 12 +++++++++- test/unit/module/special/gamma_p_inv.cpp | 12 +++++++++- test/unit/module/special/lambert.cpp | 11 +++++++++ 24 files changed, 249 insertions(+), 28 deletions(-) diff --git a/cmake/config/dependencies.cmake b/cmake/config/dependencies.cmake index 2959275a7f..90da5c82a4 100644 --- a/cmake/config/dependencies.cmake +++ b/cmake/config/dependencies.cmake @@ -10,7 +10,6 @@ find_package(Boost 1.74.0 QUIET) if(Boost_FOUND) - set(EVE_USE_BOOST 1) message( STATUS "[eve] Boost found in ${Boost_INCLUDE_DIRS} - Boost dependent tests activated") else() set(Boost_INCLUDE_DIRS "") diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 3b88eb386e..a707e94323 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -85,15 +85,10 @@ add_custom_target(unit.combinatorial.exe ) add_dependencies(unit.exe unit.combinatorial.exe ) glob_unit("unit" ${unit_root} "module/combinatorial/*.cpp" ) -if(EVE_USE_BOOST) add_custom_target(unit.bessel.exe ) add_dependencies(unit.exe unit.bessel.exe ) glob_unit("unit" ${unit_root} "module/bessel/*.cpp" ) -# add_custom_target(unit.complex.exe ) -# add_dependencies(unit.exe unit.complex.exe ) -# glob_unit("unit" ${unit_root} "module/complex/*.cpp" ) - add_custom_target(unit.elliptic.exe ) add_dependencies(unit.exe unit.elliptic.exe ) glob_unit("unit" ${unit_root} "module/elliptic/*.cpp" ) @@ -107,12 +102,6 @@ add_custom_target(unit.polynomial.exe ) add_dependencies(unit.exe unit.polynomial.exe ) glob_unit("unit" ${unit_root} "module/polynomial/*.cpp" ) -# add_custom_target(unit.quaternion.exe ) -# add_dependencies(unit.exe unit.quaternion.exe ) -# glob_unit("unit" ${unit_root} "module/quaternion/*.cpp" ) - add_custom_target(unit.special.exe ) add_dependencies(unit.exe unit.special.exe ) glob_unit("unit" ${unit_root} "module/special/*.cpp" ) - -endif() diff --git a/test/unit/module/bessel/airy_ai.cpp b/test/unit/module/bessel/airy_ai.cpp index 6012da7e6c..18aa926bef 100644 --- a/test/unit/module/bessel/airy_ai.cpp +++ b/test/unit/module/bessel/airy_ai.cpp @@ -10,8 +10,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) TTS_CASE_TPL("Check return types of airy_ai", eve::test::simd::ieee_reals) (tts::type) { @@ -87,3 +91,9 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::airy_ai)(eve::wide)", { TTS_IEEE_EQUAL(eve::airy_ai[mask](a0),eve::if_else(mask, eve::airy_ai(a0), a0)); }; +#else +TTS_CASE("Check return types of airy_ai") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif diff --git a/test/unit/module/bessel/airy_bi.cpp b/test/unit/module/bessel/airy_bi.cpp index fd93c70225..9f2652735e 100644 --- a/test/unit/module/bessel/airy_bi.cpp +++ b/test/unit/module/bessel/airy_bi.cpp @@ -6,11 +6,14 @@ **/ //================================================================================================== #include "test.hpp" - #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) TTS_CASE_TPL("Check return types of airy_bi", eve::test::simd::ieee_reals) (tts::type) { @@ -84,3 +87,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::airy_bi)(eve::wide)", { TTS_IEEE_EQUAL(eve::airy_bi[mask](a0), eve::if_else(mask, eve::airy_bi(a0), a0)); }; +#else +TTS_CASE("Check return types of airy_bi") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_1.cpp b/test/unit/module/elliptic/ellint_1.cpp index e469aecb48..426724286a 100644 --- a/test/unit/module/elliptic/ellint_1.cpp +++ b/test/unit/module/elliptic/ellint_1.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -65,3 +69,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_1)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_1[mask](a0, a1), eve::if_else(mask, eve::ellint_1(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of ellint_1") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_2.cpp b/test/unit/module/elliptic/ellint_2.cpp index b071576235..e88afd46b8 100644 --- a/test/unit/module/elliptic/ellint_2.cpp +++ b/test/unit/module/elliptic/ellint_2.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -65,3 +69,9 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_2)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_2[mask](a0, a1), eve::if_else(mask, eve::ellint_2(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of ellint_2") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif diff --git a/test/unit/module/elliptic/ellint_d.cpp b/test/unit/module/elliptic/ellint_d.cpp index b5f8b8cce0..76432fd66e 100644 --- a/test/unit/module/elliptic/ellint_d.cpp +++ b/test/unit/module/elliptic/ellint_d.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -65,3 +69,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_d)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_d[mask](a0, a1), eve::if_else(mask, eve::ellint_d(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of ellint_d") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_rc.cpp b/test/unit/module/elliptic/ellint_rc.cpp index 9bf9b9dbf1..b8dffd94dc 100644 --- a/test/unit/module/elliptic/ellint_rc.cpp +++ b/test/unit/module/elliptic/ellint_rc.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -59,3 +63,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_rc)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_rc[mask](a0, a1), eve::if_else(mask, eve::ellint_rc(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of ellint_rc") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_rd.cpp b/test/unit/module/elliptic/ellint_rd.cpp index 0ff214d9d1..cf2eacea12 100644 --- a/test/unit/module/elliptic/ellint_rd.cpp +++ b/test/unit/module/elliptic/ellint_rd.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -66,3 +70,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_rd)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_rd[mask](a0, a1, a2), eve::if_else(mask, eve::ellint_rd(a0, a1, a2), a0)); }; +#else +TTS_CASE("Check return types of ellint_rd") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_rf.cpp b/test/unit/module/elliptic/ellint_rf.cpp index dfc1aecb36..67421b0a77 100644 --- a/test/unit/module/elliptic/ellint_rf.cpp +++ b/test/unit/module/elliptic/ellint_rf.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -66,3 +70,9 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_rf)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_rf[mask](a0, a1, a2), eve::if_else(mask, eve::ellint_rf(a0, a1, a2), a0)); }; +#else +TTS_CASE("Check return types of ellint_rf") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif diff --git a/test/unit/module/elliptic/ellint_rg.cpp b/test/unit/module/elliptic/ellint_rg.cpp index dd065869a5..e588738729 100644 --- a/test/unit/module/elliptic/ellint_rg.cpp +++ b/test/unit/module/elliptic/ellint_rg.cpp @@ -11,8 +11,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -66,3 +70,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_rg)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_rg[mask](a0, a1, a2), eve::if_else(mask, eve::ellint_rg(a0, a1, a2), a0)); }; +#else +TTS_CASE("Check return types of ellint_rg") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/elliptic/ellint_rj.cpp b/test/unit/module/elliptic/ellint_rj.cpp index d15ecbeba3..b2f70bc191 100644 --- a/test/unit/module/elliptic/ellint_rj.cpp +++ b/test/unit/module/elliptic/ellint_rj.cpp @@ -13,8 +13,12 @@ #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -83,3 +87,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::ellint_rj)(eve::wide)", TTS_IEEE_EQUAL(eve::ellint_rj[mask](a0, a1, a2, a3), eve::if_else(mask, eve::ellint_rj(a0, a1, a2, a3), a0)); }; +#else +TTS_CASE("Check return types of ellint_rj") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/polynomial/gegenbauer.cpp b/test/unit/module/polynomial/gegenbauer.cpp index 45b1e96516..9a2b4cca23 100644 --- a/test/unit/module/polynomial/gegenbauer.cpp +++ b/test/unit/module/polynomial/gegenbauer.cpp @@ -9,8 +9,12 @@ #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== //== Types tests //================================================================================================== @@ -63,3 +67,10 @@ TTS_CASE_WITH("Check behavior of gegenbauer on wide", } } }; +#else +TTS_CASE("Check return types of gegenbauer") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/polynomial/hermite.cpp b/test/unit/module/polynomial/hermite.cpp index cfcee9341d..86203a1957 100644 --- a/test/unit/module/polynomial/hermite.cpp +++ b/test/unit/module/polynomial/hermite.cpp @@ -8,15 +8,19 @@ #include "test.hpp" #include -#if defined(cpp_lib_math_special_functions) -#include -#define NAMESPACE std + +#if defined(__cpp_lib_math_special_functions) +# define NAMESPACE std +# define EVE_HAS_MATH #else -#include -#define NAMESPACE boost::math +# if __has_include() +# include +# define EVE_HAS_MATH +# define NAMESPACE boost::math +# endif #endif - +#if defined(EVE_HAS_MATH) //================================================================================================== //== Types tests //================================================================================================== @@ -65,3 +69,10 @@ TTS_CASE_WITH("Check behavior of hermite on wide", } } }; +#else +TTS_CASE("Check return types of hermite") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/polynomial/jacobi.cpp b/test/unit/module/polynomial/jacobi.cpp index e0facc2eef..f9b4381a3f 100644 --- a/test/unit/module/polynomial/jacobi.cpp +++ b/test/unit/module/polynomial/jacobi.cpp @@ -9,9 +9,12 @@ #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif - +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -41,3 +44,10 @@ TTS_CASE_WITH( "Check behavior of diff jacobi on wide" auto bdt1 = [&](auto i, auto e, auto f, auto g){return boost::math::jacobi(i, e, f, g); }; TTS_ULP_EQUAL(dt, eve::detail::map(bdt1, i0, a0, a1, a2), 1000); }; +#else +TTS_CASE("Check return types of jacobi") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/polynomial/laguerre.cpp b/test/unit/module/polynomial/laguerre.cpp index 478b4edf56..f20c908bd0 100644 --- a/test/unit/module/polynomial/laguerre.cpp +++ b/test/unit/module/polynomial/laguerre.cpp @@ -10,12 +10,17 @@ #include #if defined(__cpp_lib_math_special_functions) -#define NAMESPACE std +# define NAMESPACE std +# define EVE_HAS_MATH #else -#include -#define NAMESPACE boost::math +# if __has_include() +# include +# define EVE_HAS_MATH +# define NAMESPACE boost::math +# endif #endif +#if defined(EVE_HAS_MATH) //================================================================================================== //== Types tests //================================================================================================== @@ -66,3 +71,10 @@ TTS_CASE_WITH("Check behavior of laguerre on wide", } } }; +#else +TTS_CASE("Check return types of laguerre") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/polynomial/tchebytchev.cpp b/test/unit/module/polynomial/tchebytchev.cpp index fe2690ae71..e4a34aa3a7 100644 --- a/test/unit/module/polynomial/tchebytchev.cpp +++ b/test/unit/module/polynomial/tchebytchev.cpp @@ -6,11 +6,14 @@ **/ //================================================================================================== #include "test.hpp" - #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== //== Types tests //================================================================================================== @@ -73,3 +76,11 @@ TTS_CASE_WITH("Check behavior of successor(tchebytchev)", auto u5 = eve::tchebytchev[kind_2](5, a0); TTS_ULP_EQUAL(eve::tchebytchev[eve::successor](a0, u4, u3), u5, 300); }; +#else +TTS_CASE("Check return types of tchebytchev") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + + diff --git a/test/unit/module/special/double_factorial.cpp b/test/unit/module/special/double_factorial.cpp index d8f548fd99..ba809afe60 100644 --- a/test/unit/module/special/double_factorial.cpp +++ b/test/unit/module/special/double_factorial.cpp @@ -9,8 +9,12 @@ #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -46,3 +50,9 @@ TTS_CASE_TPL("Check corner-cases behavior of eve::double_factorial on wide", TTS_ULP_EQUAL(eve::double_factorial(T(302)), eve::inf(eve::as()), 0); } }; +#else +TTS_CASE("Check return types of double_factorial") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif diff --git a/test/unit/module/special/erf_inv.cpp b/test/unit/module/special/erf_inv.cpp index d8576a1c0e..ea170d9a56 100644 --- a/test/unit/module/special/erf_inv.cpp +++ b/test/unit/module/special/erf_inv.cpp @@ -10,8 +10,12 @@ #include #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -85,3 +89,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::erf_inv)(eve::wide)", TTS_IEEE_EQUAL(eve::erf_inv[mask](a0), eve::if_else(mask, eve::erf_inv(a0), a0)); }; +#else +TTS_CASE("Check return types of erf_inv") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/special/erfc_inv.cpp b/test/unit/module/special/erfc_inv.cpp index 2b52cc618c..96cebf2e90 100644 --- a/test/unit/module/special/erfc_inv.cpp +++ b/test/unit/module/special/erfc_inv.cpp @@ -12,11 +12,15 @@ #include #include +#include #include +#if __has_include() #include -#include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -87,3 +91,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::erfc_inv)(eve::wide)", TTS_IEEE_EQUAL(eve::erfc_inv[mask](a0), eve::if_else(mask, eve::erfc_inv(a0), a0)); }; +#else +TTS_CASE("Check return types of erfc_inv") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/special/exp_int.cpp b/test/unit/module/special/exp_int.cpp index 28a2bbb8d0..35dc13e1f3 100644 --- a/test/unit/module/special/exp_int.cpp +++ b/test/unit/module/special/exp_int.cpp @@ -9,11 +9,14 @@ #include #include - #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -73,3 +76,9 @@ TTS_CASE_WITH("Check behavior of exp_int on wide", TTS_ULP_EQUAL( exp_int(elt_t(6000), elt_t(0.5)), (boost::math::expint(elt_t(6000), elt_t(0.5))), 4.0); }; +#else +TTS_CASE("Check return types of expint") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif diff --git a/test/unit/module/special/gamma_p.cpp b/test/unit/module/special/gamma_p.cpp index 866652f7e1..f0e0252269 100644 --- a/test/unit/module/special/gamma_p.cpp +++ b/test/unit/module/special/gamma_p.cpp @@ -9,11 +9,14 @@ #include #include - #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -82,3 +85,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::gamma_p)(eve::wide)", TTS_IEEE_EQUAL(eve::gamma_p[mask](a0, a1), eve::if_else(mask, eve::gamma_p(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of gamma_p") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/special/gamma_p_inv.cpp b/test/unit/module/special/gamma_p_inv.cpp index f62dcc5074..32046af40d 100644 --- a/test/unit/module/special/gamma_p_inv.cpp +++ b/test/unit/module/special/gamma_p_inv.cpp @@ -9,11 +9,14 @@ #include #include - #include +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -76,3 +79,10 @@ TTS_CASE_WITH("Check behavior of eve::masked(eve::gamma_p_inv)(eve::wide)", TTS_IEEE_EQUAL(eve::gamma_p_inv[mask](a0, a1), eve::if_else(mask, eve::gamma_p_inv(a0, a1), a0)); }; +#else +TTS_CASE("Check return types of gamma_p_inv") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif + diff --git a/test/unit/module/special/lambert.cpp b/test/unit/module/special/lambert.cpp index acf2ef034a..eda856fb65 100644 --- a/test/unit/module/special/lambert.cpp +++ b/test/unit/module/special/lambert.cpp @@ -9,8 +9,13 @@ #include #include + +#if __has_include() #include +#define EVE_HAS_BOOST +#endif +#if defined(EVE_HAS_BOOST) //================================================================================================== // Types tests //================================================================================================== @@ -160,3 +165,9 @@ TTS_CASE_WITH("Check behavior of lambert on wide", } } }; +#else +TTS_CASE("Check return types of lambert") +{ + TTS_PASS("SKipping due to no reference available"); +}; +#endif