Qengineering / Install-OpenCV-Jetson-Nano

OpenCV installation script with CUDA and cuDNN support
https://qengineering.eu/install-opencv-on-jetson-nano.html
BSD 3-Clause "New" or "Revised" License
137 stars 47 forks source link

Add native flags #20

Closed Dapid closed 4 months ago

Dapid commented 4 months ago

Since we are building on the same hardware that is running, we can take full advantage of the compiler's knowledge of the CPU. I have succesfully built OpenCV adding the flags:

  -D CMAKE_CXX_FLAGS="-march=native -mtune=native" \
  -D CMAKE_C_FLAGS="-march=native -mtune=native"

I haven't benchmarked it, but on my experience with more complex CPUs, that usually gives me a 5-20% improvement.

Should I open a PR?

BTW: thanks for the scripts! It is great!

Qengineering commented 4 months ago

Thanks! If you like to open a PR, be my guest. Otherwise I will take care of it.