Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducer and fix for issue encountered in smart_holder update. #4228

Merged
merged 6 commits into from
Oct 10, 2022

Commits on Oct 7, 2022

  1. Reproducer for issue encountered in smart_holder update.

    Ralf W. Grosse-Kunstleve committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    06e74d9 View commit details
    Browse the repository at this point in the history
  2. clang-tidy compatibility (untested).

    Ralf W. Grosse-Kunstleve committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    62311eb View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2022

  1. Add enable_if_t to workaround.

    Ralf W. Grosse-Kunstleve committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    e9070b2 View commit details
    Browse the repository at this point in the history
  2. Bug fix: Move PYBIND11_USING_WORKAROUND_FOR_CUDA_11_4_THROUGH_8 det…

    …ermination to detail/common.h
    
    So that it actually is defined in pybind11.h
    Ralf W. Grosse-Kunstleve committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    7557684 View commit details
    Browse the repository at this point in the history
  3. Try using the workaround (which is nicer than the original code) univ…

    …ersally.
    Ralf W. Grosse-Kunstleve committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    a049f1b View commit details
    Browse the repository at this point in the history
  4. Reduce reproducer for CUDA 11.7 issue encountered in smart_holder upd…

    …ate.
    
    This commit tested in isolation on top of current master + first version of reproducer (62311eb).
    
    Succeeds with Debian Clang 14.0.6 C++17 (and probably all other compilers).
    
    Fails for CUDA 11.7:
    
    ```
    cd /build/tests && /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -Dpybind11_tests_EXPORTS -I/mounted_pybind11/include -isystem=/usr/include/python3.10 -g --generate-code=arch=compute_52,code=[compute_52,sm_52] -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -Werror all-warnings -std=c++17 -MD -MT tests/CMakeFiles/pybind11_tests.dir/test_class.cpp.o -MF CMakeFiles/pybind11_tests.dir/test_class.cpp.o.d -x cu -c /mounted_pybind11/tests/test_class.cpp -o CMakeFiles/pybind11_tests.dir/test_class.cpp.o
    /mounted_pybind11/tests/test_class.cpp(53): error: more than one instance of overloaded function "pybind11::class_<type_, options...>::def [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]" matches the argument list:
                function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const char *, Func &&, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
    /mounted_pybind11/include/pybind11/pybind11.h(1557): here
                function template "pybind11::class_<test_class::pr4220_tripped_over_this::Empty0> &pybind11::class_<type_, options...>::def(const T &, const Extra &...) [with type_=test_class::pr4220_tripped_over_this::Empty0, options=<>]"
    /mounted_pybind11/include/pybind11/pybind11.h(1586): here
                argument types are: (const char [8], <unknown-type>)
                object type is: pybind11::class_<test_class::pr4220_tripped_over_this::Empty0>
    
    1 error detected in the compilation of "/mounted_pybind11/tests/test_class.cpp".
    ```
    Ralf W. Grosse-Kunstleve committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    9680dd4 View commit details
    Browse the repository at this point in the history