From 36932a63d29caab431de88346b99764c395e5b0c Mon Sep 17 00:00:00 2001 From: Branislav Jansik <branislav.jansik@vsb.cz> Date: Fri, 14 Feb 2025 15:26:03 +0000 Subject: [PATCH] Update AMX functionality --- cpuid.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cpuid.c b/cpuid.c index 8ec6404..7a0899f 100644 --- a/cpuid.c +++ b/cpuid.c @@ -16,7 +16,7 @@ void cpuid(unsigned infoa, unsigned infoc, unsigned *eax, unsigned *ebx, unsigne } int main(void) { -unsigned eax, ebx, ecx, edx; +unsigned eax, ebx, ecx, edx, maxl; int off; #define LLEN 50 #define LNUM 50 @@ -27,6 +27,8 @@ char buf[LLEN*LNUM]; memset(buf,32,LLEN*LNUM); +cpuid(0,0,&maxl,&ebx,&ecx,&edx); + cpuid(0x80000001,0,&eax,&ebx,&ecx,&edx); BPRINT(0,0,"x86_64 : %d", (int) getbits(edx,29,1)); @@ -65,12 +67,18 @@ BPRINT(3,1, "AVX512-4fmaps : %d", (int) getbits(edx,3,1)); BPRINT(4,1, "AVX512vp2intersect : %d", (int) getbits(edx,8,1)); BPRINT(5,1, "AVX512fp16 : %d", (int) getbits(edx,23,1)); +BPRINT(12,1, "AMX-bf16 : %d", (int) getbits(edx,22,1)); +BPRINT(20,1, "AMX-tile : %d", (int) getbits(edx,24,1)); +BPRINT(11,1, "AMX-int8 : %d", (int) getbits(edx,25,1)); + cpuid(7,1,&eax,&ebx,&ecx,&edx); BPRINT(6,1, "AVX512bf16 : %d", (int) getbits(eax,5,1)); -cpuid(0x1E,1,&eax,&ebx,&ecx,&edx); -BPRINT(11,1,"AMX-int8 : %d", (int) getbits(eax,0,1)); -BPRINT(12,1,"AMX-bf16 : %d", (int) getbits(eax,1,1)); +if (maxl >= 0x1E) cpuid(0x1E,1,&eax,&ebx,&ecx,&edx); +else eax=0; + +//BPRINT(11,1,"AMX-int8 : %d", (int) getbits(eax,0,1)); +//BPRINT(12,1,"AMX-bf16 : %d", (int) getbits(eax,1,1)); BPRINT(13,1,"AMX-complex : %d", (int) getbits(eax,2,1)); BPRINT(14,1,"AMX-fp16 : %d", (int) getbits(eax,3,1)); BPRINT(15,1,"AMX-fp8 : %d", (int) getbits(eax,4,1)); -- GitLab