-
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
std_algos: fix wrong corner case for is_partitioned
#6257
Conversation
is_partitioned
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.
OK with the changes but not with the format disable
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.
The disable format introduces inconsistencies (that look accidental) and it is not obvious to me what benefit we get from disabling.
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 good to me.
Retest this please |
Fix wrong behavior for corner case in
Kokkos::Experimental::is_partitioned
.Currently, if we were to do:
we get
res == false
.However, this is wrong wrt std library see godbolt here and should return
true
.This PR fixes this and the test that was wrongly set to false.
Note that the std library documentation
https://en.cppreference.com/w/cpp/algorithm/is_partitioned
is not super clear about this, in the sense that when none of the elements satisfy the predicate one could misinterpret it.Comment: this bug was found when implementing the team-level api in #6256