Skip to content
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][Docs] Allow copy-construction of device_global #15075

Merged

Conversation

steffenlarsen
Copy link
Contributor

This commit makes it possible to copy-construct device_global variables if they do not have the device_image_scope property. The restriction on device_image_scope is due to static construction not being allowed in device code, which they would require, while other device_globals have USM storage which will be initialized by the host code, so the constructor on the device is a simple zero-initialization.

This commit makes it possible to copy-construct device_global variables
if they do not have the device_image_scope property. The restriction on
device_image_scope is due to static construction not being allowed in
device code, which they would require, while other device_globals have
USM storage which will be initialized by the host code, so the
constructor on the device is a simple zero-initialization.

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

gmlueck commented Aug 29, 2024

@steffenlarsen: I'm catching up on things, and saw this in my inbox. Are you still looking for comments? I see that the PR is "draft".

@steffenlarsen
Copy link
Contributor Author

@steffenlarsen: I'm catching up on things, and saw this in my inbox. Are you still looking for comments? I see that the PR is "draft".

Currently I am waiting for internal response with respect to how we should handle the case that @Pennycook
brewed up in #15075 (comment).

@steffenlarsen steffenlarsen marked this pull request as ready for review October 22, 2024 12:08
@steffenlarsen steffenlarsen requested review from a team as code owners October 22, 2024 12:08
@steffenlarsen
Copy link
Contributor Author

We have agreed that the added complexity added with doing full feature parity with CUDA in the (expectedly rare) dlopen case is not worth the benefit. If we want it in the future, we can adjust the implementation. As such, this is ready for review.

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

@Pennycook Pennycook left a comment

Choose a reason for hiding this comment

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

Spotted two small typos, but otherwise the latest changes LGTM.

@steffenlarsen steffenlarsen merged commit e6e45d0 into intel:sycl Oct 31, 2024
14 checks passed
@steffenlarsen steffenlarsen deleted the steffen/allow_copy_ctor_device_global branch October 31, 2024 06:35
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