-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL] Add clang support for device_global #5597
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
Conversation
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.
The functional part (under it I mean the changes described by design doc - https://github.com/intel/llvm/blob/sycl/sycl/doc/design/DeviceGlobal.md, i.e. everything except diagnostics) looks ok to me. Let's focus on that and add some testing:
- We need IR checking that
sycl-unique-id
is properly attached - We need Sema test checking that
device_global
variable can be captured to SYCL kernel.
- Check type of the variable, not the variable itself when checking presence of the attribute - Fix generation of LLVM IR attribute - Add the CodeGen test
@schittir, please fix the conflicts |
Done. |
I am not sure how to reproduce the failing "timed-out" tests. |
@schittir I am seeing same timeout test issue in other PR's (#4533 (comment)) I am seeing same timeout test issue in other PR's (#5782) Both failures are unrelated to your patch. |
Thank you, Soumi! |
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.
Changes LGTM.
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.
Looks ok to me. But I'd like to get approve from @elizabethandrews too.
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!
ef0f5d0
@smanna12 @elizabethandrews could you please take a look again? |
Test failures unrelated to this PR. |
…5810) This PR is a follow up to PR #5597 to implement the diagnostics not covered in #5597 As it stands currently, this PR includes implementation for cases described in this documentation and their templated versions - https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_global.asciidoc#restrictions-on-creating-device-global-objects except the shadow variable/namespace case. Specifically, it covers cases where device_global is declared as a private member inside a struct and within methods inside struct, their template versions/instantiation and device_global array.
This patch implements the basic functionality and some diagnostics
for SYCL device_global attributes. The rest of the diagnostics are to
be added in a subsequent PR.
This patch includes:
[[__sycl_detail__::device_global]]
attribute and use it to checksome restrictions on variable declarations of device_global type
[[__sycl_detail__::global_variable_allowed]]
attribute and avoiddiagnosing err_sycl_restrict if variables of device_global type use it
"sycl-unique-id"
, an LLVM IR attribute, to provide a uniquestring identifier for each device global variable