build(rpm): Update Fedora spec and CUDA math_functions.h patch for Fedora 43+ (#4353)

This commit is contained in:
ReenigneArcher 2025-10-24 23:45:15 -04:00 committed by GitHub
commit 7ecb78177b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 102 additions and 2 deletions

View file

@ -161,9 +161,9 @@ function install_cuda() {
--toolkitpath="%{cuda_dir}" --toolkitpath="%{cuda_dir}"
rm "%{_builddir}/cuda.run" rm "%{_builddir}/cuda.run"
# we need to patch math_functions.h on fedora 42 # we need to patch math_functions.h on fedora 42+
# see https://forums.developer.nvidia.com/t/error-exception-specification-is-incompatible-for-cospi-sinpi-cospif-sinpif-with-glibc-2-41/323591/3 # see https://forums.developer.nvidia.com/t/error-exception-specification-is-incompatible-for-cospi-sinpi-cospif-sinpif-with-glibc-2-41/323591/3
if [ "%{?fedora}" -eq 42 ]; then if [ "%{?fedora}" -ge 42 ]; then
echo "Original math_functions.h:" echo "Original math_functions.h:"
find "%{cuda_dir}" -name math_functions.h -exec cat {} \; find "%{cuda_dir}" -name math_functions.h -exec cat {} \;

View file

@ -1,6 +1,24 @@
diff '--color=auto' -ur a/cuda/targets/sbsa-linux/include/crt/math_functions.h b/cuda/targets/sbsa-linux/include/crt/math_functions.h diff '--color=auto' -ur a/cuda/targets/sbsa-linux/include/crt/math_functions.h b/cuda/targets/sbsa-linux/include/crt/math_functions.h
--- a/cuda/targets/sbsa-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200 --- a/cuda/targets/sbsa-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200
+++ b/cuda/targets/sbsa-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100 +++ b/cuda/targets/sbsa-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100
@@ -594,7 +594,7 @@
*
* \note_accuracy_double
*/
-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x);
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x) noexcept (true);
/**
* \ingroup CUDA_MATH_SINGLE
@@ -618,7 +618,7 @@
*
* \note_accuracy_single
*/
-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x);
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x) noexcept (true);
#if defined(__QNX__) && !defined(_LIBCPP_VERSION)
namespace std {
@@ -2553,7 +2553,7 @@ @@ -2553,7 +2553,7 @@
* *
* \note_accuracy_double * \note_accuracy_double
@ -37,3 +55,35 @@ diff '--color=auto' -ur a/cuda/targets/sbsa-linux/include/crt/math_functions.h b
/** /**
* \ingroup CUDA_MATH_DOUBLE * \ingroup CUDA_MATH_DOUBLE
* \brief Calculate the sine and cosine of the first input argument * \brief Calculate the sine and cosine of the first input argument
@@ -5982,13 +5982,13 @@
#pragma warning (disable : 4211)
#endif /* _WIN32 */
-__func__(double rsqrt(double a));
+__func__(double rsqrt(double a) noexcept (true));
__func__(double rcbrt(double a));
-__func__(double sinpi(double a));
+__func__(double sinpi(double a) noexcept (true));
-__func__(double cospi(double a));
+__func__(double cospi(double a) noexcept (true));
__func__(void sincospi(double a, double *sptr, double *cptr));
@@ -6004,10 +6004,10 @@
__func__(double erfcx(double a));
-__func__(float rsqrtf(float a));
+__func__(float rsqrtf(float a) noexcept (true));
__func__(float rcbrtf(float a));
-__func__(float sinpif(float a));
+__func__(float sinpif(float a) noexcept (true));
-__func__(float cospif(float a));
+__func__(float cospif(float a) noexcept (true));
__func__(void sincospif(float a, float *sptr, float *cptr));

View file

@ -1,6 +1,24 @@
diff '--color=auto' -ur a/cuda/targets/x86_64-linux/include/crt/math_functions.h b/cuda/targets/x86_64-linux/include/crt/math_functions.h diff '--color=auto' -ur a/cuda/targets/x86_64-linux/include/crt/math_functions.h b/cuda/targets/x86_64-linux/include/crt/math_functions.h
--- a/cuda/targets/x86_64-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200 --- a/cuda/targets/x86_64-linux/include/crt/math_functions.h 2024-08-23 00:25:39.000000000 +0200
+++ b/cuda/targets/x86_64-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100 +++ b/cuda/targets/x86_64-linux/include/crt/math_functions.h 2025-02-17 01:19:44.270292640 +0100
@@ -594,7 +594,7 @@
*
* \note_accuracy_double
*/
-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x);
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x) noexcept (true);
/**
* \ingroup CUDA_MATH_SINGLE
@@ -618,7 +618,7 @@
*
* \note_accuracy_single
*/
-extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x);
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x) noexcept (true);
#if defined(__QNX__) && !defined(_LIBCPP_VERSION)
namespace std {
@@ -2553,7 +2553,7 @@ @@ -2553,7 +2553,7 @@
* *
* \note_accuracy_double * \note_accuracy_double
@ -37,3 +55,35 @@ diff '--color=auto' -ur a/cuda/targets/x86_64-linux/include/crt/math_functions.h
/** /**
* \ingroup CUDA_MATH_DOUBLE * \ingroup CUDA_MATH_DOUBLE
* \brief Calculate the sine and cosine of the first input argument * \brief Calculate the sine and cosine of the first input argument
@@ -5982,13 +5982,13 @@
#pragma warning (disable : 4211)
#endif /* _WIN32 */
-__func__(double rsqrt(double a));
+__func__(double rsqrt(double a) noexcept (true));
__func__(double rcbrt(double a));
-__func__(double sinpi(double a));
+__func__(double sinpi(double a) noexcept (true));
-__func__(double cospi(double a));
+__func__(double cospi(double a) noexcept (true));
__func__(void sincospi(double a, double *sptr, double *cptr));
@@ -6004,10 +6004,10 @@
__func__(double erfcx(double a));
-__func__(float rsqrtf(float a));
+__func__(float rsqrtf(float a) noexcept (true));
__func__(float rcbrtf(float a));
-__func__(float sinpif(float a));
+__func__(float sinpif(float a) noexcept (true));
-__func__(float cospif(float a));
+__func__(float cospif(float a) noexcept (true));
__func__(void sincospif(float a, float *sptr, float *cptr));