-
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
Add mathematical constants #4519
Conversation
46b572e
to
339e91e
Compare
339e91e
to
7f88604
Compare
Hold on before you merge that one. I probably should have used variable templates. I forgot they were available in C++14 |
Except that inline variables only come with C++17... |
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.
Discussed this with @dalg24 today there is a slightly different implementation idea in order to avoid introducing traits which are not part of the standard in the public Kokkos namespace (i.e. put the trait into Impl, and only the variable declaration in Kokkos)
#include <Kokkos_Core.hpp> | ||
|
||
template <class T> | ||
KOKKOS_FUNCTION T *take_address_of(T &arg) { |
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.
Just curious:: why not use std::addressof
?
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.
__host__ __device__
annotation missing
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.
3f9e920
to
9e03b0c
Compare
Fix #4507
Backporting C++20 facility https://eel.is/c++draft/numbers
Individual traits with a
value
member for each 13 constants defined in the standard.