Skip to content

Conversation

schittir
Copy link
Contributor

@schittir schittir commented Feb 16, 2022

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:

  1. Add [[__sycl_detail__::device_global]] attribute and use it to check
    some restrictions on variable declarations of device_global type
  2. Add [[__sycl_detail__::global_variable_allowed]] attribute and avoid
    diagnosing err_sycl_restrict if variables of device_global type use it
  3. Adds "sycl-unique-id", an LLVM IR attribute, to provide a unique
    string identifier for each device global variable

Copy link
Contributor

@Fznamznon Fznamznon left a 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.

schittir and others added 3 commits February 17, 2022 10:18
- 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 schittir marked this pull request as ready for review March 3, 2022 18:55
@schittir schittir requested a review from a team as a code owner March 3, 2022 18:55
@smanna12
Copy link
Contributor

smanna12 commented Mar 3, 2022

@schittir, please fix the conflicts

@schittir
Copy link
Contributor Author

Please also update PR description to include note about upcoming patch which covers diagnostics.

Done.

@schittir
Copy link
Contributor Author

I am not sure how to reproduce the failing "timed-out" tests.
SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp test failed with the latest commit, whereas the last time, SYCL :: ESIMD/kmeans/kmeans.cpp failed. The latter doesn't fail anymore, leading me to think that these are flaky...
I will look into this more, but if anybody has any thoughts or previous experience with this, please feel free to share. Thank you.

@smanna12
Copy link
Contributor

smanna12 commented Mar 13, 2022

I am not sure how to reproduce the failing "timed-out" tests. SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp test failed with the latest commit, whereas the last time, SYCL :: ESIMD/kmeans/kmeans.cpp failed. The latter doesn't fail anymore, leading me to think that these are flaky... I will look into this more, but if anybody has any thoughts or previous experience with this, please feel free to share. Thank you.

@schittir I am seeing same timeout test issue in other PR's (#4533 (comment))
https://github.com/intel/llvm/runs/5518378302?check_suite_focus=true
Timed Out Tests (1):
SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp

I am seeing same timeout test issue in other PR's (#5782)
https://github.com/intel/llvm/runs/5518378332?check_suite_focus=true
Timed Out Tests (1):
SYCL :: ESIMD/kmeans/kmeans.cpp

Both failures are unrelated to your patch.

@schittir
Copy link
Contributor Author

I am not sure how to reproduce the failing "timed-out" tests. SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp test failed with the latest commit, whereas the last time, SYCL :: ESIMD/kmeans/kmeans.cpp failed. The latter doesn't fail anymore, leading me to think that these are flaky... I will look into this more, but if anybody has any thoughts or previous experience with this, please feel free to share. Thank you.

@schittir I am seeing same timeout test issue in other PR's (#4533 (comment)) https://github.com/intel/llvm/runs/5518378302?check_suite_focus=true Timed Out Tests (1): SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp

I am seeing same timeout test issue in other PR's (#5782) https://github.com/intel/llvm/runs/5518378332?check_suite_focus=true Timed Out Tests (1): SYCL :: ESIMD/kmeans/kmeans.cpp

Both failures are unrelated to your patch.

Thank you, Soumi!

smanna12
smanna12 previously approved these changes Mar 14, 2022
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

Changes LGTM.

Copy link
Contributor

@Fznamznon Fznamznon left a 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.

Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@schittir
Copy link
Contributor Author

@smanna12 @elizabethandrews could you please take a look again?

@schittir
Copy link
Contributor Author

Test failures unrelated to this PR.
The following timed-out:
SYCL :: KernelAndProgram/multiple-kernel-linking.cpp
SYCL :: Plugin/level_zero_batch_test.cpp
SYCL :: Plugin/level_zero_batch_test_copy_with_compute.cpp
SYCL :: Plugin/retain_events.cpp
SYCL :: Printf/float.cpp
SYCL :: USM/copy.cpp

@bader bader merged commit c42abb5 into intel:sycl Mar 16, 2022
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.

9 participants