Skip to content
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

[SYCLomatic] Introduce dpct::argmax and dpct::argmin functors #2032

Conversation

mmichel11
Copy link
Contributor

@mmichel11 mmichel11 commented Jun 4, 2024

This PR introduces dpct::argmax and dpct::argmin functors for determining the arg max / arg min of two dpct::key_value_pair types.

These functors have the following behavior:

dpct::argmin

  • If the two key_value_pair objects have different values, then return a copy of the key_value_pair with the lower value.
  • If the two key_value_pair objects the same values, then return a copy of the key_value_pair with the lower key.

dpct::argmax

  • If the two key_value_pair objects have different values, then return a copy of the key_value_pair with the greater value.
  • If the two key_value_pair objects the same values, then return a copy of the key_value_pair with the lower key.

The corresponding test PR is oneapi-src/SYCLomatic-test#724

Copy link
Contributor

@timmiesmith timmiesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tomflinda tomflinda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhimingwang36 zhimingwang36 merged commit 3f3eab2 into oneapi-src:SYCLomatic Jun 17, 2024
21 checks passed
ShengchenJ pushed a commit to ShengchenJ/SYCLomatic that referenced this pull request Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants