diff --git a/onnxruntime/core/platform/windows/hardware_core_enumerator.cc b/onnxruntime/core/platform/windows/hardware_core_enumerator.cc index add20f55ce109..7464ab4c57d01 100644 --- a/onnxruntime/core/platform/windows/hardware_core_enumerator.cc +++ b/onnxruntime/core/platform/windows/hardware_core_enumerator.cc @@ -84,36 +84,34 @@ uint32_t HardwareCoreEnumerator::DefaultIntraOpNumThreads() { // # of physical cores = # of P cores + # of E Cores + # of Soc Cores. // # of logical cores = # of P cores x 2 (if hyper threading is enabled) + # of E cores + # of Soc Cores. auto cores = GetCoreInfo(); - #if !defined(_M_ARM64EC) && !defined(_M_ARM64) && !defined(__aarch64__) +#if !defined(_M_ARM64EC) && !defined(_M_ARM64) && !defined(__aarch64__) const int kVendorID_Intel[3] = {0x756e6547, 0x6c65746e, 0x49656e69}; // "GenuntelineI" bool isIntelSpecifiedPlatform = false; - const int kVendorID_IntelSpecifiedPlatformIDs[3] = {//ExtendedModel,ExtendedFamily,Family Code, and Model Number - 0xa06a, //MTL - 0xc065, //ARL-H - 0xb065 //ARL-U - }; + const int kVendorID_IntelSpecifiedPlatformIDs[3] = { + // ExtendedModel, ExtendedFamily, Family Code, and Model Number + 0xa06a, // MTL + 0xc065, // ARL-H + 0xb065 // ARL-U + }; int regs_leaf0[4]; int regs_leaf1[4]; __cpuid(regs_leaf0, 0); __cpuid(regs_leaf1, 0x1); + auto isIntel = (kVendorID_Intel[0] == regs_leaf0[1]) && (kVendorID_Intel[1] == regs_leaf0[2]) && (kVendorID_Intel[2] == regs_leaf0[3]); - auto isIntel = (kVendorID_Intel[0] == regs_leaf0[1]) && (kVendorID_Intel[1] == regs_leaf0[2]) && - (kVendorID_Intel[2] == regs_leaf0[3]); - - for(int intelSpecifiedPlatform : kVendorID_IntelSpecifiedPlatformIDs){ - if ((regs_leaf1[0]>>4) == intelSpecifiedPlatform){ + for (int intelSpecifiedPlatform : kVendorID_IntelSpecifiedPlatformIDs) { + if ((regs_leaf1[0] >> 4) == intelSpecifiedPlatform) { isIntelSpecifiedPlatform = true; } } if (isIntel) { - if(isIntelSpecifiedPlatform){ - //We want to exclude cores without an LLC + if (isIntelSpecifiedPlatform) { + // We want to exclude cores without an LLC return cores.LLCCores; - } - else{ + } else { return cores.PhysicalCores; } } diff --git a/winml/lib/Api/HardwareCoreEnumerator.cpp b/winml/lib/Api/HardwareCoreEnumerator.cpp index d7d03feb6a290..f1272fc1b8626 100644 --- a/winml/lib/Api/HardwareCoreEnumerator.cpp +++ b/winml/lib/Api/HardwareCoreEnumerator.cpp @@ -86,26 +86,26 @@ uint32_t HardwareCoreEnumerator::DefaultIntraOpNumThreads() { // # of logical cores = # of P cores x 2 (if hyper threading is enabled) + # of E cores + # of Soc Cores. auto cores = GetCoreInfo(); - #if !defined(_M_ARM64EC) && !defined(_M_ARM64) && !defined(__aarch64__) +#if !defined(_M_ARM64EC) && !defined(_M_ARM64) && !defined(__aarch64__) const int kVendorID_Intel[3] = {0x756e6547, 0x6c65746e, 0x49656e69}; // "GenuntelineI" bool isIntelSpecifiedPlatform = false; - const int kVendorID_IntelSpecifiedPlatformIDs[3] = {//ExtendedModel,ExtendedFamily,Family Code, and Model Number - 0xa06a, //MTL - 0xc065, //ARL-H - 0xb065 //ARL-U - }; + const int kVendorID_IntelSpecifiedPlatformIDs[3] = { + // ExtendedModel,ExtendedFamily,Family Code, and Model Number + 0xa06a, // MTL + 0xc065, // ARL-H + 0xb065 // ARL-U + }; int regs_leaf0[4]; int regs_leaf1[4]; __cpuid(regs_leaf0, 0); __cpuid(regs_leaf1, 0x1); - auto isIntel = (kVendorID_Intel[0] == regs_leaf0[1]) && (kVendorID_Intel[1] == regs_leaf0[2]) && (kVendorID_Intel[2] == regs_leaf0[3]); - for(int intelSpecifiedPlatform : kVendorID_IntelSpecifiedPlatformIDs){ - if ((regs_leaf1[0]>>4) == intelSpecifiedPlatform){ + for (int intelSpecifiedPlatform : kVendorID_IntelSpecifiedPlatformIDs) { + if ((regs_leaf1[0] >> 4) == intelSpecifiedPlatform) { isIntelSpecifiedPlatform = true; } }