Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pytorch/cpuinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@google.com>2022-07-12 23:23:27 +0300
committerGitHub <noreply@github.com>2022-07-12 23:23:27 +0300
commit53298db833c5c5a1598639e9b47cc1a602bbac26 (patch)
tree96e51e68648633d4635c882087d060a2121bfe21 /src
parent9d65bfa0e392766c3d8d66c6d56f0a1c54e4e087 (diff)
Cleanup detection of ARM BF16 extension (#98)
- Remove unneeded svebf16 extension flag, instead use the Linux feature flag to detect bf16 extension - Group fp16 arith and bf16 together with other floating-point extensions - Rename cpuinfo_has_arm_svebf16 to cpuinfo_has_arm_sve_bf16 - Add cpuinfo_has_arm_neon_bf16 API
Diffstat (limited to 'src')
-rw-r--r--src/arm/linux/aarch64-isa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arm/linux/aarch64-isa.c b/src/arm/linux/aarch64-isa.c
index 7b18095..4090d10 100644
--- a/src/arm/linux/aarch64-isa.c
+++ b/src/arm/linux/aarch64-isa.c
@@ -130,10 +130,10 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SVE2) {
isa->sve2 = true;
}
- if (features2 & CPUINFO_ARM_LINUX_FEATURE2_BF16) {
+ // SVEBF16 is set iff SVE and BF16 are both supported, but the SVEBF16 feature flag
+ // was added in Linux kernel before the BF16 feature flag, so we check for either.
+ if (features2 & (CPUINFO_ARM_LINUX_FEATURE2_BF16 | CPUINFO_ARM_LINUX_FEATURE2_SVEBF16)) {
isa->bf16 = true;
}
- if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SVEBF16) {
- isa->svebf16 = true;
- }
}
+