cuda_float128.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From a332112317450457c715675686386ec81214b863 Mon Sep 17 00:00:00 2001
  2. From: Axel Huebl <axel.huebl@plasma.ninja>
  3. Date: Fri, 18 Dec 2015 10:27:04 +0100
  4. Subject: [PATCH] Fix Trac 11852: GCC & CUDA __float128
  5. Fix trac issue
  6. https://svn.boost.org/trac/boost/ticket/11852
  7. Similar to
  8. https://svn.boost.org/trac/boost/ticket/8048
  9. `__float128` is still unsupported when compiling with nvcc
  10. (tested with `CUDA 7.5.18`). First noticed with the latest
  11. release (`1.60.0`) and `GCC 4.8.5` but should affect all
  12. previous releases depending on used modules.
  13. In my case, I triggered it with the components
  14. `program_options regex filesystem system thread math_tr1`
  15. enabled .
  16. ---
  17. include/boost/config/compiler/gcc.hpp | 8 ++++++--
  18. 1 file changed, 6 insertions(+), 2 deletions(-)
  19. diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp
  20. index d9dd59d..8683dbd 100644
  21. --- a/include/boost/config/compiler/gcc.hpp
  22. +++ b/include/boost/config/compiler/gcc.hpp
  23. @@ -134,7 +134,7 @@
  24. // Recent GCC versions have __int128 when in 64-bit mode.
  25. //
  26. // We disable this if the compiler is really nvcc as it
  27. -// doesn't actually support __int128 as of CUDA_VERSION=5000
  28. +// doesn't actually support __int128 as of CUDA_VERSION=7500
  29. // even though it defines __SIZEOF_INT128__.
  30. // See https://svn.boost.org/trac/boost/ticket/8048
  31. // Only re-enable this for nvcc if you're absolutely sure
  32. @@ -148,12 +148,16 @@
  33. // include a std lib header to detect this - not ideal, but we'll
  34. // be including <cstddef> later anyway when we select the std lib.
  35. //
  36. +// Nevertheless, as of CUDA 7.5, using __float128 with the host
  37. +// compiler is still not supported.
  38. +// See https://svn.boost.org/trac/boost/ticket/11852
  39. +//
  40. #ifdef __cplusplus
  41. #include <cstddef>
  42. #else
  43. #include <stddef.h>
  44. #endif
  45. -#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
  46. +#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) && !defined(__CUDACC__)
  47. # define BOOST_HAS_FLOAT128
  48. #endif