-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Fix handler::copy [from|to] [raw|shared] pointer. #782
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] Fix handler::copy [from|to] [raw|shared] pointer. #782
Conversation
2d049d1
to
0630bf8
Compare
Please add more details to the commit message. A proper commit message should describe why you make the change: what was the problem with the old code, in what situation we could hit it, and why the new code is correct. It is also not clear how the three bullets in the description are connected. Is this a single fix for a single issue? |
0630bf8
to
9b496ee
Compare
The test did not work, in the situation used by the test, the test now passes.
They are connected by the fact that they are in the same pull-request. |
Why do you think that it is a product issue, and not a test issue?
I'm not sure I followed. Why the "simplified implementation" part have to be in this patch? |
There was a logical error in our implementation, it looks something like this:
I would split this patch into several commits, but then they will be squashed together anyway. |
Here is good example how to handle this case: #724. |
Case 1: There is a call handler copy method from a pointer (used the accessor range and offset of 0) to an accessor(with a range of 4 and an offset of 2). src_ptr = [0,1,2,3,4,5,6,7] // the data that the pointer points to dest_acc = [x,x,x,x,x,x,x,x] // the data that the accessor points to handler.copy(src_ptr, dest_acc<1>{range{4}, offset{2}} Before this patch dest_acc had: "x x 2 3 4 5 x x" After this patch dest_acc has: "x x 0 1 2 3 x x" The root cause: the destination offset was used for the source. The fix: use the source offset for the source. Case 2: There is a call handler copy method from an accessor(with a range of 4 and an offset of 2) to a pointer (used the accessor range and offset of 0). src_acc = [0,1,2,3,4,5,6,7] // // the data that the accessor points to dest_ptr = [x,x,x,x,x,x,x,x] // the data that the pointer points to handler.copy(src_acc<1>{range{4}, offset{2}, dest_ptr} Before this patch had dest_ptr: "0 1 2 3 x x x x" After this patch has dest_ptr: "2 3 4 5 x x x x" The root cause: the destination offset was used for the source. The fix: use the source offset for the source. Signed-off-by: Alexey Voronov <[email protected]>
9b496ee
to
99347f3
Compare
Please take a look. I tried to describe user cases in the commit message. |
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, thanks.
Case 1:
There is a call handler copy method from a pointer (used the
accessor range and offset of 0) to an accessor(with a range
of 4 and an offset of 2).
Case 2:
There is a call handler copy method from an accessor(with a range
of 4 and an offset of 2) to a pointer (used the accessor range
and offset of 0).
Signed-off-by: Alexey Voronov [email protected]