-
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
Deprecate nested types in functional #5185
Deprecate nested types in functional #5185
Conversation
https://godbolt.org/z/9rYv9xxa8 shows that putting |
3b71a09
to
4354fe6
Compare
Interesting |
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.
Do we want to remove it with Kokkos 4 or when using C++20 support? If the former one, we should adjust the comments and wrap it in #ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
. In the latter case with #if defined(KOKKOS_ENABLE_CXX14) || defined(KOKKOS_ENABLE_CXX17)
.
I think we should stay in line with what the std does here |
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.
Fine with me.
CI failure seems unrelated |
containers/src/Kokkos_Functional.hpp
Outdated
using result_type = uint32_t; | ||
#if defined KOKKOS_ENABLE_CXX14 || defined KOKKOS_ENABLE_CXX17 | ||
using argument_type KOKKOS_DEPRECATED_WITH_COMMENT_17( | ||
"(deprecated in C++17)(removed in C++20)") = T; |
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.
I don't get the deprecation message
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.
After some discussion with Damien I propose to drop the message completely. Hinting towards the cause (deprecation of binary_function in the std) is kind of misleading and this indicates that compilers are not rushing to remove it.
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.
I would have gone for
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
using first_argument_type KOKKOS_DEPRECATED = T;
using second_argument_type KOKKOS_DEPRECATED = T;
using result_type KOKKOS_DEPRECATED = bool;
#endif
I would prefer to plan for simple removal in Kokkos 4.
2ae9984
to
a006750
Compare
ci failure unrelated |
FYI - cppreference details deprecation of What will the usage be after deprecation? |
They are not necessary anymore as explained, e.g., in https://stackoverflow.com/a/35907663, because of |
The functions in
Kokkos_Functional.hpp
mimic parts of<functional>
but are device portable. See greater as example.In the std lib the nested typenames
result_type
,first_argument_type
, andsecond_argument_type
are deprecated in c++17 and removed in 20. The respective functions in Kokkos should be marked deprecated when bumping to c++17Unfortunately, it looks likeusing
declarations can not be attributed with[[deprecated]]
buttypedef
can.