diff options
author | Mosè Giordano <giordano@users.noreply.github.com> | 2024-01-29 15:20:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 08:20:32 -0700 |
commit | 0a10ff70bcec9d3eac11e64ed672b1d02c69f603 (patch) | |
tree | b7972f5b071dd40f000701429a4ec4122c0daa5e /var | |
parent | 0718e3459abf4153ec1ad30eff81dd553e191854 (diff) | |
download | spack-0a10ff70bcec9d3eac11e64ed672b1d02c69f603.tar.gz spack-0a10ff70bcec9d3eac11e64ed672b1d02c69f603.tar.bz2 spack-0a10ff70bcec9d3eac11e64ed672b1d02c69f603.tar.xz spack-0a10ff70bcec9d3eac11e64ed672b1d02c69f603.zip |
openblas: use `ARMV8SVE` when target supports SVE feature (#42107)
Diffstat (limited to 'var')
-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 c561cd8ef8..5e1a6f2b8e 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -333,6 +333,16 @@ class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Get our build microarchitecture microarch = self.spec.target + # We need to detect whether the target supports SVE before the magic for + # loop below which would change the value of `microarch`. + has_sve = ( + self.spec.satisfies("@0.3.19:") + and microarch.family == "aarch64" + and "sve" in microarch + # Exclude A64FX, which has its own special handling in OpenBLAS. + and microarch.name != "a64fx" + ) + # List of arguments returned by this function args = [] @@ -368,7 +378,14 @@ class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): arch_name = openblas_arch_map.get(arch_name, arch_name) args.append("ARCH=" + arch_name) - if microarch.vendor == "generic" and microarch.name != "riscv64": + if has_sve: + # Check this before testing the value of `microarch`, which may have + # been altered by the magic for loop above. If SVE is available + # (but target isn't A64FX which is treated specially below), use the + # `ARMV8SVE` OpenBLAS target. + args.append("TARGET=ARMV8SVE") + + elif microarch.vendor == "generic" and microarch.name != "riscv64": # User requested a generic platform, or we couldn't find a good # match for the requested one. Allow OpenBLAS to determine # an optimized kernel at run time, including older CPUs, while |