Drop requirement of CUDA 11.5 for CMAKE_ARCHITECTURE all
In CMake 3.23, we can now specify a CMAKE_ARCHITECTURES
property value of all
. However - that's only possible for CUDA 11.5 or later, which itself supports passing all
.
That is not necessary. Previous versions of NVCC tell you, using their --help
page, which values they support for --gpu-architecture
, --gpu-code
and/or --generate-code
. For example, from NVCC 10.2:
--gpu-architecture <arch> (-arch)
... snip ...
Allowed values for this option: 'compute_30','compute_32','compute_35',
'compute_37','compute_50','compute_52','compute_53','compute_60','compute_61',
'compute_62','compute_70','compute_72','compute_75','sm_30','sm_32','sm_35',
'sm_37','sm_50','sm_52','sm_53','sm_60','sm_61','sm_62','sm_70','sm_72',
'sm_75'.
This can be opportunistically parsed and converted into the set of all relevant architectures. So, the logic would be passing all
for NVCC 11.5 or later, otherwise trying to figure out what all
stands for as per the above, and otherwise failing.
(Slightly related: #22375 (closed))
Edited by Eyal Rozenberg