Skip to content

[SYCL] accessor::get_pointer() should always return base pointer, even for offset accessors #4687

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

Merged
merged 6 commits into from
Nov 30, 2021

Conversation

cperkinsintel
Copy link
Contributor

@cperkinsintel cperkinsintel commented Oct 1, 2021

According to the SYCL 2020 spec get_pointer() returns a pointer to the beginning of the underlying buffer, even if it is offset. Presently our get_pointer() implementation returns an offset pointer when using an offset accessor. This PR fixes this.

The Jenkins Summary is failing because the CTS tests have not been updated for this requirement. I have a PR introducing this update on the CTS used by the CI system.

Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
@cperkinsintel cperkinsintel marked this pull request as ready for review October 4, 2021 18:32
@cperkinsintel cperkinsintel requested review from againull and a team as code owners October 4, 2021 18:32
@cperkinsintel cperkinsintel changed the title [WIP] accessor::get_pointer() should always return base pointer, even for offset accessors [SYCL] accessor::get_pointer() should always return base pointer, even for offset accessors Oct 4, 2021
Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
@romanovvlad
Copy link
Contributor

Couldn't it break some users that already rely on "incorrect" behavior? If so, probably we cannot just change it now, we need to go through deprecation process.

@romanovvlad
Copy link
Contributor

/summary:run

@rolandschulz
Copy link
Contributor

rolandschulz commented Oct 7, 2021

Couldn't it break some users that already rely on "incorrect" behavior?

yes

If so, probably we cannot just change it now, we need to go through deprecation process.

What do you suggest? We can't deprecate the function because the function was there and is there. It just has the wrong behavior. I suggest that we need some other solution (e.g. clang-tidy).

@cperkinsintel
Copy link
Contributor Author

/summary:run

@bader
Copy link
Contributor

bader commented Nov 26, 2021

@intel/llvm-reviewers-runtime, ping.

Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM

@bader
Copy link
Contributor

bader commented Nov 27, 2021

/summary:run

@bader
Copy link
Contributor

bader commented Nov 29, 2021

@againull, ping.

@@ -86,7 +86,7 @@ void stream_impl::flush() {
.get_access<access::mode::read_write, access::target::host_buffer>(
cgh);
cgh.host_task([=] {
printf("%s", BufHostAcc.get_pointer());
printf("%s", &(BufHostAcc[0]));
Copy link
Contributor

Choose a reason for hiding this comment

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

@againull, I'm going to merge this PR. Feel free to review anyway.

@bader bader merged commit 59fcb82 into intel:sycl Nov 30, 2021
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.

5 participants