select_compute_arch.cmake: Make common arches chosen when autodetect fails configurable
When autodetect fails in https://gitlab.kitware.com/cmake/cmake/blob/v3.16.3/Modules/FindCUDA/select_compute_arch.cmake, CUDA_COMMON_GPU_ARCHITECTURES
are targeted.
However, CUDA_COMMON_GPU_ARCHITECTURES
is an extensive list of architectures and arguable not a good default in all cases. CUDA_COMMON_GPU_ARCHITECTURES
is populated inside https://gitlab.kitware.com/cmake/cmake/blob/v3.16.3/Modules/FindCUDA/select_compute_arch.cmake and can thus not be configured.
For example, instead of building for CUDA_COMMON_GPU_ARCHITECTURES=3.0;3.5;5.0;5.2;6.0;6.1;7.0;7.0+PTX;7.5;7.5+PTX
if auto-detection fails, projects may want to default to building for only 3.0;5.0;6.0;7.0;7.5
or 3.0;5.0;6.0;7.0;7.5;7.5+PTX
. (Note that code compiled for X.y
runs on arch X.z
as long as z >= y
.)