diff options
author | Janne Blomqvist <janne.blomqvist@aalto.fi> | 2019-02-26 14:09:21 +0200 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2019-04-20 16:43:11 -0700 |
commit | 5fb6145f6f058776c26b5792a45ecdb5ee998464 (patch) | |
tree | 0f66e31896420e0fc1d43571cb086ebe4572b710 | |
parent | 7255d5ee3c980a95dc1690df8b292e0252f29845 (diff) | |
download | spack-5fb6145f6f058776c26b5792a45ecdb5ee998464.tar.gz spack-5fb6145f6f058776c26b5792a45ecdb5ee998464.tar.bz2 spack-5fb6145f6f058776c26b5792a45ecdb5ee998464.tar.xz spack-5fb6145f6f058776c26b5792a45ecdb5ee998464.zip |
OpenBLAS: Allow enabling/disabling AVX2/512 support
Allow specifying whether AVX2 or AVX512 should be enabled or disabled
on x86 targets.
As AVX2 hardware and toolchain support is quite ubiquitous by now,
AVX2 is enabled by default. Also AVX2 support is not disabled when
building the +virtual_machine variant.
AVX512 is not supported in older but still supported toolchains,
hardware is still expensive, and OpenBLAS AVX512 kernels still have
bugs. Thus AVX512 is disabled by default.
-rw-r--r-- | var/spack/repos/builtin/packages/openblas/package.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index b3a64a6af7..df9145b29a 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -56,6 +56,18 @@ class Openblas(MakefilePackage): description="Adding options to build openblas on Linux virtual machine" ) + variant( + 'avx2', + default=True, + description='Enable use of AVX2 instructions' + ) + + variant( + 'avx512', + default=False, + description='Enable use of AVX512 instructions' + ) + # virtual dependency provides('blas') provides('lapack') @@ -147,7 +159,6 @@ class Openblas(MakefilePackage): if self.spec.variants['virtual_machine'].value: make_defs += [ 'DYNAMIC_ARCH=1', - 'NO_AVX2=1', 'NUM_THREADS=64', # OpenBLAS stores present no of CPUs as max ] @@ -185,6 +196,12 @@ class Openblas(MakefilePackage): if '+ilp64' in self.spec: make_defs += ['INTERFACE64=1'] + if 'x86' in spack.architecture.sys_type(): + if '~avx2' in self.spec: + make_defs += ['NO_AVX2=1'] + if '~avx512' in self.spec: + make_defs += ['NO_AVX512=1'] + return make_defs @property |