-
Notifications
You must be signed in to change notification settings - Fork 443
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
Quad-precision math #4098
Quad-precision math #4098
Conversation
I did this for Trilinos many years ago (but post adding Kokkos to Tpetra, I think?). |
@@ -399,6 +399,8 @@ pipeline { | |||
-DKokkos_ENABLE_TESTS=ON \ | |||
-DKokkos_ENABLE_OPENMP=ON \ | |||
-DKokkos_ENABLE_LIBDL=OFF \ | |||
-DKokkos_ENABLE_LIBQUADMATH=ON \ | |||
-DCMAKE_PREFIX_PATH=/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.3.0 \ |
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 is a bit frustrating. This is only needed for CMake, g++
does not need to add anything to the include path to find <quadmath.h>
. Also -lquadmath
on the link line would do.
Unfortunately I am not sure how I would do that with our CMake files, especially if it has to behave the same with Trilinos.
inline __float128 hypot(__float128 x, __float128 y) { return ::hypotq(x, y); } | ||
// Exponential functions | ||
inline __float128 exp(__float128 x) { return ::expq(x); } | ||
#if defined(KOKKOS_COMPILER_GNU) && (KOKKOS_COMPILER_GNU >= 910) |
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.
Should be checking the stdlibc++ version instead
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.
Actually I am not sure... There does not seem to be any macro to check the libquadmath version.
Guard definition of infinity numeric trait for GCC version >= 7.1
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 (maybe apart from the CMAKE_PREFIX_PATH
weirdness)
Hi @mhoemmen ! hope you are doing well! You may be happy to hear I am reviving all the float128 stuff you put in awhile ago, as well as making extensions for 'long double' scalar types. Unfortunately there have been a number of issues getting the software stack to cooperate, sigh... |
Thanks for doing this @dalg24 ! Would Kokkos automatically detect if quadmath is enabled in Trilnos when being built as a part of Trilinos and set the configure flags appropriately? |
Yes kokkos/cmake/kokkos_tpls.cmake Lines 70 to 75 in cfb94d9
|
Regarding adding the extended scalar types to Kokkos::rand - I understand the choice here. The problem is that Kokkos::rand is used within basic Trilinos routines with the implied scalar type, e.g., https://github.com/trilinos/Trilinos/blob/master/packages/tpetra/core/src/Tpetra_MultiVector_def.hpp#L2345-L2350 . I could try to change this if Trilnos folks are not opposed. What is the best way to do this - do a downcase only in the case of a 'long double' or '__float128'? |
Use |
This is equivalent to Kokkos::rand? |
Ah ok, never mind, I see what you are suggesting. Sorry, was looking in the wrong place. I'll try that. |
So I get the following error when I switch to
I guess there are not complex implementations of finite_max? |
@ikalash wrote:
I am, thank you! Hope you are too! : - )
Par for the course ; - )
Excellent! I do hope it works out! These days I generally avoid |
Who uses Windows for scientific computing though?? (I know people do, I just always find it hard to believe). I have been lamenting that you are not around to discuss what I've been doing! It seems like there is a fair amount of interest in the extended scalar types within Trilinos, so it will be interesting to see if it goes anyway. |
@ikalash wrote:
Ha! ; - P Y'all need to remember that a lot of computation happens on the desktop. Visual Studio's C++ support really took off in the past few years -- these days, we're using a lot of C++20 even without requiring the latest compiler version. I've seen
Likewise! : - ) (I'd be happy to talk more offline about contract work through my employer if you're interested; if not, no worries!)
Best wishes with that work! |
Add support for GCC's 128-bit floating-point type