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

This makes the math function use the "C" interface for GCC 5 #4733

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

crtrott
Copy link
Member

@crtrott crtrott commented Jan 28, 2022

When compiling for CUDA with GCC 5 the std::functions don't have
the right markup, so you get all these warnings or errors about
calling pure host functions in our math functions.

Prior to GCC 6 you have to call for example fmin instead of std::fmin

@crtrott
Copy link
Member Author

crtrott commented Jan 28, 2022

Tested with:

cmake -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_TESTS=ON -DKokkos_ARCH_VOLTA70=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_DEPRECATED_CODE3=ON ~/Kokkos/kokkos

using CUDA 10.1 and GCC 5.3

@@ -91,8 +91,12 @@ namespace Experimental {
#if defined(KOKKOS_ENABLE_SYCL)
#define KOKKOS_IMPL_MATH_FUNCTIONS_NAMESPACE sycl
#else
#if defined(KOKKOS_ENABLE_CUDA) && defined(__GNUC__) && (__GNUC__ < 6)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a problem that this path might also be taken by a compiler different from g++, like icpc or clang++?

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean? The issue is the C++ cmath header, which should only depend on the GNUC

Copy link
Member Author

Choose a reason for hiding this comment

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

or are you worried this is getting taken by clang when it is supposed to use its own headers?

Copy link
Contributor

Choose a reason for hiding this comment

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

clang doesn't like this:

/var/jenkins/workspace/Kokkos/core/src/Kokkos_MathematicalFunctions.hpp:298:34: error: reference to __device__ function 'isinf' in __host__ __device__ function [clang-diagnostic-error]

When compiling for CUDA with GCC 5 the std::functions don't have
the right markup, so you get all these warnings or errors about
calling pure host functions in our math functions.

Prior to GCC 6 you have to call for example fmin instead of std::fmin
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@crtrott
Copy link
Member Author

crtrott commented Jan 29, 2022

Retest this please.

@crtrott
Copy link
Member Author

crtrott commented Jan 30, 2022

Retest this please

1 similar comment
@dalg24
Copy link
Member

dalg24 commented Jan 30, 2022

Retest this please

@dalg24
Copy link
Member

dalg24 commented Jan 31, 2022

Failures are unrelated

@dalg24 dalg24 merged commit aae0a7f into kokkos:develop Jan 31, 2022
@crtrott crtrott deleted the fix-cuda-with-gcc5 branch January 31, 2022 17:50
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