diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake index c0ab948b41fff..69d5f85bbd903 100644 --- a/cmake/onnxruntime_mlas.cmake +++ b/cmake/onnxruntime_mlas.cmake @@ -561,9 +561,13 @@ else() if(COMPILES_P10) check_cxx_source_compiles(" #ifdef _AIX + #include + #if !defined(POWER_10) #define POWER_10 0x40000 + #endif + #if !defined(POWER_10_ANDUP) #define POWER_10_ANDUP (POWER_10) - #include + #endif #define __power_10_andup() (_system_configuration.implementation & POWER_10_ANDUP) int main() { bool HasP10 = (__power_10_andup() && __power_mma_version() == MMA_V31); diff --git a/onnxruntime/core/mlas/lib/platform.cpp b/onnxruntime/core/mlas/lib/platform.cpp index 528e71bcffed1..278ea29b6f27f 100644 --- a/onnxruntime/core/mlas/lib/platform.cpp +++ b/onnxruntime/core/mlas/lib/platform.cpp @@ -30,9 +30,11 @@ Module Name: #if defined(__linux__) #include #elif defined(_AIX) +#include +#if !defined(POWER_10) #define POWER_10 0x40000 #define POWER_10_ANDUP (POWER_10) -#include +#endif #define __power_10_andup() (_system_configuration.implementation & POWER_10_ANDUP) #endif #endif