1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 15:12:30 +02:00

Add Intel AMX-FP16 detection (#332)

This commit is contained in:
Mykola Hohsadze 2023-09-14 11:22:16 +03:00 committed by GitHub
parent 688decfc80
commit 312e990c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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,

View File

@ -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, , , ) \