-
Notifications
You must be signed in to change notification settings - Fork 27.4k
how to use libtorch library in cuda file with nvcc compiler(c++)? #27958
Description
❓ Questions and Help
Motivation
i want to implement nms in parallel processing with libtorch library.
i use this cuda code(https://github.com/gdlg/pytorch_nms)
Environment
PyTorch version : 1.2.0
CUDA (nvcc compiler ) : 10.0
libtorch version : 1.2.0
system : win10
Operation
the command :i use nvcc -c nms_kernel.cu -L -lcudart -I D:\Code-software\NNF\libtorch\libtorch\include -I D:\Code-software\NNF\libtorch\libtorch\include\torch\csrc\api\include to compiled it
ERROR
D:/Code-software/NNF/libtorch/libtorch/include\torch/csrc/jit/argument_spec.h(181): error: member "torch::jit::ArgumentSpecCreator::DEPTH_LIMIT" may not be initialized 1 error detected in the compilation of "C:/Users/Cason/AppData/Local/Temp/tmpxft_00001b28_00000000-10_nms_kernel.cpp1.ii"
as long as i add #include <torch/extension.h> or #include <torch/script.h> in cuda files,It makes this kind of mistake.
cc @yf225