[CUDA][HIP] Fix kernel arguments being overwritten when added out of order#2559
Merged
Conversation
fabiomestre
force-pushed
the
fix_kernel_arg_indices
branch
from
January 14, 2025 13:25
4400095 to
7ca2133
Compare
fabiomestre
force-pushed
the
fix_kernel_arg_indices
branch
3 times, most recently
from
January 14, 2025 15:25
ccccf85 to
0a071be
Compare
EwanC
reviewed
Jan 15, 2025
EwanC
left a comment
Contributor
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
fabiomestre
force-pushed
the
fix_kernel_arg_indices
branch
from
January 15, 2025 14:57
86885a1 to
bf6b6f9
Compare
fabiomestre
marked this pull request as ready for review
January 15, 2025 14:58
frasercrmck
reviewed
Jan 15, 2025
EwanC
approved these changes
Jan 20, 2025
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.
fabiomestre
force-pushed
the
fix_kernel_arg_indices
branch
from
January 21, 2025 14:23
27a3561 to
e3dcfc3
Compare
aarongreig
approved these changes
Jan 22, 2025
fabiomestre
force-pushed
the
fix_kernel_arg_indices
branch
from
January 22, 2025 14:02
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