summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2021-02-11 10:41:46 -0500
committerGitHub <noreply@github.com>2021-02-11 15:41:46 +0000
commit7f003a77dd38f76e34ed7fa63d4de6a46471f1b7 (patch)
treef2525baa1f24c9af9f5953b93bc8233722ff9c01
parent3268cf4b96c75fa6b60c7958045e4c761d3675cc (diff)
downloadspack-7f003a77dd38f76e34ed7fa63d4de6a46471f1b7.tar.gz
spack-7f003a77dd38f76e34ed7fa63d4de6a46471f1b7.tar.bz2
spack-7f003a77dd38f76e34ed7fa63d4de6a46471f1b7.tar.xz
spack-7f003a77dd38f76e34ed7fa63d4de6a46471f1b7.zip
nsimd: add v2.1 (#21623)
Updated variants and conflicts accordingly
-rw-r--r--var/spack/repos/builtin/packages/nsimd/package.py60
1 files changed, 45 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/nsimd/package.py b/var/spack/repos/builtin/packages/nsimd/package.py
index 24c763f461..a285fccd46 100644
--- a/var/spack/repos/builtin/packages/nsimd/package.py
+++ b/var/spack/repos/builtin/packages/nsimd/package.py
@@ -12,6 +12,9 @@ class Nsimd(CMakePackage):
maintainers = ['eschnett']
+ version('2.1', sha256='3274f1061d1fac170130b8c75378a6b94580629b3dc1d53db244b51500ee4695')
+ # Version 2.0 is disabled since it does not support cmake
+ # version('2.0', sha256='b239e98316f93257161b25c8232634884edcee358982a74742981cc9b68da642')
version('1.0', sha256='523dae83f1d93eab30114321f1c9a67e2006a52595da4c51f121ca139abe0857')
variant('simd',
@@ -21,17 +24,40 @@ class Nsimd(CMakePackage):
'none',
'CPU',
'SSE2', 'SSE42', 'AVX', 'AVX2', 'AVX512_KNL', 'AVX512_SKYLAKE',
- 'NEON128', 'AARCH64', 'SVE',
+ 'NEON128', 'AARCH64',
+ 'SVE', 'SVE128', 'SVE256', 'SVE512', 'SVE1024', 'SVE2048',
+ 'CUDA', 'ROCM',
),
multi=False)
variant('optionals', values=any_combination_of('FMA', 'FP16'),
description='Optional SIMD features',)
conflicts('simd=none', msg="SIMD instruction set not defined")
+ conflicts('simd=SVE128', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=SVE256', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=SVE512', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=SVE1024', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=SVE2048', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=CUDA', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('simd=ROCM', when=('@:1'),
+ msg="SIMD extension not available in version @:1")
+ conflicts('optionals=FMA', when=('@2:'),
+ msg="SIMD optionals not available in version @2:")
+ conflicts('optionals=FP16', when=('@2:'),
+ msg="SIMD optionals not available in version @2:")
+ conflicts('optionals=FMA,FP16', when=('@2:'),
+ msg="SIMD optionals not available in version @2:")
# Requires a C++14 compiler for building.
# The C++ interface requires a C++11 compiler to use.
depends_on('cmake@2.8.7:', type='build')
+ depends_on('cmake@3.0.2:', type='build', when='@2:')
depends_on('python@3:', type='build')
# Add a 'generate_code' phase in the beginning
@@ -39,24 +65,28 @@ class Nsimd(CMakePackage):
def generate_code(self, spec, prefix):
"""Auto-generates code in the build directory"""
- options = [
- 'egg/hatch.py',
- '--all',
- '--force',
- '--disable-clang-format',
- ]
- python = spec['python'].command
- python(*options)
+ if self.spec.satisfies("@:1"):
+ options = [
+ 'egg/hatch.py',
+ '--all',
+ '--force',
+ ]
+ python = spec['python'].command
+ python(*options)
def cmake_args(self):
# Required SIMD argument
simd = self.spec.variants['simd'].value
- cmake_args = ["-DSIMD={0}".format(simd)]
+ if self.spec.satisfies("@:1"):
+ cmake_args = ["-DSIMD={0}".format(simd)]
+ else:
+ cmake_args = ["-Dsimd={0}".format(simd)]
- # Optional SIMD instructions to be turned on explicitly
- optionals_value = self.spec.variants['optionals'].value
- if optionals_value != 'none':
- optionals_arg = ';'.join(optionals_value)
- cmake_args.append("-DSIMD_OPTIONALS={0}".format(optionals_arg))
+ if self.spec.satisfies("@:1"):
+ # Optional SIMD instructions to be turned on explicitly
+ optionals_value = self.spec.variants['optionals'].value
+ if optionals_value != 'none':
+ optionals_arg = ';'.join(optionals_value)
+ cmake_args.append("-DSIMD_OPTIONALS={0}".format(optionals_arg))
return cmake_args