Skip to content

Commit

Permalink
Revert "Back out the change PR pybind#4220 made in pybind11.h (experi…
Browse files Browse the repository at this point in the history
…ment)."

This reverts commit d7e65a3.
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 8, 2022
1 parent 1b21059 commit 413ef36
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,22 @@ class class_ : public detail::generic_type {
return *this;
}

// Nvidia's NVCC is broken between 11.4.0 and 11.8.0
// https://github.com/pybind/pybind11/issues/4193
#if defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 4) \
&& (__CUDACC_VER_MINOR__ <= 8)
template <typename T, typename... Extra>
class_ &def(const T &op, const Extra &...extra) {
op.execute(*this, extra...);
return *this;
}

template <typename T, typename... Extra>
class_ &def_cast(const T &op, const Extra &...extra) {
op.execute_cast(*this, extra...);
return *this;
}
#else
template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
class_ &def(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
op.execute(*this, extra...);
Expand All @@ -1819,6 +1835,7 @@ class class_ : public detail::generic_type {
op.execute_cast(*this, extra...);
return *this;
}
#endif

template <typename... Args, typename... Extra>
class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra &...extra) {
Expand Down

0 comments on commit 413ef36

Please sign in to comment.