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

NVRTC Batch 5 Testing #13

Merged
merged 35 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
697755e
Add NVRTC support to precision tools
mborland Aug 14, 2024
4aeb9c1
Fix missing header in error handling
mborland Aug 14, 2024
14694c4
Add minimal implantation of pair for NVRTC platform
mborland Aug 14, 2024
ec5b2a9
Add NVRTC support to derived accessors
mborland Aug 14, 2024
a6d14dd
Add NVRTC support to the arcsine dist
mborland Aug 14, 2024
2356c73
Undef BOOST_FPU_EXCEPTION_GUARD if exists and give a new empty def
mborland Aug 14, 2024
791e9af
Add testing of the arcsine dist
mborland Aug 14, 2024
59c1dd4
Fix FPU Guard macro
mborland Aug 14, 2024
dfcda43
Add NVRTC support to bernoulli dist
mborland Aug 14, 2024
ba549c5
Add bernoulli dist NVRTC testing
mborland Aug 14, 2024
ed65c6e
Fix kernel naming
mborland Aug 14, 2024
13ba411
Remove workarounds and markup functions that will never be taken anyway
mborland Aug 14, 2024
0805e5e
Add NVRTC support to cauchy dist
mborland Aug 14, 2024
5171e83
Add cauchy dist NVRTC testing
mborland Aug 14, 2024
9b3c139
Add NVRTC support to exponential dist
mborland Aug 14, 2024
363f2df
Add exponential dist NVRTC testing
mborland Aug 14, 2024
f650f77
Add NVRTC support to extreme value dist
mborland Aug 14, 2024
e508d49
Add NVRTC paths to log_max_value and log_min_value
mborland Aug 14, 2024
4217281
Add extreme value dist NVRTC testing
mborland Aug 14, 2024
5adc939
Replace thurst::pair with cuda::std::pair for NVRTC compat
mborland Aug 14, 2024
4dc7070
Implement make_tuple since it's missing from cuda/std
mborland Aug 14, 2024
1a8bfbb
Add more macro definitions
mborland Aug 15, 2024
4518351
Add NVRTC support to holtsmark dist
mborland Aug 15, 2024
b123d38
Add holtsmark dist NVRTC testing
mborland Aug 15, 2024
6ba8cbb
Add NVRTC support to landau dist
mborland Aug 15, 2024
3eb59a6
Add landau dist NVRTC testing
mborland Aug 15, 2024
4a10ab5
Add NVRTC support to laplace dist
mborland Aug 15, 2024
6ef1632
Add laplace dist NVRTC testing
mborland Aug 15, 2024
3b9863d
Add NVRTC support to logistic dist
mborland Aug 15, 2024
e165bfa
Add logistic dist NVRTC testing
mborland Aug 15, 2024
4f2eb02
Disable whole file on NVRTC
mborland Aug 15, 2024
20e3a7e
Add NVRTC support to mapairy dist
mborland Aug 15, 2024
cc1a902
Add mapairy dist NVRTC testing
mborland Aug 15, 2024
64a92dd
Add NVRTC support to saspoint5 dist
mborland Aug 15, 2024
c3bab84
Add saspoint5 NVRTC testing
mborland Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions include/boost/math/distributions/arcsine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@
#ifndef BOOST_MATH_DIST_ARCSINE_HPP
#define BOOST_MATH_DIST_ARCSINE_HPP

#include <cmath>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/distributions/complement.hpp> // complements.
#include <boost/math/distributions/detail/common_error_handling.hpp> // error checks.
#include <boost/math/constants/constants.hpp>

#include <boost/math/special_functions/fpclassify.hpp> // isnan.
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>

#ifndef BOOST_MATH_HAS_NVRTC
#include <boost/math/distributions/fwd.hpp>
#include <cmath>
#include <utility>
#include <exception> // For std::domain_error.
#endif

#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4702) // Unreachable code,
// in domain_error_imp in error_handling.
#endif

#include <utility>
#include <exception> // For std::domain_error.

