Skip to content

Allow to specify or determine CUDA arch by CMake

Roel Aaij requested to merge raaij_cmake_cuda_arch into master

This MR replaces the assumed cuda arch that is built for (3.0) with auto detection or manual specification. A new CMake option has been added: CUDA_ARCH, which can be set to:

  • MIN: minimum required 3.0, will check if this is available in a device
  • MAX: highest compute capability in any devices
  • COMP: highest compute capability that all devices support
  • anything else is passed directly, should be of the format sm_XY (format is not checked by CMake)

For exammple:

$> cmake -DCUDA_ARCH=MAX ..
...
-- Detecting MAX CUDA architecture
-- Detecting MAX CUDA architecture - sm_61
...

While trying to get some annotated assembly and source in nsight, I found that that works only with compute capability 5.2 and higher, so I added a way to specify this when running CMake.

Merge request reports

Loading