Skip to content

Commit 7557684

Browse files
committed
Bug fix: Move PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8 determination to detail/common.h
So that it actually is defined in pybind11.h
1 parent e9070b2 commit 7557684

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

include/pybind11/detail/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,5 +1178,12 @@ constexpr inline bool silence_msvc_c4127(bool cond) { return cond; }
11781178
# define PYBIND11_DETAILED_ERROR_MESSAGES
11791179
#endif
11801180

1181+
#if defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 4) \
1182+
&& (__CUDACC_VER_MINOR__ <= 8) && !defined(PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8)
1183+
// Nvidia's NVCC is broken between 11.4.0 and 11.8.0
1184+
// https://github.com/pybind/pybind11/issues/4193
1185+
# define PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8
1186+
#endif
1187+
11811188
PYBIND11_NAMESPACE_END(detail)
11821189
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)

include/pybind11/operators.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ struct op_impl {};
8484
/// Operator implementation generator
8585
template <op_id id, op_type ot, typename L, typename R>
8686
struct op_ {
87-
#if defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 4) \
88-
&& (__CUDACC_VER_MINOR__ <= 8)
89-
// Nvidia's NVCC is broken between 11.4.0 and 11.8.0
90-
// https://github.com/pybind/pybind11/issues/4193
91-
# define PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8
87+
#if defined(PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8)
9288
static constexpr bool op_enable_if_hook = true;
9389
#endif
9490
template <typename Class, typename... Extra>

0 commit comments

Comments
 (0)