-
Notifications
You must be signed in to change notification settings - Fork 752
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] Refactor vector_arith*
#16349
[SYCL] Refactor vector_arith*
#16349
Conversation
This PR separates the "base" case functional implementation from templates/overloads/constraints. The latter doesn't match even the current SYCL spec and that is not taking into account proposed vec/swizzle changes. Making this change would allow to share more code between non-preview/preview implementation paths when implementing proposed SYCL vec/swizzle changes.
std::is_same_v<element_type, ext::oneapi::bfloat16>) { | ||
result_t res{}; | ||
for (size_t i = 0; i < N; ++i) | ||
if constexpr (is_logical) |
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.
could you remind me why we are using -1 on the logical ops here? Or maybe insert a comment?
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.
Because that's how it's defined in the SYCL spec... ¯\(ツ)/¯
I'm doing some minor changes here to unify several code paths and fix some CTS failures.
for (size_t I = 0; I < NumElements; ++I) { | ||
Ret[I] = bit_cast<int8_t>(Ret[I]) != 0; | ||
} | ||
return VecOperators::apply_unary_op<std::bit_not<void>>(Rhs); |
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.
omg, if true, I love this. Stupid operator~
was as huge pain. we need to make sure it's fully tested, lin/win , bool, std::byte (and not applicable to float IIRC).
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.
I'm running local CTS (bin/test_vector* tests) in addition to pre-commit CI.
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.
LGTM ❤️
This PR separates the "base" case functional implementation from templates/overloads/constraints. The latter doesn't match even the current SYCL spec and that is not taking into account proposed vec/swizzle changes.
Making this change would allow to share more code between non-preview/preview implementation paths when implementing proposed SYCL vec/swizzle changes.