diff --git a/onnxruntime/core/platform/windows/env.cc b/onnxruntime/core/platform/windows/env.cc index 9c91bcb89875f..0eb34cbfbc9eb 100644 --- a/onnxruntime/core/platform/windows/env.cc +++ b/onnxruntime/core/platform/windows/env.cc @@ -32,7 +32,7 @@ limitations under the License. #include "core/common/span_utils.h" #include "core/platform/env.h" #include "core/platform/scoped_resource.h" -#if defined(_M_X64) && !defined(_M_ARM64EC) +#if defined(_M_X64) && !defined(_M_ARM64EC) && defined(ONNXRUNTIME_ENABLE_INTEL_METEOR_LAKE_MOBILE_PLATFORM_PERF_PATCH) #include "core/platform/windows/hardware_core_enumerator.h" #endif #include @@ -261,8 +261,7 @@ int WindowsEnv::DefaultNumCores() { int WindowsEnv::GetNumPhysicalCpuCores() const { // EIGEN_NO_CPUID is not defined in any C/C++ source code. It is a compile option. -//&&defined(ONNXRUNTIME_ENABLE_INTEL_METEOR_LAKE_MOBILE_PLATFORM_PERF_PATCH) -#if defined(_M_X64) && !defined(_M_ARM64EC) && !defined(EIGEN_NO_CPUID) +#if defined(_M_X64) && !defined(_M_ARM64EC) && !defined(EIGEN_NO_CPUID) && defined(ONNXRUNTIME_ENABLE_INTEL_METEOR_LAKE_MOBILE_PLATFORM_PERF_PATCH) // The following code is a temporary fix for a perf problem on Intel's Meteor Lake CPUs. The Intel compute platform has // a hybrid architecture that some CPU cores runs significant slower than the others. If we distribute our compute work // evenly to all CPU cores, the slowest CPU core will drag the performance down. So, instead, we reduce the total number