How to compile opencv to support CUDA multi arch for 7.5 and 8.6

How to compile opencv to support CUDA multi arch for 7.5 and 8.6?
-D CUDA_ARCH_BIN = “7.5 8.6” -D CUDA_ARCH_PTX=“7.5 8.6” ?
That’s right ? Thanks!

If you know that you are only going to use 7.5 and 8.6 then

-DCUDA_ARCH_BIN = 7.5,8.6

if you want it to be forward compatible with any future generations just incase you could also include the ptx, i.e.

-DCUDA_ARCH_PTX=8.7