Skip to content

[SYCL] Implement multi_ptr default to be legacy to avoid code break with SYCL 1.2.1 #10174

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 15 commits into from
Jul 11, 2023

Conversation

mmoadeli
Copy link
Contributor

@mmoadeli mmoadeli commented Jul 3, 2023

  • This PR covers updates in Default multi_ptr to legacy to avoid code break with SYCL 1.2.1
  • Declare access::decorated::legacy as deprecated.
  • Revert get_pointer interface for device, host and local_accessor back to 1.2.1 version.
  • enable_if async_work_group_copy in group.hpp and nd_item.hpp to ensure Dst and Src(const / non-const) have the same type.
  • Add multi_ptr::get_raw and multi_ptr::get_decorated member functions to the access::decorated::legacy specialization of multi_ptr.

mmoadeli added 5 commits June 28, 2023 11:58
…to the access::decorated::legacy specialization of multi_ptr
…ck to 1.2.1 version.

- enable_if async_work_group_copy in group.hpp and nd_item.hpp when Dst and Src have the same type.
- Update tests to reflect deprecating access::decorated::legacy
@mmoadeli mmoadeli requested review from a team as code owners July 3, 2023 10:51
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 11:24 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 12:35 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 12:37 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 13:57 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 14:20 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 15:11 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 16:19 — with GitHub Actions Inactive
@@ -662,6 +662,7 @@ class multi_ptr<void, Space, DecorateAddress> {
template <typename ElementType, access::address_space Space>
class multi_ptr<ElementType, Space, access::decorated::legacy> {
public:
using value_type = ElementType;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not actually part of the spec, even after the changes from the mentioned spec PR. I have made a comment on it: https://github.com/KhronosGroup/SYCL-Docs/pull/432/files#r1251095640, but we should not add interfaces that aren't part of the spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @steffenlarsen. I agree with you on above.
I would add it to spec for consistency with others.

Copy link
Contributor

@AerialMantis AerialMantis Jul 4, 2023

Choose a reason for hiding this comment

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

This is a good catch, the PR used value_type and it wasn't defined, I've created a new PR to make a change to the spec to introduce this (KhronosGroup/SYCL-Docs#437), so I think this change will be okay after that is merged.

@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 16:39 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 17:21 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 18:18 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 18:40 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 3, 2023 19:18 — with GitHub Actions Inactive
Copy link
Contributor

@AerialMantis AerialMantis left a comment

Choose a reason for hiding this comment

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

Changes look good to me, thanks!

@@ -662,6 +662,7 @@ class multi_ptr<void, Space, DecorateAddress> {
template <typename ElementType, access::address_space Space>
class multi_ptr<ElementType, Space, access::decorated::legacy> {
public:
using value_type = ElementType;
Copy link
Contributor

@AerialMantis AerialMantis Jul 4, 2023

Choose a reason for hiding this comment

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

This is a good catch, the PR used value_type and it wasn't defined, I've created a new PR to make a change to the spec to introduce this (KhronosGroup/SYCL-Docs#437), so I think this change will be okay after that is merged.

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

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

@intel/sycl-language-enabling-triage: FYI

@@ -1,12 +1,12 @@
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify %s -o %t.out
// expected-no-diagnostics
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that deprecation decorated::legacy deprecation warnings are not the main thing we want to test here. Therefore, we can consider adding -Wno-deprecated and leave the test as-is, i.e. expecting no diagnostics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @AlexeySachkov , good point.

…ation.

- Add get_raw / get_decorated in  multi_ptr void/const void/ legacy specialisation.
@mmoadeli mmoadeli temporarily deployed to aws July 5, 2023 09:37 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 5, 2023 10:16 — with GitHub Actions Inactive
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM!

"accessor::get_pointer() is deprecated, please use get_multi_ptr()")
global_ptr<DataT> get_pointer() const noexcept {
return global_ptr<DataT>(
const_cast<typename detail::DecoratedType<DataT, AS>::type *>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Discussed offline. The deprecated API tries to be in line with SYCL 1.2.1, which means returning a DataT pointer. However, with SYCL 2020 the value-type is changed to const when it is read-only. Instead of changing the internal representation, const_cast for this deprecated API seemed like the lesser evil.

@mmoadeli mmoadeli temporarily deployed to aws July 5, 2023 18:15 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 5, 2023 19:47 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 6, 2023 11:10 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 6, 2023 11:10 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 6, 2023 12:02 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 6, 2023 12:03 — with GitHub Actions Inactive
@mmoadeli
Copy link
Contributor Author

mmoadeli commented Jul 6, 2023

a friendly request for review please. @intel/dpcpp-esimd-reviewers

@mmoadeli
Copy link
Contributor Author

friendly request for review please. https://github.com/orgs/intel/teams/dpcpp-esimd-reviewers

@mmoadeli mmoadeli temporarily deployed to aws July 10, 2023 18:53 — with GitHub Actions Inactive
@mmoadeli mmoadeli temporarily deployed to aws July 10, 2023 19:32 — with GitHub Actions Inactive
@steffenlarsen steffenlarsen merged commit 52edb37 into intel:sycl Jul 11, 2023
@mmoadeli mmoadeli deleted the get_decorated-get_raw branch July 11, 2023 09:46
@mmoadeli mmoadeli changed the title Implement multi_ptr default to be legacy to avoid code break with SYCL 1.2.1 [SYCL] Implement multi_ptr default to be legacy to avoid code break with SYCL 1.2.1 Jul 14, 2023
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