-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] fix asserts after logical operation changes #18411
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
Open
dklochkov-emb
wants to merge
6
commits into
intel:sycl
Choose a base branch
from
dklochkov-emb:sycl-fix-group-algorithm
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
118830c
[SYCL] fix asserts after logical operation changes
dklochkov-emb 3f34653
[SYCL] use alias for readability
dklochkov-emb 102248e
Merge remote-tracking branch 'upstream/sycl' into sycl-fix-group-algo…
dklochkov-emb cad3fa2
Merge remote-tracking branch 'upstream/sycl' into sycl-fix-group-algo…
dklochkov-emb 876f979
Merge remote-tracking branch 'upstream/sycl' into sycl-fix-group-algo…
dklochkov-emb f3b026a
[SYCL] use output type to check in assert
dklochkov-emb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is the accumulation type? Can we use it directly?
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.
As far as I understand, the accumulation type is the type of input/output data type, i.e part of typename InPtr:
using binary_op_t = std::remove_cv_t<std::remove_reference_t<decltype(*first)>>;
or
typename detail::remove_pointer<OutPtr>::type>
depending on __INTEL_PREVIEW_BREAKING_CHANGES
Uh oh!
There was an error while loading. Please reload this page.
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.
Can we use it directly? Or, in other words, the current condition of the
static_assert
doesn't match its message. Why are you changing the condition of the assert vs changing the accumulator type? How confident are you in your change?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.
Fixed
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.
No, it isn't. You still have
std::is_same_v<decltype(binary_op(binary_op_t(), binary_op_t())), bool>
. Either change the assert message (and explain why that would be a valid change!) or always compare with the actual result type.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.
The original problem is based on changes of return type of sycl::logical_and/sycl::logical_or.
#17239
So, when one of these structs is passed as binary operator and -fpreview-changes flag is used, the return type is not the same as the type passed to sycl::logical_and/sycl::logical_or.
That is why original assert does not work and was updated for this case
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.
That sounds like you've treated symptoms instead of root causing the issue. The original assert had a very specific wording that doesn't take place anymore. Do you know why it was worded like that instead of a more loose wording that would have matched your changes?
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.
@aelovikov-intel I just know why assert failed: some of binary operations return
bool
type instead ofbinary_op_t
. These operations arelogical_or
,logical_and
. I was wondering if you explain me 'why it was worded like that' and what is a new string to represent the right output if assert fails