Open xyecoding opened 5 years ago
@xyegithub https://discuss.pytorch.org/t/compiling-cpp-cuda-extension-composed-of-multiple-files/30685/4 use #include <torch/types.h> in *.cu rather than <torch/extension.h>
@goldsborough @soumith any thoughts on this ? Should this solution be enforced in good practice ? Encountered the same issue with a user on my own module, so it's apparently not an isolated problem.
same issue! fixed by replacing extension.h
with types.h
@xyegithub https://discuss.pytorch.org/t/compiling-cpp-cuda-extension-composed-of-multiple-files/30685/4 use #include <torch/types.h> in *.cu rather than <torch/extension.h>
replace '#include <torch/extensions.h>' with '#include <torch/types.h>' in lltm_cuda_kernel.cpp. It works. Thanks for your suggestions. ^^
PyTorch GitHub Issues Guidelines
/home/yexiang/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:206:error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs /home/yexiang/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:215:error: template argument 1 is invalid /home/yexiang/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:392:error: expansion pattern ‘pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ..., true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_base_of<pybind11::arg, Args> >::value ..., pybind11::detail::negation<std::is_same<pybind11::detail::kwargs_proxy, Args> >::value ...> > >::value’ contains no argument packs /home/yexiang/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:1165:395:error: template argument 2 is invalid /home/yexiang/anaconda3/lib/python3.6/site-packages/torch/lib/include/pybind11/pytypes.h:
I can't compile the cuda version. When torch/extension.h is included in the .cu file, this error is reported. How to solve this problem.