|
96 | 96 | # endif
|
97 | 97 | #endif
|
98 | 98 |
|
99 |
| -// For CUDA, GCC7, GCC8 (and maybe some other platforms): |
100 |
| -// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`. |
101 |
| -// When defining PYBIND11_NOINLINE_FORCED, it is best to also use |
102 |
| -// `-Wno-attributes` (or not to use `-Werror` and ignore the warnings). |
103 |
| -#if !defined(PYBIND11_NOINLINE_FORCED) && \ |
104 |
| - (defined(__CUDACC__) || \ |
105 |
| - (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8))) |
106 |
| -# define PYBIND11_NOINLINE_DISABLED |
107 |
| -#endif |
108 |
| - |
109 |
| -// Note: Forward declarations should never be `inline`: |
| 99 | +// The PYBIND11_NOINLINE macro is for function DEFINITIONS. |
| 100 | +// In contrast, FORWARD DECLARATIONS should never use this macro: |
110 | 101 | // https://stackoverflow.com/questions/9317473/forward-declaration-of-inline-functions
|
111 |
| -#if defined(PYBIND11_NOINLINE_DISABLED) |
| 102 | +#if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation. |
112 | 103 | # define PYBIND11_NOINLINE inline
|
113 | 104 | #elif defined(_MSC_VER)
|
114 | 105 | # define PYBIND11_NOINLINE __declspec(noinline) inline
|
115 | 106 | #else
|
116 | 107 | # define PYBIND11_NOINLINE __attribute__ ((noinline)) inline
|
117 | 108 | #endif
|
118 | 109 |
|
119 |
| -// DECISION TO BE MADE before this PR is merged: |
120 |
| -// ---------------------------------------------------------------------------- |
121 |
| -// This code and the 9 x 2 pragma blocks referring to |
122 |
| -// PYBIND11_NOINLINE_GCC_PRAGMA_ATTRIBUTES_NEEDED could be purged. |
123 |
| -// ---------------------------------------------------------------------------- |
124 | 110 | #if !defined(PYBIND11_NOINLINE_DISABLED)
|
125 | 111 | # if (defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8))) \
|
126 | 112 | && !defined(PYBIND11_NOINLINE_GCC_PRAGMA_ATTRIBUTES_NEEDED)
|
| 113 | +// Only CUDA version known/tested (as of August 2021): CUDA 11, Ubuntu 20.04 |
127 | 114 | # define PYBIND11_NOINLINE_GCC_PRAGMA_ATTRIBUTES_NEEDED
|
128 | 115 | # elif defined(__INTEL_COMPILER)
|
129 | 116 | // The following pragma cannot be pop'ed:
|
|
0 commit comments