summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authort-karatsu <49965247+t-karatsu@users.noreply.github.com>2019-11-20 16:01:12 +0900
committerGreg Becker <becker33@llnl.gov>2019-11-20 00:01:12 -0700
commit513fe55fc36b02ad2598bd5fd913964ec64b1eef (patch)
tree0898a04dbe5da0c56ada7daf54e46774c96445e0 /lib
parentf25a4ab089fc84d88d4bbd2180f1ed0e43c6f096 (diff)
downloadspack-513fe55fc36b02ad2598bd5fd913964ec64b1eef.tar.gz
spack-513fe55fc36b02ad2598bd5fd913964ec64b1eef.tar.bz2
spack-513fe55fc36b02ad2598bd5fd913964ec64b1eef.tar.xz
spack-513fe55fc36b02ad2598bd5fd913964ec64b1eef.zip
Features/expand microarch for aarch64 (#13780)
* Add process to determine aarch64 microarchitecture * add microarchitectures for thunderx2 and a64fx * Add optimize flags for gcc on aarch64 family processors thunderx2 and a64fx. * Add optimize flags for clang on aarch64 family processors thunderx2 and a64fx * Add testing for thunderx2 and a64fx microarchitectures
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/cpu/detect.py12
-rw-r--r--lib/spack/llnl/util/cpu/microarchitectures.json91
-rw-r--r--lib/spack/spack/test/data/targets/linux-centos7-thunderx28
-rw-r--r--lib/spack/spack/test/llnl/util/cpu.py6
4 files changed, 117 insertions, 0 deletions
diff --git a/lib/spack/llnl/util/cpu/detect.py b/lib/spack/llnl/util/cpu/detect.py
index c89f67c852..4c34a5cc73 100644
--- a/lib/spack/llnl/util/cpu/detect.py
+++ b/lib/spack/llnl/util/cpu/detect.py
@@ -223,3 +223,15 @@ def compatibility_check_for_x86_64(info, target):
return (target == arch_root or arch_root in target.ancestors) \
and (target.vendor == vendor or target.vendor == 'generic') \
and target.features.issubset(features)
+
+
+@compatibility_check(architecture_family='aarch64')
+def compatibility_check_for_aarch64(info, target):
+ basename = 'aarch64'
+ features = set(info.get('Features', '').split())
+ vendor = info.get('CPU implementer', 'generic')
+
+ arch_root = targets[basename]
+ return (target == arch_root or arch_root in target.ancestors) \
+ and (target.vendor == vendor or target.vendor == 'generic') \
+ and target.features.issubset(features)
diff --git a/lib/spack/llnl/util/cpu/microarchitectures.json b/lib/spack/llnl/util/cpu/microarchitectures.json
index bb3b4db21a..87afc8f27d 100644
--- a/lib/spack/llnl/util/cpu/microarchitectures.json
+++ b/lib/spack/llnl/util/cpu/microarchitectures.json
@@ -1161,6 +1161,97 @@
}
}
},
+ "thunderx2": {
+ "from": "aarch64",
+ "vendor": "0x43",
+ "features": [
+ "fp",
+ "asimd",
+ "evtstrm",
+ "aes",
+ "pmull",
+ "sha1",
+ "sha2",
+ "crc32",
+ "atomics",
+ "cpuid",
+ "asimdrdm"
+ ],
+ "compilers": {
+ "gcc": [
+ {
+ "versions": "4.8:4.8.9",
+ "flags": "-march=armv8-a"
+ },
+ {
+ "versions": "4.9:5.9",
+ "flags": "-march=armv8-a+crc+crypto"
+ },
+ {
+ "versions": "6:6.9",
+ "flags": "-march=armv8.1-a+crc+crypto"
+ },
+ {
+ "versions": "7:",
+ "flags": "-mcpu=thunderx2t99"
+ }
+ ],
+ "clang": {
+ "versions": ":",
+ "flags": "-march=armv8-a -mcpu=generic"
+ }
+ }
+ },
+ "a64fx": {
+ "from": "aarch64",
+ "vendor": "0x46",
+ "features": [
+ "fp",
+ "asimd",
+ "evtstrm",
+ "aes",
+ "pmull",
+ "sha1",
+ "sha2",
+ "crc32",
+ "atomics",
+ "cpuid",
+ "asimdrdm",
+ "fphp",
+ "asimdhp",
+ "fcma",
+ "dcpop",
+ "sve"
+ ],
+ "compilers": {
+ "gcc": [
+ {
+ "versions": "4.8:4.8.9",
+ "flags": "-march=armv8-a"
+ },
+ {
+ "versions": "4.9:5.9",
+ "flags": "-march=armv8-a+crc+crypto"
+ },
+ {
+ "versions": "6:6.9",
+ "flags": "-march=armv8.1-a+crc+crypto"
+ },
+ {
+ "versions": "7:7.9",
+ "flags": "-arch=armv8.2a+crc+crypt+fp16"
+ },
+ {
+ "versions": "8:",
+ "flags": "-arch=armv8.2a+crc+aes+sh2+fp16+sve -msve-vector-bits=512"
+ }
+ ],
+ "clang": {
+ "versions": ":",
+ "flags": "-march=armv8-a -mcpu=generic"
+ }
+ }
+ },
"arm": {
"from": null,
"vendor": "generic",
diff --git a/lib/spack/spack/test/data/targets/linux-centos7-thunderx2 b/lib/spack/spack/test/data/targets/linux-centos7-thunderx2
new file mode 100644
index 0000000000..2447306bac
--- /dev/null
+++ b/lib/spack/spack/test/data/targets/linux-centos7-thunderx2
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 400.00
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
+CPU implementer : 0x43
+CPU architecture: 8
+CPU variant : 0x1
+CPU part : 0x0af
+CPU revision : 1
diff --git a/lib/spack/spack/test/llnl/util/cpu.py b/lib/spack/spack/test/llnl/util/cpu.py
index f75c02f4b0..87681aadfa 100644
--- a/lib/spack/spack/test/llnl/util/cpu.py
+++ b/lib/spack/spack/test/llnl/util/cpu.py
@@ -32,6 +32,7 @@ from llnl.util.cpu import Microarchitecture # noqa
'linux-scientific7-piledriver',
'linux-rhel6-piledriver',
'linux-centos7-power8le',
+ 'linux-centos7-thunderx2',
'darwin-mojave-ivybridge',
'darwin-mojave-haswell',
'darwin-mojave-skylake',
@@ -121,6 +122,8 @@ def test_equality(supported_target):
('piledriver <= steamroller', True),
('zen2 >= zen', True),
('zen >= zen', True),
+ ('aarch64 <= thunderx2', True),
+ ('aarch64 <= a64fx', True),
# Test unrelated microarchitectures
('power8 < skylake', False),
('power8 <= skylake', False),
@@ -205,12 +208,15 @@ def test_target_json_schema():
('nehalem', 'gcc', '4.9.3', '-march=nehalem -mtune=nehalem'),
('nehalem', 'gcc', '4.8.5', '-march=corei7 -mtune=corei7'),
('sandybridge', 'gcc', '4.8.5', '-march=corei7-avx -mtune=corei7-avx'),
+ ('thunderx2', 'gcc', '4.8.5', '-march=armv8-a'),
+ ('thunderx2', 'gcc', '4.9.3', '-march=armv8-a+crc+crypto'),
# Test Clang / LLVM
('sandybridge', 'clang', '3.9.0', '-march=x86-64 -mcpu=sandybridge'),
('icelake', 'clang', '6.0.0', '-march=x86-64 -mcpu=icelake'),
('icelake', 'clang', '8.0.0', '-march=x86-64 -mcpu=icelake-client'),
('zen2', 'clang', '9.0.0', '-march=x86-64 -mcpu=znver2'),
('power9le', 'clang', '8.0.0', '-march=ppc64le -mcpu=pwr9'),
+ ('thunderx2', 'clang', '6.0.0', '-march=armv8-a -mcpu=generic'),
# Test Intel on Intel CPUs
('sandybridge', 'intel', '17.0.2', '-march=corei7-avx -mtune=corei7-avx'),
('sandybridge', 'intel', '18.0.5',