Skip to content
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

Treat PGI compiler flags in nvcc_wrapper #3254

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

masterleinad
Copy link
Contributor

Alternative to #3239 as suggested in #3252.

Co-authored-by: Robert Hager <rhager@pppl.gov>
@@ -251,6 +251,20 @@ do
shared_args="$shared_args $std_flag"
;;

Copy link

Choose a reason for hiding this comment

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

I think we need to also revert the changes in kokkos_test_cxx_std.cmake?

+    SET(SUPPORTED_NVCC_FLAGS "-std=c++11;-std=c++14;-std=c++17")
+    IF (${KOKKOS_CXX_COMPILER_ID} STREQUAL NVIDIA AND NOT ${${STANDARD_NAME}} IN_LIST SUPPORTED_NVCC_FLAGS)
+      MESSAGE(FATAL_ERROR "CMake wants to use ${${STANDARD_NAME}} which is not supported by NVCC. Using a more recent host compiler or a more recent CMake version might help.")
+    ENDIF()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recent develop has

   IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND (KOKKOS_CXX_HOST_COMPILER_ID STREQUAL GNU OR KOKKOS_CXX_HOST_COMPILER_ID STREQUAL Clang))
      SET(SUPPORTED_NVCC_FLAGS "-std=c++11;-std=c++14;-std=c++17")
      IF (NOT ${${STANDARD_NAME}} IN_LIST SUPPORTED_NVCC_FLAGS)
        MESSAGE(FATAL_ERROR "CMake wants to use ${${STANDARD_NAME}} which is not supported by NVCC. Using a more recent host compiler or a more recent CMake version might help.")
      ENDIF()
    ENDIF()

which should be fine.

Copy link

Choose a reason for hiding this comment

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

Won't this reject PGI + NVCC? Compiler ID will be NVIDIA, but it will have the PGI compiler flag --c++11. I could be misunderstanding the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the host compiler id is PGI and not GNU or Clang.

Copy link

Choose a reason for hiding this comment

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

Got it. I can't read.

@jjwilke
Copy link

jjwilke commented Aug 5, 2020

I don't have access to a PGI compiler to test this. But looks fine to me.

@dalg24 dalg24 merged commit af6a256 into kokkos:develop Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants