Trilinos: Add UVM variant (#28949)

13.2+ still supports UVM as an option.
This commit is contained in:
psakievich 2022-02-16 05:29:49 -07:00 committed by GitHub
parent 5cd8fc37ba
commit e6ea4c788a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,8 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage):
variant('openmp', default=False, description='Enable OpenMP')
variant('python', default=False, description='Build PyTrilinos wrappers')
variant('shared', default=True, description='Enables the build of shared libraries')
variant('wrapper', default=False, description="Use nvcc-wrapper for CUDA build")
variant('uvm', default=False, when='@13.2: +cuda', description='Turn on UVM for CUDA build')
variant('wrapper', default=False, description='Use nvcc-wrapper for CUDA build')
# TPLs (alphabet order)
variant('adios2', default=False, description='Enable ADIOS2')
@ -285,6 +286,9 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage):
conflicts('@:13.0.1 +cuda', when='^cuda@11:')
# Build hangs with CUDA 11.6 (see #28439)
conflicts('+cuda +stokhos', when='^cuda@11.6:')
# Cuda UVM must be enabled prior to 13.2
# See https://github.com/spack/spack/issues/28869
conflicts('~uvm', when='@:13.1 +cuda')
# stokhos fails on xl/xl_r
conflicts('+stokhos', when='%xl')
@ -736,8 +740,7 @@ def define_tpl(trilinos_name, spack_name, have_dep):
else 'OpenMP'),
])
if '+cuda' in spec:
# See https://github.com/spack/spack/issues/28869
use_uvm = (spec.version < Version(13.2))
use_uvm = '+uvm' in spec
options.extend([
define_kok_enable('CUDA_UVM', use_uvm),
define_kok_enable('CUDA_LAMBDA', True),