Heffte: add magma variant (#18849)

This commit is contained in:
Miroslav Stoyanov 2020-09-22 15:05:00 -04:00 committed by GitHub
parent a23d67f7ea
commit acf4dc2e12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,27 +26,28 @@ class Heffte(CMakePackage):
variant('fftw', default=False, description='Builds with support for FFTW backend') variant('fftw', default=False, description='Builds with support for FFTW backend')
variant('mkl', default=False, description='Builds with support for MKL 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('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~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('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('mpi', type=('build', 'run'))
depends_on('fftw@3.3.8:', when="+fftw", 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('intel@16.0:', when="+mkl", type=('build', 'run'))
depends_on('cuda@8.0:', when="+cuda", 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): def cmake_args(self):
return [ return [
'-DBUILD_SHARED_LIBS={0:1s}'.format( self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
'ON' if '+shared' in self.spec else 'OFF'), 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( '-DBUILD_GPU={0:1s}'.format(
'ON' if ('+cuda' in self.spec and 'ON' if ('+cuda' in self.spec and
'+fftw' in self.spec) else 'OFF'), '+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'), ]