Skip to content

[SYCL][Docs] Update sycl_ext_intel_usm_address_spaces and fix ctors #7680

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

Conversation

steffenlarsen
Copy link
Contributor

@steffenlarsen steffenlarsen commented Dec 7, 2022

This commit updates the sycl_ext_intel_usm_address_spaces extension to adhere to SYCL 2020 multi_ptr and updates the extension specification to use the new extension template.

Additionally this commit fixes the multi_ptr constructors for the extension address spaces.

This commit updates the sycl_ext_intel_usm_address_spaces extension to
adhere to SYCL 2020 multi_ptr and updates the extension specification to
use the new extension template. The extension is moved from draft to
experimental.

Additionally this commit fixes the multi_ptr constructors for the
extension address spaces.

Signed-off-by: Larsen, Steffen <[email protected]>
@steffenlarsen
Copy link
Contributor Author

@GarveyJoe & @gmlueck - The new extension template does not have the notion of a draft extension, so this moves sycl_ext_intel_usm_address_spaces to experimental. Any objections?

@steffenlarsen
Copy link
Contributor Author

/verify with intel/llvm-test-suite#1439

@gmlueck
Copy link
Contributor

gmlueck commented Dec 7, 2022

The new extension template does not have the notion of a draft extension, so this moves sycl_ext_intel_usm_address_spaces to experimental. Any objections?

The previous extension was "supported" not "draft". I don't mind making it "experimental", but I was under the impression that the FPGA team needed this to be "supported".

Do the changes in this PR break compatibility with existing code?

@steffenlarsen
Copy link
Contributor Author

The previous extension was "supported" not "draft". I don't mind making it "experimental", but I was under the impression that the FPGA team needed this to be "supported".

It was under the supported folder, but the extension specification stated that the extension itself was in draft state, with roughly the same disclaimers as we use for experimental.

Do the changes in this PR break compatibility with existing code?

It should not. It just ensures it works correctly for non-legacy multi_ptr. It was not correctly tested before because to use the right address space we currently require __ENABLE_USM_ADDR_SPACE__ to be defined. intel/llvm-test-suite#1439 should ensure we continue to test this.


template<typename ElementType, access::decorated IsDecorated = access::decorated::legacy>
using host_ptr = multi_ptr<ElementType, access::address_space::ext_intel_global_host_space, IsDecorated>
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify which namespace these are in. I think they are currently in sycl, but that's not the right place. They should either be in sycl::ext::intel or sycl::ext::intel::experimental, depending on the status of this extension.

I think we should deprecate the existing aliases and add new ones in the correct namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently it is in the sycl namespace, but I agree they should be moved. Should we also add raw_ and decorated_ variants while we are in here? @GarveyJoe - Are you okay if we just move them or would you prefer we keep the old ones in the sycl namespace as deprecated for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep the old ones working with deprecation warnings for now so that we can migrate gradually. FYI, @ajaykumarkannan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a deprecation warning to the sycl::{device|host}_ptr aliases, but it seems that clang isn't handling deprecations of templated aliases correctly at the moment, so users won't be told until that is fixed.

The new pointer aliases are:

  • sycl::ext::intel::device_ptr
  • sycl::ext::intel::raw_device_ptr
  • sycl::ext::intel::decorated_device_ptr
  • sycl::ext::intel::host_ptr
  • sycl::ext::intel::raw_host_ptr
  • sycl::ext::intel::decorated_host_ptr

following the same definitions as other pointer aliases with similar naming in SYCL 2020.

@@ -356,6 +356,17 @@ template <typename ToT, typename FromT> inline ToT cast_AS(FromT from) {
return reinterpret_cast<ToT>(from);
#endif // defined(__NVPTX__) || defined(__AMDGCN__)
} else
#ifdef __ENABLE_USM_ADDR_SPACE__
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this extension is only enabled if the user defines this macro? That isn't consistent with other extensions and it isn't documented in the extension specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that if this isn't defined it will just use the same address space qualifier as for global_space, so the extension is still supported but does not have much of an effect.

@gmlueck
Copy link
Contributor

gmlueck commented Dec 7, 2022

It was under the supported folder, but the extension specification stated that the extension itself was in draft state, with roughly the same disclaimers as we use for experimental.

The language evolution team discussed this in the past and decided that the "Draft" notice in the extension specifications was not a reliable indication that the extension was unsupported. This is left over from before we had an official extension spec template, and virtually all of the old extensions said they were "Draft".

BTW, thanks for taking the time to migrate this spec to the new template. We have a number of old specifications that should be migrated, and it's good to chip away at the backlog.

Signed-off-by: Larsen, Steffen <[email protected]>
@GarveyJoe
Copy link
Contributor

I second Greg's comments about the "draft" not being reliable. This extension is fully supported and being used by customers today. Can we keep the new version under "supported" and make sure that any functional changes are staged to cause minimal migration pain?

@steffenlarsen
Copy link
Contributor Author

I second Greg's comments about the "draft" not being reliable. This extension is fully supported and being used by customers today. Can we keep the new version under "supported" and make sure that any functional changes are staged to cause minimal migration pain?

Thank you, @GarveyJoe! It has been moved back to supported and as such I have incremented the feature-test macro to indicate the change.

Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

The extension is moved from draft to experimental.

You probably want to edit your first PR comment to remove this sentence, so it doesn't appear in the final squashed commit message.

@steffenlarsen
Copy link
Contributor Author

You probably want to edit your first PR comment to remove this sentence, so it doesn't appear in the final squashed commit message.

I have changed the description of the PR which should be what we normally reflect in the merge commit. Changing the description of the first PR would require a force-push which we generally try to avoid as it makes github trip for reviewers.

@gmlueck
Copy link
Contributor

gmlueck commented Dec 8, 2022

I have changed the description of the PR which should be what we normally reflect in the merge commit. Changing the description of the first PR would require a force-push which we generally try to avoid as it makes github trip for reviewers.

Yes, that's what I mean. Your term "description of the PR" is what I meant by "first PR comment".

@steffenlarsen
Copy link
Contributor Author

@GarveyJoe - Are you happy with the changes?

@steffenlarsen steffenlarsen merged commit 4a9e9a0 into intel:sycl Dec 12, 2022
steffenlarsen added a commit to steffenlarsen/llvm that referenced this pull request Dec 16, 2022
intel#7680 deprecated device_ptr and
host_ptr under the sycl namespace and intended to add them under the
sycl::ext::intel namespace instead, but did not. This commit adds them
to the namespace as originally intended. They are already implemented in
the extension headers.

Signed-off-by: Larsen, Steffen <[email protected]>
pvchupin pushed a commit that referenced this pull request Dec 21, 2022
#7680 deprecated device_ptr and
host_ptr under the sycl namespace and intended to add them under the
sycl::ext::intel namespace instead, but did not. This commit adds them
to the namespace as originally intended. They are already implemented in
the extension headers.

Signed-off-by: Larsen, Steffen <[email protected]>
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Apr 1, 2024
They have been deprecated in intel#7680
more than a year ago.
aelovikov-intel added a commit that referenced this pull request Apr 2, 2024
They have been deprecated in #7680
more than a year ago.

---------

Co-authored-by: Greg Lueck <[email protected]>
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.

4 participants