-
Notifications
You must be signed in to change notification settings - Fork 749
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
[SYCLCompat] Fix vectorized_binary impl to make SYCLomatic migrated code run pass #16553
base: sycl
Are you sure you want to change the base?
Conversation
…ode run pass Signed-off-by: Jiang, Zhiwei <[email protected]>
Signed-off-by: Jiang, Zhiwei <[email protected]>
Signed-off-by: Jiang, Zhiwei <[email protected]>
Signed-off-by: Jiang, Zhiwei <[email protected]>
Signed-off-by: Jiang, Zhiwei <[email protected]>
Signed-off-by: Jiang, Zhiwei <[email protected]>
Hey @zhiweij1 looks good! I understand now that you are altering the semantics of `vectorized_binary` also supports comparison operators from the standard library (`std::equal_to`, `std::not_equal_to`, etc)
and the semantics can be modified by changing the comparison operator template instantiation. For example:
```cpp
unsigned int Input1;
unsigned int Input2;
// initialize inputs...
// Performs comparison on sycl::ushort2, following sycl::vec semantics
// Returns unsigned int containing, per vector element, 0xFFFF if true, and 0x0000 if false
syclcompat::vectorized_binary<sycl::ushort2>(
Input1, Input2, std::equal_to<>());
// Performs element-wise comparison on unsigned short
// Returns unsigned int containing, per vector element, 1 if true, and 0 if false
syclcompat::vectorized_binary<sycl::ushort2>(
Input1, Input2, std::equal_to<unsigned short>());
|
Signed-off-by: Jiang, Zhiwei <[email protected]>
Done in c7b27d3 |
@joeatodd Before adjusting the doc file, the CI has passed. So I think the failure in the latest CI is not related to this PR. |
Signed-off-by: Jiang, Zhiwei [email protected]