-
Notifications
You must be signed in to change notification settings - Fork 123
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
[CUDA][HIP] Fix kernel arguments being overwritten when added out of order #2559
Merged
Conversation
This file contains 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
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
fabiomestre
changed the title
Fix kernel argument indices bug
[CUDA][HIP] Fix kernel arguments being overriden when added out of order
Jan 14, 2025
EwanC
reviewed
Jan 15, 2025
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.
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
frasercrmck
reviewed
Jan 15, 2025
fabiomestre
changed the title
[CUDA][HIP] Fix kernel arguments being overriden when added out of order
[CUDA][HIP] Fix kernel arguments being overwritten when added out of order
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
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.
github-actions
bot
added
the
command-buffer
Command Buffer feature addition/changes/specification
label
Jan 21, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
command-buffer
Command Buffer feature addition/changes/specification
conformance
Conformance test suite issues.
cuda
CUDA adapter specific issues
hip
HIP adapter specific issues
ready to merge
Added to PR's which are ready to merge
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