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

[SYCL][COMPAT] Added compare and unordered compare operations #12998

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

Alcpz
Copy link
Contributor

@Alcpz Alcpz commented Mar 12, 2024

Adds the following ordered and unordered comparisons:

  • compare
  • undered_compare
  • compare_both (wrapper for sycl::vec<ValueT, 2>)
  • undered_compare_both (wrapper for sycl::vec<ValueT, 2>)
  • compare_mask
  • unordered_compare_mask

@Alcpz Alcpz requested a review from a team as a code owner March 12, 2024 16:59
@Alcpz Alcpz temporarily deployed to WindowsCILock March 12, 2024 17:16 — with GitHub Actions Inactive
@Alcpz Alcpz temporarily deployed to WindowsCILock March 12, 2024 17:36 — with GitHub Actions Inactive
@Alcpz Alcpz force-pushed the Alcpz/math-compare branch from d896b6b to 57e1d49 Compare March 13, 2024 12:13
@Alcpz Alcpz temporarily deployed to WindowsCILock March 13, 2024 12:24 — with GitHub Actions Inactive
@Alcpz Alcpz temporarily deployed to WindowsCILock March 13, 2024 12:53 — with GitHub Actions Inactive
Comment on lines 1245 to 1262
template <typename ValueT, class BinaryOperation>
inline std::enable_if_t<
std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>,
bool>
compare(const ValueT a, const ValueT b, const BinaryOperation binary_op);
template <typename ValueT>
inline std::enable_if_t<
std::is_same_v<std::invoke_result_t<std::not_equal_to<>, ValueT, ValueT>,
bool>,
bool>
compare(const ValueT a, const ValueT b, const std::not_equal_to<> binary_op);
template <typename ValueT, class BinaryOperation>
inline std::enable_if_t<ValueT::size() == 2, ValueT>
compare(const ValueT a, const ValueT b, const BinaryOperation binary_op);
template <typename ValueT, class BinaryOperation>
inline std::enable_if_t<
std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>,
bool>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we format this differently, it is very challenging to read?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've substituted the enable if by a comment that includes the enable_if and what the enable_if does. It's technically describing the line of code, but as you say the three nested std:: calls is difficult to read.

I also removed the not_equal_to<> specialization, as it is more an implementation detail.

@Alcpz Alcpz force-pushed the Alcpz/math-compare branch from 35a0f97 to 568f77a Compare April 15, 2024 13:25
@Alcpz Alcpz temporarily deployed to WindowsCILock April 15, 2024 13:31 — with GitHub Actions Inactive
@Alcpz Alcpz temporarily deployed to WindowsCILock April 15, 2024 13:51 — with GitHub Actions Inactive
@Alcpz
Copy link
Contributor Author

Alcpz commented Apr 16, 2024

@intel/llvm-gatekeepers This is ready to merge.

AWS CI check fails due to an unrelated test. Related issue: #13281

@sommerlukas sommerlukas merged commit af491ee into intel:sycl Apr 16, 2024
13 checks passed
@Alcpz Alcpz deleted the Alcpz/math-compare branch June 3, 2024 12:20
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.

3 participants