I encounter a same problem like Converting Old (pre-PyTorch1.0) C++/CUDA 8 extensions to PyTorch 1.0 C++/CUDA 9 extension.
The project I want to convert is here: https://github.com/speedinghzl/CCNet
I follow the official guide and write PYBIND11_MODULE
in src/lib_cffi.cpp
file and a setup.py
to compile the whole source files. But it fails and mainly shows the errors below:
/home/users/USERNAME/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/detail/descr.h:38:42: error: invalid use of incomplete type ‘struct CUstream_st’
return {{&typeid(Ts)..., nullptr}};
^
/home/users/USERNAME/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:168:73: error: ‘static constexpr std::array<const std::type_info*, (sizeof... (Ts) + 1)> pybind11::detail::descr<N, Ts>::types() [with long
unsigned int N = 67ul; Ts = {CUstream_st}]’ called in a constant expression
PYBIND11_DESCR_CONSTEXPR auto types = decltype(signature)::types();
Could any one give me a help? I am very confused about this error and have no idea to solve it.