set CMAKE_CUDA_ARCHITECTURES for newer cmakes in camp (#31333)

This commit is contained in:
Chris White 2022-06-28 17:45:45 -07:00 committed by GitHub
parent 8bdc506579
commit 62cac911e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,7 @@ def cmake_args(self):
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
options.append('-DCMAKE_CUDA_ARCHITECTURES={0}'.format(cuda_arch[0]))
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))