-
Notifications
You must be signed in to change notification settings - Fork 407
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
Add a64fx and fujitsu Compiler support #3614
Conversation
Fujitsu compiler is not properly recognized by Cmake, so we need to work around that
cmake/kokkos_compiler_id.cmake
Outdated
@@ -137,6 +137,17 @@ IF(KOKKOS_CXX_COMPILER_ID STREQUAL Cray OR KOKKOS_CLANG_IS_CRAY) | |||
ENDIF() | |||
ENDIF() | |||
|
|||
IF(KOKKOS_CXX_COMPILER_ID STREQUAL Fujitsu) | |||
# SET Cray's compiler version. |
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 assume you copied from above and forgot to update or remove the comment
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.
yeah ...
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.
fixed
@@ -18,7 +18,7 @@ TARGET_COMPILE_DEFINITIONS(kokkos_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_P | |||
|
|||
TARGET_INCLUDE_DIRECTORIES(kokkos_gtest PUBLIC ${GTEST_SOURCE_DIR}) | |||
#Gtest minimally requires C++11 | |||
IF(NOT (Kokkos_ENABLE_CUDA AND WIN32)) | |||
IF((NOT (Kokkos_ENABLE_CUDA AND WIN32)) AND (NOT ("${KOKKOS_CXX_COMPILER_ID}" STREQUAL "Fujitsu"))) | |||
TARGET_COMPILE_FEATURES(kokkos_gtest PUBLIC cxx_std_11) |
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.
Would someone remind me why we need this in the first place? Don't we set CMAKE_CXX_STANDARD
?
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 thought someone found this was needed on some platform ...
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.
AFAIK, we don't compile gtest
with the Kokkos
flags and we don't require CMAKE_CXX_STANDARD
directly. Hence, there were some issues in the nightlies at some point.
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 would be surprised if we still need that line at all but this probably shouldn't be addressed here
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 was suprised we had issues to begin with. And yes somewhere we needed that with some combination of weird compiler (Intel XL or so) and some cmake version.
cmake/kokkos_arch.cmake
Outdated
@@ -35,6 +35,7 @@ KOKKOS_ARCH_OPTION(ARMV80 HOST "ARMv8.0 Compatible CPU") | |||
KOKKOS_ARCH_OPTION(ARMV81 HOST "ARMv8.1 Compatible CPU") | |||
KOKKOS_ARCH_OPTION(ARMV8_THUNDERX HOST "ARMv8 Cavium ThunderX CPU") | |||
KOKKOS_ARCH_OPTION(ARMV8_THUNDERX2 HOST "ARMv8 Cavium ThunderX2 CPU") | |||
KOKKOS_ARCH_OPTION(A64FX HOST "ARMv8.2 with SVE Suport") |
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.
Do not break the alignment.
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.
bah that came through the renaming from ARMV8_SVE to A64FX based on feedback from @nmhamster . Gonna fix that,
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.
fixed
The fujitsu compile actually does warn about that comment, thinking we are using an unsupported tri-graph ...
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.
Looks OK to me (assuming that the flags are actually correct).
@@ -18,7 +18,7 @@ TARGET_COMPILE_DEFINITIONS(kokkos_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_P | |||
|
|||
TARGET_INCLUDE_DIRECTORIES(kokkos_gtest PUBLIC ${GTEST_SOURCE_DIR}) | |||
#Gtest minimally requires C++11 | |||
IF(NOT (Kokkos_ENABLE_CUDA AND WIN32)) | |||
IF((NOT (Kokkos_ENABLE_CUDA AND WIN32)) AND (NOT ("${KOKKOS_CXX_COMPILER_ID}" STREQUAL "Fujitsu"))) | |||
TARGET_COMPILE_FEATURES(kokkos_gtest PUBLIC cxx_std_11) |
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 would be surprised if we still need that line at all but this probably shouldn't be addressed here
IF(KOKKOS_CXX_COMPILER_ID STREQUAL Fujitsu) | ||
# SET Fujitsus compiler version which is not detected by CMake | ||
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version | ||
OUTPUT_VARIABLE INTERNAL_CXX_COMPILER_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" | ||
TEMP_CXX_COMPILER_VERSION ${INTERNAL_CXX_COMPILER_VERSION}) | ||
SET(KOKKOS_CXX_COMPILER_VERSION ${TEMP_CXX_COMPILER_VERSION} CACHE STRING INTERNAL FORCE) | ||
ENDIF() |
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 don't think we actually need this block. Why did you add it?
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.
because otherwise KOKKOS_CXX_COMPILER_VERSION is empty and some code later fails.
@@ -24,7 +24,7 @@ KOKKOS_ADD_TEST_LIBRARY( | |||
# avoid deprecation warnings from MSVC | |||
TARGET_COMPILE_DEFINITIONS(kokkosalgorithms_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_PTHREAD=0) | |||
|
|||
IF(NOT (Kokkos_ENABLE_CUDA AND WIN32)) | |||
IF((NOT (Kokkos_ENABLE_CUDA AND WIN32)) AND (NOT ("${KOKKOS_CXX_COMPILER_ID}" STREQUAL "Fujitsu"))) |
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.
Elaborate on why this exception is here in a comment, please.
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.
because cmake is weird and I need to do this to make it work?
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.
This can't be just a CMake problem. @jjwilke or is it?
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.
it kinda is, because it combines requesting a c++ standard via compile feature (instead of just setting a cxx flag) with checking whether the compiler actually supports it, which it comes back as negative if it doesn't identify the compiler as a known thing (like nvcc on windows, or fujitsu in gener). I guess I can add that as a comment.
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.
It's a mess, but all of our build system is a mess apparently. In that context, LGTM.
Opened #3620 which is there to address some of the questions here medium term and streamline the process of side stepping cmake mines for unknown compilers. |
This adds support for A64FX (ARM v8.2 with SVE) and the Fujitsu Compiler in order to support Fugaku.