aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykola Hohsadze <koliagogsadze@gmail.com>2023-09-14 11:22:16 +0300
committerGitHub <noreply@github.com>2023-09-14 10:22:16 +0200
commit312e990c6f86f5da0c83a5ffd5aae405947c6549 (patch)
tree87b3fb0c674a8c04c2178b2f487dbe651bf6cb3d
parent688decfc802e006d6988446970892dcd37e5d151 (diff)
downloadcpu_features-312e990c6f86f5da0c83a5ffd5aae405947c6549.tar.gz
Add Intel AMX-FP16 detection (#332)
-rw-r--r--include/cpuinfo_x86.h2
-rw-r--r--src/impl_x86__base_implementation.inl2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/cpuinfo_x86.h b/include/cpuinfo_x86.h
index 6f24e4b..796d3f3 100644
--- a/include/cpuinfo_x86.h
+++ b/include/cpuinfo_x86.h
@@ -86,6 +86,7 @@ typedef struct {
int amx_bf16 : 1;
int amx_tile : 1;
int amx_int8 : 1;
+ int amx_fp16 : 1;
int pclmulqdq : 1;
int smx : 1;
@@ -254,6 +255,7 @@ typedef enum {
X86_AMX_BF16,
X86_AMX_TILE,
X86_AMX_INT8,
+ X86_AMX_FP16,
X86_PCLMULQDQ,
X86_SMX,
X86_SGX,
diff --git a/src/impl_x86__base_implementation.inl b/src/impl_x86__base_implementation.inl
index 11b2246..dfff46c 100644
--- a/src/impl_x86__base_implementation.inl
+++ b/src/impl_x86__base_implementation.inl
@@ -450,6 +450,7 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
features->amx_bf16 = IsBitSet(leaf_7.edx, 22);
features->amx_tile = IsBitSet(leaf_7.edx, 24);
features->amx_int8 = IsBitSet(leaf_7.edx, 25);
+ features->amx_fp16 = IsBitSet(leaf_7_1.eax, 21);
}
} else {
// When XCR0 is not available (Atom based or older cpus) we need to defer to
@@ -1976,6 +1977,7 @@ CacheInfo GetX86CacheInfo(void) {
LINE(X86_AMX_BF16, amx_bf16, , , ) \
LINE(X86_AMX_TILE, amx_tile, , , ) \
LINE(X86_AMX_INT8, amx_int8, , , ) \
+ LINE(X86_AMX_FP16, amx_fp16, , , ) \
LINE(X86_PCLMULQDQ, pclmulqdq, , , ) \
LINE(X86_SMX, smx, , , ) \
LINE(X86_SGX, sgx, , , ) \