-
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
Fix compiler flags for PGI/NVHPC #4264
Conversation
Does this need to be reflected in the Makefile system? |
In our README we say we support 18.7 Line 71 in 0530271
although we only enforce it is at least 17.4 in cmake kokkos/cmake/kokkos_compiler_id.cmake Line 141 in 0530271
and in our code kokkos/core/src/Kokkos_Macros.hpp Line 185 in 0530271
According the 18.7 documentation does not list |
diff --git a/Makefile.kokkos b/Makefile.kokkos
index ace24d63f..fe0e055f1 100644
--- a/Makefile.kokkos
+++ b/Makefile.kokkos
@@ -910,7 +910,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1)
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER8")
ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1)
-
+ KOKKOS_CXXFLAGS += -tp=pwr8
+ KOKKOS_LDFLAGS += -tp=pwr8
else
ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1)
KOKKOS_CXXFLAGS += -mcpu=power8 -mtune=power8
@@ -931,7 +932,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1)
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER9")
ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1)
-
+ KOKKOS_CXXFLAGS += -tp=pwr9
+ KOKKOS_LDFLAGS += -tp=pwr9
else
ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1)
KOKKOS_CXXFLAGS += -mcpu=power9 -mtune=power9 |
@@ -173,6 +173,8 @@ ENDIF() | |||
|
|||
IF(NOT DEFINED KOKKOS_CXX_HOST_COMPILER_ID) | |||
SET(KOKKOS_CXX_HOST_COMPILER_ID ${KOKKOS_CXX_COMPILER_ID}) | |||
ELSEIF(KOKKOS_CXX_HOST_COMPILER_ID STREQUAL PGI) | |||
SET(KOKKOS_CXX_HOST_COMPILER_ID NVHPC CACHE STRING INTERNAL FORCE) |
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 change is non obvious to me. Can you elaborate?
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.
The ideas was to unify PGI
and NVHPC
so that we don't need to distinguish between different CMake
versions. The idea was that nvc++
should accept the same flags as pgc++
.
We already did this translation a few lines higher if KOKKOS_CXX_COMPILER_ID
was PGI
. This didn't account for the case that KOKKOS_CXX_COMPILER_ID
was NVIDIA
and KOKKOS_CXX_HOST_COMPILER_ID
was PGI
. This line fixes it.
We should agree if we want to add that or not. In the corresponding |
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.
OK looks good to me regardless of the makefile support
-tp=host
andnative
are not accepted bypgc++
20.1 (only-tp=pwr8
and-tp=pwr9
) andnvc++
accepts-tp=host
,-tp=native
,-tp=host
,-tp=pwr8
and-tp=pwr9
. Thus, using-tp=pwr8
and-tp=pwr9
seems to be the best compromise. I don't know if these flags are available for older PGI versions (and if we care if not).Also, there was another branch where we need to replace
PGI
byNVHPC
in ourCMake
setup.