Repository navigation
amdgpu: document that ds_permute/ds_bpermute take a byte address - #2258
Open
bernardogv wants to merge 1 commit into
Open
bernardogv wants to merge 1 commit into
bernardogv wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for the pull request, and welcome! The Rust Project has assigned @adamgemmell (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Why was this reviewer chosen?The reviewer was selected based on:
|
This branch has not been deployed
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.
The
laneargument ofcore::arch::amdgpu::ds_permuteandds_bpermuteis passed straight tollvm.amdgcn.ds_permute/llvm.amdgcn.ds_bpermute, which take a byte address like theds_permute_b32/ds_bpermute_b32instructions do. To address lanenyou passn * 4. The docs currently say "lane", which reads like a lane index, and passing one silently gives wrong results.This PR only changes the doc comments:
laneis a byte address (n * 4for lanen).ds_bpermute's doc said it returns the value "given tods_permute". It's thevaluegiven tods_bpermuteitself.Evidence, from a gfx1151 (RDNA 3.5, wave32) test. One wave, lane
ipasses100 + iand targets lane(i + 1) % 32:ds_permute(t, ..)[131, 106, 110, 114, 118, 122]t / 4ds_permute(t * 4, ..)[131, 100, 101, 102, 103, 104]ds_bpermute(t, ..)[100, 100, 100, 101, 101, 101]t / 4ds_bpermute(t * 4, ..)[101, 102, 103, 104, 105, 106]HIP's own
__shfl(hip/amd_detail/amd_warp_functions.h) does the same:__builtin_amdgcn_ds_bpermute(index << 2, var).I first hit this with a Rust warp reduction (
#![no_std],amdgcn-amd-amdhsa). Passing a bare lane tods_bpermutegave max |err| 0.23 against the reference until I switched tolane * 4.Tracking issue: rust-lang/rust#149988