RAJA + Umpire: CUDA Arch fixes (#24531)

This commit is contained in:
Chris White 2021-06-28 00:09:01 -07:00 committed by GitHub
parent 3e65828a7e
commit a6ce000e09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -40,15 +40,18 @@ class Raja(CMakePackage, CudaPackage, ROCmPackage):
depends_on('blt@0.4.0:', type='build', when='@0.13.1:')
depends_on('blt@:0.3.6', type='build', when='@:0.13.0')
depends_on('camp')
depends_on('camp+cuda', when='+cuda')
# variants +rocm and amdgpu_targets are not automatically passed to
# dependencies, so do it manually.
depends_on('camp+rocm', when='+rocm')
for val in ROCmPackage.amdgpu_targets:
depends_on('camp amdgpu_target=%s' % val, when='amdgpu_target=%s' % val)
depends_on('camp')
depends_on('camp+cuda', when='+cuda')
for sm_ in CudaPackage.cuda_arch_values:
depends_on('camp cuda_arch={0}'.format(sm_),
when='cuda_arch={0}'.format(sm_))
conflicts('+openmp', when='+rocm')
def cmake_args(self):
@ -68,6 +71,7 @@ def cmake_args(self):
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
options.append('-DCMAKE_CUDA_ARCHITECTURES={0}'.format(cuda_arch[0]))
else:
options.append('-DENABLE_CUDA=OFF')

View file

@ -74,6 +74,10 @@ class Umpire(CMakePackage, CudaPackage, ROCmPackage):
depends_on('camp amdgpu_target=%s' % val, when='amdgpu_target=%s' % val)
depends_on('camp')
depends_on('camp+cuda', when='+cuda')
for sm_ in CudaPackage.cuda_arch_values:
depends_on('camp cuda_arch={0}'.format(sm_),
when='cuda_arch={0}'.format(sm_))
conflicts('+numa', when='@:0.3.2')
conflicts('~c', when='+fortran', msg='Fortran API requires C API')
@ -97,6 +101,7 @@ def cmake_args(self):
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
options.append('-DCMAKE_CUDA_ARCHITECTURES={0}'.format(cuda_arch[0]))
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))