slate: add v2021.05.01 (#23612)

Adds a new release version for SLATE and includes 
HIP/ROCm backend support. Now can build with either 
CUDA or ROCm support.
This commit is contained in:
G-Ragghianti 2021-05-13 04:32:31 -04:00 committed by GitHub
parent f8740c8c75
commit 8a40a3a70f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
from spack import * from spack import *
class Slate(CMakePackage): class Slate(CMakePackage, CudaPackage, ROCmPackage):
"""The Software for Linear Algebra Targeting Exascale (SLATE) project is """The Software for Linear Algebra Targeting Exascale (SLATE) project is
to provide fundamental dense linear algebra capabilities to the US to provide fundamental dense linear algebra capabilities to the US
Department of Energy and to the high-performance computing (HPC) community Department of Energy and to the high-performance computing (HPC) community
@ -21,20 +21,22 @@ class Slate(CMakePackage):
maintainers = ['G-Ragghianti', 'mgates3'] maintainers = ['G-Ragghianti', 'mgates3']
version('master', branch='master') version('master', branch='master')
version('2021.05.01', sha256='d9db2595f305eb5b1b49a77cc8e8c8e43c3faab94ed910d8387c221183654218')
version('2020.10.00', sha256='ff58840cdbae2991d100dfbaf3ef2f133fc2f43fc05f207dc5e38a41137882ab') version('2020.10.00', sha256='ff58840cdbae2991d100dfbaf3ef2f133fc2f43fc05f207dc5e38a41137882ab')
variant('cuda', default=False, description='Build with CUDA support.') variant('mpi', default=True, description='Build with MPI support (without MPI is experimental).')
variant('mpi', default=True, description='Build with MPI support.')
variant('openmp', default=True, description='Build with OpenMP support.') variant('openmp', default=True, description='Build with OpenMP support.')
variant('shared', default=True, description='Build shared library') variant('shared', default=True, description='Build shared library')
depends_on('cuda', when='+cuda')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
depends_on('blas') depends_on('blas')
depends_on('blaspp ~cuda', when='~cuda') depends_on('blaspp ~cuda', when='~cuda')
depends_on('blaspp +cuda', when='+cuda') depends_on('blaspp +cuda', when='+cuda')
depends_on('lapackpp') depends_on('blaspp ~rocm', when='~rocm')
depends_on('lapackpp@2020.10.02:', when='@2020.10.00') for val in ROCmPackage.amdgpu_targets:
depends_on('blaspp +rocm amdgpu_target=%s' % val, when='amdgpu_target=%s' % val)
depends_on('lapackpp@2021.04.00:', when='@2021.05.01:')
depends_on('lapackpp@2020.10.02', when='@2020.10.00')
depends_on('lapackpp@master', when='@master') depends_on('lapackpp@master', when='@master')
depends_on('scalapack') depends_on('scalapack')
@ -43,14 +45,25 @@ class Slate(CMakePackage):
conflicts('%xl', msg=cpp_17_msg) conflicts('%xl', msg=cpp_17_msg)
conflicts('%xl_r', msg=cpp_17_msg) conflicts('%xl_r', msg=cpp_17_msg)
conflicts('%intel@19:', msg='Does not currently build with icpc >= 2019') conflicts('%intel@19:', msg='Does not currently build with icpc >= 2019')
conflicts('+rocm', when='@:2020.10.00', msg='ROCm support requires SLATE 2021.05.01 or greater')
conflicts('+rocm', when='+cuda', msg='SLATE only supports one GPU backend at a time')
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
backend_config = '-Duse_cuda=%s' % ('+cuda' in spec)
if self.version >= Version('2021.05.01'):
backend = 'none'
if '+cuda' in spec:
backend = 'cuda'
if '+rocm' in spec:
backend = 'hip'
backend_config = '-Dgpu_backend=%s' % backend
return [ return [
'-Dbuild_tests=%s' % self.run_tests, '-Dbuild_tests=%s' % self.run_tests,
'-Duse_openmp=%s' % ('+openmp' in spec), '-Duse_openmp=%s' % ('+openmp' in spec),
'-DBUILD_SHARED_LIBS=%s' % ('+shared' in spec), '-DBUILD_SHARED_LIBS=%s' % ('+shared' in spec),
'-Duse_cuda=%s' % ('+cuda' in spec), backend_config,
'-Duse_mpi=%s' % ('+mpi' in spec), '-Duse_mpi=%s' % ('+mpi' in spec),
'-DSCALAPACK_LIBRARIES=%s' % spec['scalapack'].libs.joined(';') '-DSCALAPACK_LIBRARIES=%s' % spec['scalapack'].libs.joined(';')
] ]