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

cuda compile error #35

Open
xyecoding opened this issue May 14, 2019 · 4 comments
Open

cuda compile error #35

xyecoding opened this issue May 14, 2019 · 4 comments

Comments

@xyecoding
Copy link

xyecoding commented May 14, 2019

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.

@fangwei123456
Copy link

@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>

@ClementPinard
Copy link
Contributor

@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.

@hadifar
Copy link

hadifar commented Jul 9, 2019

same issue! fixed by replacing extension.h with types.h

@alanzhai219
Copy link

@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. ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants