Add support for Type arguments and fix static parameter codegen#181
Merged
maleadt merged 5 commits intoJuliaGPU:mainfrom Apr 8, 2026
Merged
Add support for Type arguments and fix static parameter codegen#181maleadt merged 5 commits intoJuliaGPU:mainfrom
Type arguments and fix static parameter codegen#181maleadt merged 5 commits intoJuliaGPU:mainfrom
Conversation
Enable `Constant(T)` where `T` is a type (e.g., `Constant(Int)`) to
produce `Constant{Type{T}, T}` instead of `Constant{DataType, T}`,
so method dispatch correctly binds type parameters.
Handle `:static_parameter` expressions in codegen by looking up
concrete values from the method's sptypes, unwrapping VarState and
Const wrappers.
Also fix `IndexedUseRef` qualification in walk_uses! and guard
scalar_elim_pass! against TokenType annotations.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
ea6792d to
309c0d6
Compare
vchuravy
reviewed
Apr 7, 2026
Constant(::Type) support and fix static parameter codegen
Constant(::Type) support and fix static parameter codegenType arguments and fix static parameter codegen
Contributor
Author
|
Changing the scope of the PR slightly to support |
maleadt
approved these changes
Apr 8, 2026
Member
|
Auto-wrapping as Const is pretty neat. I guess it gives us automatic specialization, i.e., without users having to write a kernel like |
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.
Constant(val::Type{T})constructor soConstant(Int)producesConstant{Type{Int}, Int}instead ofConstant{DataType, Int}, correctly binding type parameters in method dispatch:static_parameterexpressions in codegen (lookup from sptypes, unwrap VarState/Const)IRStructurizer.IndexedUseRefinwalk_uses!scalar_elim_pass!againstTokenTypeannotationsto_tile_arg(t::Type) = Constant(t)to allow type arguments without the need forConstant