Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I correctly add my own .cu files to the open CV poject?

I have added my own .hpp, my own .cpp, and my own .cu files to the OpenCV project. I put the .hpp into the Include, the .cpp file into the host, and the .cu file into the "device" parts of the opencv_gpu module. The .hpp and the .cpp files complie fine. However it appears to me that my .cu file never gets compiled.

  1. When I compile OpenCV I get linker errors for the functions that are inside the .cu file.
  2. If I introduce blatant syntax errors to my .cu file the compiler never complains about them.
  3. When I go to the build menu when I have one of the .cu files that came with OpenCV opened, I get the option to "Build open_cv gpu". I get no such option when I try to do it when I have my .cu file open.

There must be a step that I am missing in order to get Visual studio to see my .cu file and invoke the compiler for it. Do I have to rerun Cmake, or edit some config file?