add detection of CPX 5300 w/ 2FMAs
authorArtem Zhmurov <zhmurov@gmail.com>
Mon, 28 Sep 2020 06:00:40 +0000 (06:00 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 28 Sep 2020 06:00:40 +0000 (06:00 +0000)
Signed-off-by: Hammond, Jeff R <jeff.r.hammond@intel.com>
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/cpuinfo.h

index 4a64cbc34f419f10ad1e016e52338c967f8e0a6c..51d8cc7d961c8f443900c33b54b4a95d0242dde6 100644 (file)
@@ -275,10 +275,11 @@ bool detectProcCpuInfoSecondAvx512FMA(const std::string& brand, int model)
             {
                 return false;
             }
-            // detect Gold 5120 and below
+            // detect Gold 5xxx - can be corrected once Cooper Lake is added
             else if (brand.find("Gold") == 17 && brand.find('5') == 22)
             {
-                return (brand.find("22") == 24);
+                return (brand.find("53") == 22 || // detect Cooper Lake
+                        brand.find("22") == 24);  // detect 5[12]22
             }
         }
         return true;
@@ -439,6 +440,9 @@ void detectX86Features(std::string* brand, int* family, int* model, int* steppin
         setFeatureFromBit(features, CpuInfo::Feature::X86_Avx512BW, ebx, 30);
         setFeatureFromBit(features, CpuInfo::Feature::X86_Avx512VL, ebx, 31);
 
+        executeX86CpuID(0x7, 0x1, &eax, &ebx, &ecx, &edx);
+        setFeatureFromBit(features, CpuInfo::Feature::X86_Avx512BF16, eax, 5);
+
         if (features->count(CpuInfo::Feature::X86_Avx512F) != 0)
         {
             // Only checking if the CPU supports AVX-512. There is no CPUID bit for this.
@@ -1106,6 +1110,7 @@ const std::string& CpuInfo::featureString(Feature f)
         { Feature::X86_Avx512CD, "avx512cd" },
         { Feature::X86_Avx512BW, "avx512bw" },
         { Feature::X86_Avx512VL, "avx512vl" },
+        { Feature::X86_Avx512BF16, "avx512bf16" },
         { Feature::X86_Avx512secondFMA, "avx512secondFMA" },
         { Feature::X86_Clfsh, "clfsh" },
         { Feature::X86_Cmov, "cmov" },
index c4dc6a5bbe30d39dc357dfd6493ac869e6a3791e..bd2ac5bc0dc8e5b4f397a3598a7d7336e907734e 100644 (file)
@@ -108,6 +108,7 @@ public:
         X86_Avx512CD,        //!< Memory conflict-detection for AVX-512
         X86_Avx512BW,        //!< AVX-512 byte and word instructions
         X86_Avx512VL,        //!< AVX-512 vector length extensions
+        X86_Avx512BF16,      //!< AVX-512 BFloat16 instructions
         X86_Avx512secondFMA, //!< AVX-512 second FMA unit
         X86_Clfsh,           //!< Supports CLFLUSH instruction
         X86_Cmov,            //!< Conditional move insn support