namespace boost
{
namespace math
Expand Down
6 changes: 5 additions & 1 deletion include/boost/math/distributions/bernoulli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@
#ifndef BOOST_MATH_SPECIAL_BERNOULLI_HPP
#define BOOST_MATH_SPECIAL_BERNOULLI_HPP

#include <boost/math/distributions/fwd.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/tools/type_traits.hpp>
#include <boost/math/distributions/complement.hpp> // complements
#include <boost/math/distributions/detail/common_error_handling.hpp> // error checks
#include <boost/math/special_functions/fpclassify.hpp> // isnan.
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>

#ifndef BOOST_MATH_HAS_NVRTC
#include <utility>
#include <boost/math/distributions/fwd.hpp>
#endif

namespace boost
{
Expand Down
8 changes: 7 additions & 1 deletion include/boost/math/distributions/cauchy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/tools/numeric_limits.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>

#ifndef BOOST_MATH_HAS_NVRTC
#include <boost/math/distributions/fwd.hpp>
#include <utility>
#include <cmath>
#endif

namespace boost{ namespace math
{
Expand Down
7 changes: 5 additions & 2 deletions include/boost/math/distributions/detail/derived_accessors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
// can find the definitions referred to herein.
//

#include <cmath>
#include <boost/math/tools/assert.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/assert.hpp>

#ifndef BOOST_MATH_HAS_NVRTC
#include <cmath>
#endif

#ifdef _MSC_VER
# pragma warning(push)
Expand Down
6 changes: 5 additions & 1 deletion include/boost/math/distributions/exponential.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/tools/numeric_limits.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>

#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4702) // unreachable code (return after domain_error throw).
#endif

#ifndef BOOST_MATH_HAS_NVRTC
#include <boost/math/distributions/fwd.hpp>
#include <utility>
#include <cmath>
#endif

namespace boost{ namespace math{

Expand Down
9 changes: 7 additions & 2 deletions include/boost/math/distributions/extreme_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/numeric_limits.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>

//
// This is the maximum extreme value distribution, see
Expand All @@ -24,8 +26,11 @@
// Also known as a Fisher-Tippett distribution, a log-Weibull
// distribution or a Gumbel distribution.

#ifndef BOOST_MATH_HAS_NVRTC
#include <boost/math/distributions/fwd.hpp>
#include <utility>
#include <cmath>
#endif

#ifdef _MSC_VER
# pragma warning(push)
Expand Down Expand Up @@ -280,7 +285,7 @@ BOOST_MATH_GPU_ENABLED inline RealType logcdf(const complemented2_type<extreme_v
}

template <class RealType, class Policy>
RealType quantile(const complemented2_type<extreme_value_distribution<RealType, Policy>, RealType>& c)
BOOST_MATH_GPU_ENABLED RealType quantile(const complemented2_type<extreme_value_distribution<RealType, Policy>, RealType>& c)
{
BOOST_MATH_STD_USING // for ADL of std functions

Expand Down
47 changes: 27 additions & 20 deletions include/boost/math/distributions/holtsmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/numeric_limits.hpp>
#include <boost/math/tools/tuple.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/tools/type_traits.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/tools/big_constant.hpp>
#include <boost/math/distributions/complement.hpp>
#include <boost/math/distributions/detail/common_error_handling.hpp>
#include <boost/math/distributions/detail/derived_accessors.hpp>
#include <boost/math/tools/rational.hpp>
#include <boost/math/special_functions/cbrt.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/tools/promotion.hpp>

#ifndef BOOST_MATH_HAS_NVRTC
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/tools/big_constant.hpp>
#include <utility>
#include <cmath>
#endif

namespace boost { namespace math {
template <class RealType, class Policy>
Expand All @@ -33,7 +40,7 @@ class holtsmark_distribution;
namespace detail {

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integral_constant<int, 53>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const boost::math::integral_constant<int, 53>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -263,7 +270,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealTyp


template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integral_constant<int, 113>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const boost::math::integral_constant<int, 113>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -615,14 +622,14 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_plus_imp_prec(const RealTyp


template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp_prec(const RealType& x, const std::integral_constant<int, 53> &tag) {
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp_prec(const RealType& x, const boost::math::integral_constant<int, 53> &tag) {
BOOST_MATH_STD_USING // for ADL of std functions

return holtsmark_pdf_plus_imp_prec<RealType>(abs(x), tag);
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp_prec(const RealType& x, const std::integral_constant<int, 113>& tag) {
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp_prec(const RealType& x, const boost::math::integral_constant<int, 113>& tag) {
BOOST_MATH_STD_USING // for ADL of std functions

return holtsmark_pdf_plus_imp_prec<RealType>(abs(x), tag);
Expand Down Expand Up @@ -655,7 +662,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp(const holtsmark_distrib

typedef typename tools::promote_args<RealType>::type result_type;
typedef typename policies::precision<result_type, Policy>::type precision_type;
typedef std::integral_constant<int,
typedef boost::math::integral_constant<int,
precision_type::value <= 0 ? 0 :
precision_type::value <= 53 ? 53 :
precision_type::value <= 113 ? 113 : 0
Expand All @@ -671,7 +678,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_pdf_imp(const holtsmark_distrib
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant<int, 53>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const boost::math::integral_constant<int, 53>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -920,7 +927,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealTyp
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant<int, 113>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const boost::math::integral_constant<int, 113>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -1303,7 +1310,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_plus_imp_prec(const RealTyp
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant<int, 53>& tag) {
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const boost::math::integral_constant<int, 53>& tag) {
if (x >= 0) {
return complement ? holtsmark_cdf_plus_imp_prec(x, tag) : 1 - holtsmark_cdf_plus_imp_prec(x, tag);
}
Expand All @@ -1316,7 +1323,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp_prec(const RealType& x,
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant<int, 113>& tag) {
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const boost::math::integral_constant<int, 113>& tag) {
if (x >= 0) {
return complement ? holtsmark_cdf_plus_imp_prec(x, tag) : 1 - holtsmark_cdf_plus_imp_prec(x, tag);
}
Expand Down Expand Up @@ -1355,7 +1362,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp(const holtsmark_distrib

typedef typename tools::promote_args<RealType>::type result_type;
typedef typename policies::precision<result_type, Policy>::type precision_type;
typedef std::integral_constant<int,
typedef boost::math::integral_constant<int,
precision_type::value <= 0 ? 0 :
precision_type::value <= 53 ? 53 :
precision_type::value <= 113 ? 113 : 0
Expand All @@ -1371,7 +1378,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_cdf_imp(const holtsmark_distrib
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant<int, 53>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const boost::math::integral_constant<int, 53>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -1634,7 +1641,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const R


template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant<int, 113>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const boost::math::integral_constant<int, 113>&)
{
BOOST_MATH_STD_USING
RealType result;
Expand Down Expand Up @@ -2230,7 +2237,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_upper_imp_prec(const R
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant<int, 53>& tag)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const boost::math::integral_constant<int, 53>& tag)
{
if (p > 0.5) {
return !complement ? holtsmark_quantile_upper_imp_prec(1 - p, tag) : -holtsmark_quantile_upper_imp_prec(1 - p, tag);
Expand All @@ -2240,7 +2247,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp_prec(const RealTyp
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant<int, 113>& tag)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const boost::math::integral_constant<int, 113>& tag)
{
if (p > 0.5) {
return !complement ? holtsmark_quantile_upper_imp_prec(1 - p, tag) : -holtsmark_quantile_upper_imp_prec(1 - p, tag);
Expand Down Expand Up @@ -2277,7 +2284,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp(const holtsmark_di

typedef typename tools::promote_args<RealType>::type result_type;
typedef typename policies::precision<result_type, Policy>::type precision_type;
typedef std::integral_constant<int,
typedef boost::math::integral_constant<int,
precision_type::value <= 0 ? 0 :
precision_type::value <= 53 ? 53 :
precision_type::value <= 113 ? 113 : 0
Expand All @@ -2291,13 +2298,13 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_quantile_imp(const holtsmark_di
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_entropy_imp_prec(const std::integral_constant<int, 53>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_entropy_imp_prec(const boost::math::integral_constant<int, 53>&)
{
return static_cast<RealType>(2.06944850513462440032);
}

template <class RealType>
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_entropy_imp_prec(const std::integral_constant<int, 113>&)
BOOST_MATH_GPU_ENABLED inline RealType holtsmark_entropy_imp_prec(const boost::math::integral_constant<int, 113>&)
{
return BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.0694485051346244003155800384542166381);
}
Expand All @@ -2320,7 +2327,7 @@ BOOST_MATH_GPU_ENABLED inline RealType holtsmark_entropy_imp(const holtsmark_dis

typedef typename tools::promote_args<RealType>::type result_type;
typedef typename policies::precision<result_type, Policy>::type precision_type;
typedef std::integral_constant<int,
typedef boost::math::integral_constant<int,
precision_type::value <= 0 ? 0 :
precision_type::value <= 53 ? 53 :
precision_type::value <= 113 ? 113 : 0
Expand Down
Loading