From acf4dc2e12df65aab265a6f5a8374cf356b740bd Mon Sep 17 00:00:00 2001 From: Miroslav Stoyanov <30537612+mkstoyanov@users.noreply.github.com> Date: Tue, 22 Sep 2020 15:05:00 -0400 Subject: [PATCH] Heffte: add magma variant (#18849) --- .../repos/builtin/packages/heffte/package.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/var/spack/repos/builtin/packages/heffte/package.py b/var/spack/repos/builtin/packages/heffte/package.py index 45f9b1ee8c..0caabab239 100644 --- a/var/spack/repos/builtin/packages/heffte/package.py +++ b/var/spack/repos/builtin/packages/heffte/package.py @@ -26,27 +26,28 @@ class Heffte(CMakePackage): variant('fftw', default=False, description='Builds with support for FFTW backend') variant('mkl', default=False, description='Builds with support for MKL backend') variant('cuda', default=False, description='Builds with support for GPUs via CUDA') + variant('magma', default=False, description='Use helper methods from the UTK MAGMA library') conflicts('~fftw', when='~mkl~cuda') # requires at least one backend - conflicts('+fftw', when='+mkl') # old API supports at most one CPU backend + conflicts('+fftw', when='+mkl@:1.0') # old API supports at most one CPU backend conflicts('openmpi~cuda', when='+cuda') # +cuda requires CUDA enabled OpenMPI + conflicts('~cuda', when='+magma') # magma requires CUDA or HIP + conflicts('+magma', when="@:1.0") # magma support was added post v1.0 depends_on('mpi', type=('build', 'run')) depends_on('fftw@3.3.8:', when="+fftw", type=('build', 'run')) depends_on('intel@16.0:', when="+mkl", type=('build', 'run')) depends_on('cuda@8.0:', when="+cuda", type=('build', 'run')) + depends_on('magma@2.5.3:', when="+cuda+magma", type=('build', 'run')) def cmake_args(self): return [ - '-DBUILD_SHARED_LIBS={0:1s}'.format( - 'ON' if '+shared' in self.spec else 'OFF'), + self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), + self.define_from_variant('Heffte_ENABLE_CUDA', 'cuda'), + self.define_from_variant('Heffte_ENABLE_FFTW', 'fftw'), + self.define_from_variant('Heffte_ENABLE_MKL', 'mkl'), + self.define_from_variant('Heffte_ENABLE_MAGMA', 'magma'), '-DBUILD_GPU={0:1s}'.format( 'ON' if ('+cuda' in self.spec and - '+fftw' in self.spec) else 'OFF'), - '-DHeffte_ENABLE_CUDA={0:1s}'.format( - 'ON' if '+cuda' in self.spec else 'OFF'), - '-DHeffte_ENABLE_FFTW={0:1s}'.format( - 'ON' if '+fftw' in self.spec else 'OFF'), - '-DHeffte_ENABLE_MKL={0:1s}'.format( - 'ON' if '+mkl' in self.spec else 'OFF'), ] + '+fftw' in self.spec) else 'OFF'), ]