Repository navigation
feat: add missing special registers (warpid, smid, gridid, smem_size) - #309
Merged
Merged
Conversation
49 tasks done
honeyspoon
force-pushed
the
add-special-registers-v2
branch
5 times, most recently
from
June 30, 2026 16:02
37202a2 to
f57797f
Compare
nihalpasham
force-pushed
the
add-special-registers-v2
branch
from
July 1, 2026 08:56
f57797f to
75d496f
Compare
Collaborator
|
Thanks for the PR. LGTM I layered a couple of changes on top
Also, verified the generated PTX with LLVM 21 and 22 and CUDA 13.3 |
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.
Summary
Add 7 PTX special register intrinsics across all four compiler layers
(cuda-device, dialect-nvvm, mir-importer, mir-lower):
warpid/nwarpid: hardware warp identification within the SMsmid/nsmid: streaming multiprocessor identificationgridid: grid launch identificationdynamic_smem_size/total_smem_size: shared memory size queriesAll follow the established zero-operand, single-i32-result LLVM NVVM
intrinsic pattern (same as
lane_id,lanemask_*).Ref #274 (Phase 4: Miscellaneous)
Test plan
cargo clippy -- -D warningsclean across all 4 cratescargo fmt --checkclean