Skip to content

Commit

Permalink
Granularize Boost.MAth dependencies in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou authored Sep 23, 2024
1 parent e30a7d4 commit 08bf58a
Show file tree
Hide file tree
Showing 24 changed files with 249 additions and 28 deletions.
1 change: 0 additions & 1 deletion cmake/config/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
11 changes: 0 additions & 11 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand All @@ -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()
10 changes: 10 additions & 0 deletions test/unit/module/bessel/airy_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
#include <eve/module/bessel.hpp>
#include <eve/module/core.hpp>

#if __has_include(<boost/math/special_functions/airy.hpp>)
#include <boost/math/special_functions/airy.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
TTS_CASE_TPL("Check return types of airy_ai", eve::test::simd::ieee_reals)
<typename T>(tts::type<T>)
{
Expand Down Expand Up @@ -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
12 changes: 11 additions & 1 deletion test/unit/module/bessel/airy_bi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
**/
//==================================================================================================
#include "test.hpp"

#include <eve/module/bessel.hpp>

#if __has_include(<boost/math/special_functions/airy.hpp>)
#include <boost/math/special_functions/airy.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
TTS_CASE_TPL("Check return types of airy_bi", eve::test::simd::ieee_reals)
<typename T>(tts::type<T>)
{
Expand Down Expand Up @@ -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

11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_1.hpp>)
#include <boost/math/special_functions/ellint_1.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

10 changes: 10 additions & 0 deletions test/unit/module/elliptic/ellint_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_2.hpp>)
#include <boost/math/special_functions/ellint_2.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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
11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_d.hpp>)
#include <boost/math/special_functions/ellint_d.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_rc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_rc.hpp>)
#include <boost/math/special_functions/ellint_rc.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_rd.hpp>)
#include <boost/math/special_functions/ellint_rd.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

10 changes: 10 additions & 0 deletions test/unit/module/elliptic/ellint_rf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_rf.hpp>)
#include <boost/math/special_functions/ellint_rf.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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
11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_rg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#include <eve/module/elliptic.hpp>
#include <eve/module/math.hpp>

#if __has_include(<boost/math/special_functions/ellint_rg.hpp>)
#include <boost/math/special_functions/ellint_rg.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

11 changes: 11 additions & 0 deletions test/unit/module/elliptic/ellint_rj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@

#include <cmath>

#if __has_include(<boost/math/special_functions/ellint_rj.hpp>)
#include <boost/math/special_functions/ellint_rj.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

11 changes: 11 additions & 0 deletions test/unit/module/polynomial/gegenbauer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@

#include <eve/module/polynomial.hpp>

#if __has_include(<boost/math/special_functions/gegenbauer.hpp>)
#include <boost/math/special_functions/gegenbauer.hpp>
#define EVE_HAS_BOOST
#endif

#if defined(EVE_HAS_BOOST)
//==================================================================================================
//== Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

23 changes: 17 additions & 6 deletions test/unit/module/polynomial/hermite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
#include "test.hpp"

#include <eve/module/polynomial.hpp>
#if defined(cpp_lib_math_special_functions)
#include <cmath>
#define NAMESPACE std

#if defined(__cpp_lib_math_special_functions)
# define NAMESPACE std
# define EVE_HAS_MATH
#else
#include <boost/math/special_functions/hermite.hpp>
#define NAMESPACE boost::math
# if __has_include(<boost/math/special_functions/hermite.hpp>)
# include <boost/math/special_functions/hermite.hpp>
# define EVE_HAS_MATH
# define NAMESPACE boost::math
# endif
#endif


#if defined(EVE_HAS_MATH)
//==================================================================================================
//== Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

12 changes: 11 additions & 1 deletion test/unit/module/polynomial/jacobi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

#include <eve/module/polynomial.hpp>

#if __has_include(<boost/math/special_functions/jacobi.hpp>)
#include <boost/math/special_functions/jacobi.hpp>
#define EVE_HAS_BOOST
#endif


#if defined(EVE_HAS_BOOST)
//==================================================================================================
// Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

18 changes: 15 additions & 3 deletions test/unit/module/polynomial/laguerre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
#include <eve/module/polynomial.hpp>

#if defined(__cpp_lib_math_special_functions)
#define NAMESPACE std
# define NAMESPACE std
# define EVE_HAS_MATH
#else
#include <boost/math/special_functions/laguerre.hpp>
#define NAMESPACE boost::math
# if __has_include(<boost/math/special_functions/laguerre.hpp>)
# include <boost/math/special_functions/laguerre.hpp>
# define EVE_HAS_MATH
# define NAMESPACE boost::math
# endif
#endif

#if defined(EVE_HAS_MATH)
//==================================================================================================
//== Types tests
//==================================================================================================
Expand Down Expand Up @@ -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

Loading

0 comments on commit 08bf58a

Please sign in to comment.