From a6ce000e09608749bae46df90aa268a8e8282f50 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 28 Jun 2021 00:09:01 -0700 Subject: [PATCH] RAJA + Umpire: CUDA Arch fixes (#24531) --- var/spack/repos/builtin/packages/raja/package.py | 10 +++++++--- var/spack/repos/builtin/packages/umpire/package.py | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/raja/package.py b/var/spack/repos/builtin/packages/raja/package.py index 3603d4ad4c..9d3cb56f52 100644 --- a/var/spack/repos/builtin/packages/raja/package.py +++ b/var/spack/repos/builtin/packages/raja/package.py @@ -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') diff --git a/var/spack/repos/builtin/packages/umpire/package.py b/var/spack/repos/builtin/packages/umpire/package.py index 7fa2cf4e48..a957368700 100644 --- a/var/spack/repos/builtin/packages/umpire/package.py +++ b/var/spack/repos/builtin/packages/umpire/package.py @@ -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))