[CUDA][HIP] Fix kernel arguments being overwritten when added out of order#2559
Merged
kbenzie merged 4 commits intooneapi-src:mainfrom Jan 23, 2025
Merged
[CUDA][HIP] Fix kernel arguments being overwritten when added out of order#2559kbenzie merged 4 commits intooneapi-src:mainfrom
kbenzie merged 4 commits intooneapi-src:mainfrom
Conversation
4400095 to
7ca2133
Compare
ccccf85 to
0a071be
Compare
EwanC
reviewed
Jan 15, 2025
Contributor
EwanC
left a comment
There was a problem hiding this comment.
Could we add CTS tests for this? Probably in test/conformance/exp_command_buffer/update/local_memory_update.cpp & test/conformance/kernel/urKernelSetArgLocal.cpp
Might make it easier if we want to merge this fix earlier than the intel/llvm#16573 feature
86885a1 to
bf6b6f9
Compare
frasercrmck
reviewed
Jan 15, 2025
EwanC
approved these changes
Jan 20, 2025
test/conformance/exp_command_buffer/update/local_memory_update.cpp
Outdated
Show resolved
Hide resolved
added 2 commits
January 21, 2025 14:21
In the Cuda and Hip adapter, when kernel arguments are added out of order (e.g. argument at index 1 is added before argument at index 0), the existing arguments are currently being overwritten. This happens because some of the argument sizes might not be known when adding them out of order and the code relies on those sizes to choose where to store the argument. This commit avoids this issue by storing the arguments in the same order that they are added and accessing them using pointer offsets.
27a3561 to
e3dcfc3
Compare
aarongreig
approved these changes
Jan 22, 2025
a6c39c4 to
f98229f
Compare
frasercrmck
approved these changes
Jan 22, 2025
martygrant
pushed a commit
to intel/llvm
that referenced
this pull request
Jan 24, 2025
…ers (#16733) oneapi-src/unified-runtime#2559 --------- Co-authored-by: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the Cuda and Hip adapter, when kernel arguments are added out of order (e.g. argument at index 1 is added before argument at index 0), the existing arguments are currently being overwritten. This happens because some of the argument sizes might not be known when adding them out of order and the code relies on those sizes to choose where to store the argument.
This PR avoids this issue by storing the arguments in the same order that they are added and accessing them using pointer offsets.
intel/llvm: intel/llvm#16733