Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,13 @@ else()
if(COMPILES_P10)
check_cxx_source_compiles("
#ifdef _AIX
#include <sys/systemcfg.h>
#if !defined(POWER_10)
#define POWER_10 0x40000
#endif
#if !defined(POWER_10_ANDUP)
#define POWER_10_ANDUP (POWER_10)
#include <sys/systemcfg.h>
#endif
#define __power_10_andup() (_system_configuration.implementation & POWER_10_ANDUP)
int main() {
bool HasP10 = (__power_10_andup() && __power_mma_version() == MMA_V31);
Expand Down
4 changes: 3 additions & 1 deletion onnxruntime/core/mlas/lib/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ Module Name:
#if defined(__linux__)
#include <sys/auxv.h>
#elif defined(_AIX)
#include <sys/systemcfg.h>
#if !defined(POWER_10)
#define POWER_10 0x40000
#define POWER_10_ANDUP (POWER_10)
Comment on lines +34 to 36
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard only checks if POWER_10 is defined, but POWER_10_ANDUP (used on line 38) might not be defined by the system header. Consider also adding a guard for POWER_10_ANDUP:

#if !defined(POWER_10_ANDUP)
#define POWER_10_ANDUP (POWER_10)
#endif

This ensures POWER_10_ANDUP is always available even if the system header only defines POWER_10.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe similar POWER_10_ANDUP gaurd here is in the other file ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea here also we can add that line checking for the POWER_10_ANDUP macro.

#include <sys/systemcfg.h>
#endif
#define __power_10_andup() (_system_configuration.implementation & POWER_10_ANDUP)
#endif
#endif
Expand Down
Loading