raja: add awareness of the cuda architecture (#16377)

This commit is contained in:
Matt Larsen 2020-05-01 01:07:12 -07:00 committed by GitHub
parent 4f6c4743e3
commit 69a0fbd2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
from spack import *
class Raja(CMakePackage):
class Raja(CMakePackage, CudaPackage):
"""RAJA Parallel Framework."""
homepage = "http://software.llnl.gov/RAJA/"
@ -47,4 +47,9 @@ def cmake_args(self):
'-DENABLE_CUDA=On',
'-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)])
cuda_value = spec.variants['cuda_arch'].value
cuda_arch = cuda_value[0]
if cuda_arch is not None:
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch))
return options