GPU compilation failure with pow.hpp from boost::multiprecision
- Langage dominant
- C++
- Étoiles
- 374
- Forks
- 264
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 17
Description
I have some C++ code that compiled just fine with `nvcc` from CUDA 12.6.1 and Boost 1.84.0. After updating to Boost 1.88.0, which includes the GPU math changes from Boost 1.87.0, I'm now seeing the following error message:
```
/usr/include/boost/multiprecision/detail/functions/pow.hpp(789): error: namespace "boost::math" has no member "rounding_error"
catch(const boost::math::rounding_error&)
^
```
If I'm understanding Boost's macro and include header structure correctly, boost/multiprecision/detail/functions/pow.hpp is inlined with boost/multiprecision/detail/default_ops.hpp. pow.hpp is always included no matter what in default_ops.hpp. `boost::math::rounding_error` is defined in boost/math/policies/error_handling.hpp, which is only included by default_ops.hpp if `BOOST_MP_MATH_AVAILABLE` is defined. This is the same macro that's used for guarding `BOOST_MP_CATCH(const boost::math::rounding_error&) {}` in pow.hpp (the same code not compiling), so all seems good. But, `boost::math::rounding_error` is only defined when `BOOST_MATH_NO_EXCEPTIONS` is NOT defined. And, when compiling with `nvcc`, `BOOST_MATH_NO_EXCEPTIONS` DOES get defined, according to boost/math/tools/config.hpp, because we've got `__CUDACC__` defined by simply using `nvcc`.
Should we be adjusting pow.hpp, and possibly any other cases like this in either `boost::math` or `boost::multiprecision`, to have something like this instead?
```
#if defined(BOOST_MP_MATH_AVAILABLE) && !defined(BOOST_MATH_NO_EXCEPTIONS)
BOOST_MP_CATCH(const boost::math::rounding_error&)
{ /* Fallthrough */
}
#endif
```
That way we only define this catch condition when we have exception support and multiprecision math is available?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.