-
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
core: add is_team_handle and test #5375
Conversation
retest this please |
retest this please |
retest this please |
CI failures are due to outofspace |
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.
It is good, that we check the interface of team_handle
. But do we actually require the values the team_handle
returns to fulfill comply with an expected behavior?
What is this used for? |
decided to:
|
@dalg24 @masterleinad As far as I understand, that implementation would add |
@jstrzebonski can you please post also the snippets you showed me today? So that is more clear what we propose |
For example
Similary
|
1de7272
to
e954e27
Compare
failure is unrelated |
4986ee3
to
0163b47
Compare
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.
Not sure that we want to get into the business of implementing tests of tests?
0163b47
to
e4db62e
Compare
failure is unrelated |
core/unit_test/TestConcepts.hpp
Outdated
/*------------------------------------------------- | ||
begin test for team_handle concept | ||
|
||
Read before moving on to the test below: | ||
The implementation inside Kokkos/core of the team_handle concept follows | ||
that of execution space, memory space, etc as shown here: | ||
|
||
https://github.com/kokkos/kokkos/blob/61d7db55fceac3318c987a291f77b844fd94c165/core/src/Kokkos_Concepts.hpp#L160 | ||
|
||
which has a key aspect: for performance reasons, it does *not* check the | ||
complete trait. So below we also provide a complete team handle concept trait | ||
based on this | ||
|
||
https://kokkos.github.io/kokkos-core-wiki/API/core/policies/TeamHandleConcept.html | ||
|
||
which completely checks the trait and we use to validate things. | ||
This complete trait was originally used as implementation but was moved | ||
here as discussed in this PR: https://github.com/kokkos/kokkos/pull/5375 | ||
|
||
------------------------------------------------- */ |
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.
/*------------------------------------------------- | |
begin test for team_handle concept | |
Read before moving on to the test below: | |
The implementation inside Kokkos/core of the team_handle concept follows | |
that of execution space, memory space, etc as shown here: | |
https://github.com/kokkos/kokkos/blob/61d7db55fceac3318c987a291f77b844fd94c165/core/src/Kokkos_Concepts.hpp#L160 | |
which has a key aspect: for performance reasons, it does *not* check the | |
complete trait. So below we also provide a complete team handle concept trait | |
based on this | |
https://kokkos.github.io/kokkos-core-wiki/API/core/policies/TeamHandleConcept.html | |
which completely checks the trait and we use to validate things. | |
This complete trait was originally used as implementation but was moved | |
here as discussed in this PR: https://github.com/kokkos/kokkos/pull/5375 | |
------------------------------------------------- */ |
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.
why you want to remove this? 12 months from now somebody will look at this and wonder why the full trait is here... the comment helps IMO
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.
20 lines to say something (arguably) obvious. Can you say in one or two lines?
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 changed it quite a bit, hope it is ok now
core/unit_test/TestConcepts.hpp
Outdated
// actual test begins here | ||
|
||
/* | ||
disabling as follows: | ||
|
||
- OpenMPTARGET: due to this | ||
https://github.com/kokkos/kokkos/blob/2d6cbad7e079eb45ae69ac6a59929d9fcf10409a/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp#L860 | ||
|
||
- OpenACC: not supporting teams yet | ||
*/ |
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.
// actual test begins here | |
/* | |
disabling as follows: | |
- OpenMPTARGET: due to this | |
https://github.com/kokkos/kokkos/blob/2d6cbad7e079eb45ae69ac6a59929d9fcf10409a/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp#L860 | |
- OpenACC: not supporting teams yet | |
*/ | |
// FIXME_OPENMPTARGET https://github.com/kokkos/kokkos/blob/2d6cbad7e079eb45ae69ac6a59929d9fcf10409a/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp#L860-L864 |
@rgayatri23 please advise why the interface departure is not something that can be fixed now
There is some support for teams that was merged in the OpenACC backend. Did you check since that change?
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.
trying now again
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.
OpenACCTeamMember is missing the following method:
template <typename ReducerType>
KOKKOS_INLINE_FUNCTION std::enable_if_t<is_reducer<ReducerType>::value>
team_reduce(ReducerType const& reducer) const noexcept;
ccc3487
to
31a74bf
Compare
|
||
template <class T> | ||
inline constexpr bool is_team_handle_complete_trait_check_v = | ||
is_team_handle_complete_trait_check<T>::value; |
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.
is_team_handle_complete_trait_check<T>::value; | |
is_team_handle_complete_trait_check<T>::value && Kokkos::is_team_handle_v<T>; |
that way you don't need to duplicate all that code below
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 think its fine. Makes it more obvious that the primary team handle is tested.
|
||
template <class T> | ||
inline constexpr bool is_team_handle_complete_trait_check_v = | ||
is_team_handle_complete_trait_check<T>::value; |
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 think its fine. Makes it more obvious that the primary team handle is tested.
Content
Impl of
is_team_handle
(based on this concept syntax) and a test.Notes/caveats