Skip to content

[SYCL][HIP] Fix sycl-ls with HIP devices #4698

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

Closed
wants to merge 1 commit into from

Conversation

npmiller
Copy link
Contributor

@npmiller npmiller commented Oct 4, 2021

The issue is that sycl-ls uses the backend type enum value to index an
array of the size of all, which when used on a system with HIP devices
available would cause out of bounds accesses.

The issue is that `sycl-ls` uses the backend type enum value to index an
array of the size of `all`, which when used on a system with HIP devices
available would cause out of bounds accesses.
@npmiller npmiller requested a review from a team as a code owner October 4, 2021 17:23
Comment on lines +28 to +30
hip = 4,
all = 5,
esimd_cpu = 6,
Copy link
Contributor

Choose a reason for hiding this comment

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

Modifying the existing values of this enum will break ABI compatibility. I would suggest fixing the issue in sycl-ls instead, so that it does not rely on the underlying value of all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh that makes sense, and I guess all here is actually more to use with the selectors than to indicate the size of the enum, I'll look into updating sycl-ls instead.

@npmiller
Copy link
Contributor Author

npmiller commented Oct 5, 2021

Closing this, I'll open a different PR with a re-work of sycl-ls.

@npmiller npmiller closed this Oct 5, 2021
npmiller added a commit to npmiller/llvm that referenced this pull request Oct 5, 2021
This fixes two issues, first `backend::all` is not guaranteed to be the
last entry in the backend types enum and shouldn't be used as such. This
caused issues for newer backends such as HIP (see intel#4698).

The second issue is that the `DeviceNums` vector wasn't being reset
between the short output and the verbose output which meant that the
device indices printed in the verbose output were incorrect.
@npmiller
Copy link
Contributor Author

npmiller commented Oct 5, 2021

See: #4704

bader pushed a commit that referenced this pull request Oct 6, 2021
This fixes two issues, first `backend::all` is not guaranteed to be the
last entry in the backend types enum and shouldn't be used as such. This
caused issues for newer backends such as HIP (see #4698).

The second issue is that the `DeviceNums` vector wasn't being reset
between the short output and the verbose output which meant that the
device indices printed in the verbose output were incorrect.
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.

2 participants