List of "whitelisted" sm_ values for CUDA is incomplete
The CMake code allows to specify -DGPU_TARGET="sm_30 sm_50"
and so on.
However that list is incomplete. From my CUDA 10.1 installation: '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'
The CMake code does not handle 3.2 and 3.7 and uses 7.1 instead of 7.2.
Moreover: Keeping the code up to date might be problematic as newer nvcc add new valid values.
I’d hence like to propose using a regex or a double-nested loop (for major and minor version) to extract all such values allowing users full control over which arch is used.
While being at it: if (${GPU_TARGET} MATCHES Pascal)
style code is problematic. The correct code would be if (GPU_TARGET MATCHES "Pascal")
. This is due to CMake variable expansion, see the docs for details.
Comments (4)
-
-
Ditto in the Makefile. SLATE uses $(foreach) in its Makefile.
-
reporter Fix the CMake side: https://bitbucket.org/icl/magma/pull-requests/5
-
- changed status to resolved
Accept any sm_xx passed to GPU_TARGET in CMakeLists
Previously valid arguments were silently ignored, e.g. sm_32 and future values had to be added manually, see sm_80
Fixes
#32→ <<cset 19c9526d1a8a>>
- Log in to comment
Agreed. Instead of listing every value, it should probably have a loop, something like (untested!):