hiop: add version v0.5.4 (#29301)

* Add HiOp v0.5.4, update magma constraint

* Add v2.6.2rc1 to magma, make hiop depend on it

* Update var/spack/repos/builtin/packages/hiop/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Asher Mancinelli 2022-03-04 12:52:23 -07:00 committed by GitHub
parent d42e5421dc
commit 4081597731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 18 deletions

View file

@ -18,6 +18,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage):
maintainers = ['ashermancinelli', 'CameronRutherford']
# Most recent tagged snapshot is the preferred version when profiling.
version('0.5.4', commit='a37a7a677884e95d1c0ad37936aef3778fc91c3e')
version('0.5.3', commit='698e8d0fdc0ff9975d8714339ff8c782b70d85f9')
version('0.5.2', commit='662ad76dee1f501f648a8bec9a490cb5881789e9')
version('0.5.1', commit='6789bbb55824e68e428c2df1009d647af81f9cf1')
@ -64,10 +65,16 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage):
depends_on('magma+cuda', when='+cuda')
depends_on('magma+rocm', when='+rocm')
depends_on('magma@2.5.4:', when='@0.4:+cuda')
depends_on('magma@2.6.1:', when='@0.4.6:+cuda')
depends_on('magma@2.5.4:', when='@0.4:+rocm')
depends_on('magma@2.6.1:', when='@0.4.6:+rocm')
# Depends on Magma when +rocm or +cuda
magma_ver_constraints = (
('2.5.4', '0.4'),
('2.6.1', '0.4.6'),
('2.6.2', '0.5.4'),
)
for (magma_v, hiop_v) in magma_ver_constraints:
depends_on('magma@{0}:'.format(magma_v), when='@{0}:+cuda'.format(hiop_v))
depends_on('magma@{0}:'.format(magma_v), when='@{0}:+rocm'.format(hiop_v))
depends_on('raja+openmp', when='+raja')
depends_on('raja@0.14.0:', when='@0.5.0:+raja')

View file

@ -23,7 +23,8 @@ class Magma(CMakePackage, CudaPackage, ROCmPackage):
test_requires_compiler = True
version('master', branch='master')
version('2.6.1', sha256='6cd83808c6e8bc7a44028e05112b3ab4e579bcc73202ed14733f66661127e213')
version('2.6.2rc1', commit='5959b8783e45f1809812ed96ae762f38ee701972')
version('2.6.1', sha256='6cd83808c6e8bc7a44028e05112b3ab4e579bcc73202ed14733f66661127e213', preferred=True)
version('2.6.0', sha256='50cdd384f44f06a34469e7125f8b2ffae13c1975d373c3f1510d91be2b7638ec')
version('2.5.4', sha256='7734fb417ae0c367b418dea15096aef2e278a423e527c615aab47f0683683b67')
version('2.5.3', sha256='c602d269a9f9a3df28f6a4f593be819abb12ed3fa413bba1ff8183de721c5ef6')
@ -76,19 +77,31 @@ class Magma(CMakePackage, CudaPackage, ROCmPackage):
patch('cmake-W.patch', when='@2.5.0:%nvhpc')
@run_before('cmake')
def generate_cuda(self):
if '@master' in self.spec:
backend = 'cuda'
cuda_arch = self.spec.variants['cuda_arch'].value
gpu_target = ' '.join('sm_{0}'.format(i) for i in cuda_arch)
if '+rocm' in self.spec:
backend = 'hip'
gpu_target = self.spec.variants['amdgpu_target'].value
with open('make.inc', 'w') as inc:
inc.write('FORT = true\n')
inc.write('GPU_TARGET = %s\n' % gpu_target)
inc.write('BACKEND = %s\n' % backend)
make('generate')
def generate_gpu_config(self):
"""If not an official release, a generation step is required to build"""
spec = self.spec
# 2.6.2rc1 is not an official release
should_generate = ('@master' in spec) or ('@2.6.2rc1' in spec)
if not should_generate:
return
backend = 'cuda' if '+cuda' in spec else 'hip'
gpu_target = ''
if '+cuda' in spec:
cuda_archs = spec.variants['cuda_arch'].value
gpu_target = ' '.join('sm_{0}'.format(i) for i in cuda_archs)
else:
gpu_target = spec.variants['amdgpu_target'].value
with open('make.inc', 'w') as inc:
inc.write('FORT = true\n')
inc.write('GPU_TARGET = {0}\n'.format(gpu_target))
inc.write('BACKEND = {0}\n'.format(backend))
make('generate')
def cmake_args(self):
spec = self.spec