-
-
Notifications
You must be signed in to change notification settings - Fork 483
Add semantic tests for extrema algorithms with repeated values #6684
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
base: master
Are you sure you want to change the base?
Add semantic tests for extrema algorithms with repeated values #6684
Conversation
5ab364e
to
2b53e19
Compare
Can one of the admins verify this patch? |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
74b5949
to
9f2fae4
Compare
@@ -7,6 +7,7 @@ | |||
#include <hpx/algorithm.hpp> | |||
#include <hpx/init.hpp> | |||
#include <hpx/modules/testing.hpp> | |||
#include <hpx/parallel/algorithms/max_element.hpp> |
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.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>
?
@@ -7,6 +7,7 @@ | |||
#include <hpx/algorithm.hpp> | |||
#include <hpx/init.hpp> | |||
#include <hpx/modules/testing.hpp> | |||
#include <hpx/parallel/algorithms/min_element.hpp> |
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.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>?
@@ -7,6 +7,7 @@ | |||
#include <hpx/algorithm.hpp> | |||
#include <hpx/init.hpp> | |||
#include <hpx/modules/testing.hpp> | |||
#include <hpx/parallel/algorithms/minmax_element.hpp> |
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.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>?
20f30ea
to
b98e3ea
Compare
@harith-hacky03 please fix the compilation errors reported by the CI, i.e., https://app.circleci.com/pipelines/github/STEllAR-GROUP/hpx/17952/workflows/4f8c9bf6-3bd8-4f14-accb-5fade86d40fa/jobs/404643 |
3581f34
to
a01e4e1
Compare
@hkaiser What's the expected behaviour of max_element if i have multiple max elements? |
See: https://en.cppreference.com/w/cpp/algorithm/max_element
|
@harith-hacky03 please squash your commits and also remove all unrelated changes from this PR. |
2b59d9b
to
8cdb1d5
Compare
@hkaiser Don't know why am i getting those commits |
…t, max_element, and minmax_element Signed-off-by: harith-hacky03 <[email protected]>
1800813
to
ea79800
Compare
…t, max_element, and minmax_element Signed-off-by: harith-hacky03 <[email protected]>
ea79800
to
9755e1a
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
@@ -771,7 +779,7 @@ namespace hpx::parallel { | |||
|
|||
element_type curr_max_value = | |||
HPX_INVOKE(proj, *curr->max); | |||
if (!HPX_INVOKE(f, curr_max_value, max_value)) | |||
if (HPX_INVOKE(f, curr_max_value, max_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.
This is now inconsistent with your sequential implementation above (same for the change below). Which version is correct?
@harith-hacky03 ping? |
Fixes #6627
Proposed Changes
Any background context you want to provide?
The existing tests for extrema algorithms did not cover the important semantic behavior when dealing with repeated values. These new tests ensure that the algorithms maintain their expected behavior across different execution policies and comparison functions.
Checklist