-
Notifications
You must be signed in to change notification settings - Fork 99
Add option to enable "sve" optimization level on armv9 #830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: branch-25.06
Are you sure you want to change the base?
Conversation
Signed-off-by: Lizhen You <lyou@nvidia.com>
cpp/cmake/modules/FindSVE.cmake
Outdated
|
||
# Check for SVE support | ||
message("Checking for SVE support") | ||
SET(CMAKE_REQUIRED_FLAGS "-march=armv9-a+sve") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lowercase for the CMake function names, like set(...)
, if(...)
, else()
, mark_as_advanced(...)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found the FindAVX.cmake is using the uppercase as well; So it is reasonable to use uppercase for FindSVE.cmake for code consistency?
in FindAVX.cmake:
ACRO(CHECK_SSE lang type flags)
SET(__FLAG_I 1)
SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
FOREACH(__FLAG ${flags})
IF(NOT ${lang}${type}FOUND)
SET(CMAKE_REQUIRED_FLAGS ${__FLAG})
CHECK_CXX_SOURCE_RUNS("${${type}CODE}" ${lang}HAS${type}${__FLAG_I})
IF(${lang}HAS${type}${__FLAG_I})
SET(${lang}${type}FOUND
TRUE
CACHE BOOL "${lang} ${type} support"
)
SET(${lang}${type}_FLAGS
"${__FLAG}"
CACHE STRING "${lang} ${type} flags"
)
ENDIF()
MATH(EXPR __FLAG_I "${__FLAG_I}+1")
ENDIF()
ENDFOREACH()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's prefer "good CMake style" over consistency here, and go lower-case. Maybe as a follow-up we can fix FindAVX.cmake
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Pls double-check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the latest code look good to you? The "sve" optimization flag can enhance the performance on AArch64 machine significantly which is around 17% in my run. Hope we can integrate this flag in soon time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LizYou please see my comment below about the style checker (git pre-commit hooks). This PR cannot be merged while the style checker is not passing.
/ok to test 0d939b1 |
@LizYou it looks like we have some style checker errors. We use Git pre-commit hooks to automatically format code changes so they pass the style checker upon commit. Please see the following section of out contributor guide for information on how to configure pre-commit hooks. |
/ok to test f4d80ce |
No description provided.