diff options
author | Toyohisa Kameyama <kameyama@riken.jp> | 2019-09-06 03:42:04 +0900 |
---|---|---|
committer | Greg Becker <becker33@llnl.gov> | 2019-09-05 11:42:04 -0700 |
commit | 34647913be0fcb7d1e204011c6a27321e565346a (patch) | |
tree | d647b5e5eb411edf0e905be25d7a0949d446257e /var | |
parent | 1dbf3c208bb50c1704b0372fcd55a91fb8a0a456 (diff) | |
download | spack-34647913be0fcb7d1e204011c6a27321e565346a.tar.gz spack-34647913be0fcb7d1e204011c6a27321e565346a.tar.bz2 spack-34647913be0fcb7d1e204011c6a27321e565346a.tar.xz spack-34647913be0fcb7d1e204011c6a27321e565346a.zip |
fftw: change default value of simd variant for other than x86_64 (#11627)
* Use spec.architecture.target insted of platform.
* remove default in simd variant value.
simd variant change to archtecture independent values.
* Add check simd values.
* rewrite check simd values.
* * flake8
* change aarch64 to arm (neon support only 32 bit arm.)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/fftw/package.py | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py index 709ad64af4..1f96bd88c3 100644 --- a/var/spack/repos/builtin/packages/fftw/package.py +++ b/var/spack/repos/builtin/packages/fftw/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +from spack.spec import ConflictsInSpecError import llnl.util.lang # os is used for rename, etc in patch() @@ -54,7 +55,7 @@ class Fftw(AutotoolsPackage): variant( 'simd', - default='sse2,avx,avx2', + default='generic-simd128,generic-simd256', values=( 'sse', 'sse2', 'avx', 'avx2', 'avx512', # Intel 'avx-128-fma', 'kcvi', # Intel @@ -77,6 +78,42 @@ class Fftw(AutotoolsPackage): provides('fftw-api@2', when='@2.1.5') provides('fftw-api@3', when='@3:') + def flag_handler(self, name, flags): + arch = "" + spec = self.spec + target_simds = { + ('x86_64',): ('sse', 'sse2', 'avx', 'avx2', 'avx512', + 'avx-128-fma', 'kcvi'), + ('ppc', 'ppc64le', 'power7'): ('altivec', 'vsx'), + ('arm',): ('neon',) + } + + if spec.satisfies("platform=cray"): + # FIXME; It is assumed that cray is x86_64. + # If you support arm on cray, you need to fix it. + arch = "x86_64" + + for targets, simds in target_simds.items(): + if ( + (arch not in targets) + and not any( + spec.satisfies('target={0}'.format(t)) for t in targets) + ): + if any(spec.satisfies('simd={0}'.format(x)) for x in simds): + raise ConflictsInSpecError( + spec, + [( + spec, + spec.architecture.target, + spec.variants['simd'], + 'simd={0} are valid only on {1}'.format( + ','.join(target_simds[targets]), + ','.join(targets) + ) + )] + ) + return (flags, None, None) + @property def libs(self): |