Skip to content

Commit

Permalink
Add SYCL bessel y testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Aug 16, 2024
1 parent 6a32667 commit 40c39ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/sycl_jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ run test_beta_simple.cpp ;
run test_bessel_i.cpp ;
run test_bessel_j.cpp ;
run test_bessel_k.cpp ;
run test_bessel_y.cpp ;
run test_cbrt.cpp ;
run test_sign.cpp ;
run test_round.cpp ;
Expand Down
9 changes: 9 additions & 0 deletions test/test_bessel_y.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef SYCL_LANGUAGE_VERSION
#include <pch_light.hpp>
#else
#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false
#include <boost/math/tools/config.hpp>
#endif

#include "test_bessel_y.hpp"

Expand Down Expand Up @@ -234,7 +239,11 @@ void expected_results()
".*", // platform
largest_type, // test type(s)
".*(Y[nv]|y).*Random.*", // test data group
#ifdef SYCL_LANGUAGE_VERSION
".*", 2000, 1000);
#else
".*", 1500, 1000); // test function
#endif
//
// Fallback for sun has to go after the general cases above:
//
Expand Down
3 changes: 3 additions & 0 deletions test/test_bessel_y.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/bessel.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/array.hpp>
Expand Down Expand Up @@ -241,10 +242,12 @@ void test_bessel(T, const char* name)
BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, std::numeric_limits<T>::infinity()), T(0));
}

#ifndef BOOST_MATH_NO_EXCEPTIONS
BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0), T(-1)), std::domain_error);
BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0.2), T(-1)), std::domain_error);
BOOST_CHECK_THROW(boost::math::cyl_neumann(T(2), T(0)), std::domain_error);
BOOST_CHECK_THROW(boost::math::sph_neumann(2, T(-2)), std::domain_error);
#endif
#if LDBL_MAX_EXP > 1024
if (std::numeric_limits<T>::max_exponent > 1024)
{
Expand Down

0 comments on commit 40c39ca

Please sign in to comment.