-3

I have a CUDA c++ code.I'm doing some operations with OpenCV in this code.I compile program

  nvcc file.cu -o o2 `pkg-config --libs --cflags opencv4

command.I wonder that which nvcc optimization flags would be the best ,efficient and useful ? Thanks in advance.

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • I have a .cpp and cuda file when I compile program with g++ file.cpp -o -fast , is faster than nvcc file.cu -o o1 .So which optimization flag do you advice me to use for nvcc compiling? – Elif Kantar Jan 07 '22 at 10:43

1 Answers1

1

There is documentation for nvcc.

There is also command-line help (nvcc --help).

You may find information about optimization and switches in either of those resources.

You shouldn't need any extra flags to get the fastest possible device code from nvcc (do not specify -G). For host code optimization, you may wish to try -O3.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257