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
[WIP] Task/rhornung67/device numeric limits #1196
base: develop
Are you sure you want to change the base?
Conversation
With the changes in this PR, is there any reason we need this stuff: https://github.com/LLNL/axom/blob/develop/src/axom/core/numerics/floating_point_limits.hpp ? We are currently not consistent across the code. |
|
||
namespace axom | ||
{ | ||
#if defined(AXOM_USE_CUDA) && defined(AXOM_DEVICE_CODE) |
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 it make sense to remove if defined(AXOM_DEVICE_CODE)
and just have the AXOM_USE_CUDA
guard? It's my impression that cuda::std
should work on both the host and device.
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.
If it does, that would be preferable. I need to look into that. @kennyweiss discussed this PR yesterday. That resulted in some concerns about several things in the code that we should discuss as a team. Unfortunately, that will have to wait for a couple of weeks as next Monday is a LLNL holiday and NECDC is the week after 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.
@publixsubfan cuda::std
does work in device and host code. I ran into some issues with some Axom tests where cuda::std::numeric_limits
does not support long double
. The intent of my change was to use std::numeric_limits
in host code for all builds. However, it's not clear to me that we need to support long double
. long double is automatically converted to double in device code and attempting to pass long double data between host and device code is problematic.
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.
Thanks @rhornung67 This looks useful. I hope the long double issue is not a blocker.
Summary
NOTE: There is more work to do here. Asking for folks to comment before I plow through converting to
axom::numeric_limits
everywhere. Please let me know what you think.std::numeric_limits
withaxom::numeric_limits
for consistency across the code and to prevent unseemly compiler warnings.Resolves #1195
Also, see #1338