-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[FFI] Replace Arg2Str with a more powerful for_each
#18117
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
Merged
Merged
Conversation
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
for_eachArg2Str with a more powerful for_each
Hzfengsy
approved these changes
Jul 6, 2025
Member
|
Thanks for the contribution, for this particular case, let us remain as simplified as original version, mainly for the reason of simplicity and readability. We want to avoid indirections and polymorphism in template overloading, likely also simplifies compile time |
tqchen
added a commit
that referenced
this pull request
Jul 7, 2025
…)" This reverts commit 49b139b.
Member
|
followup on #18121 |
ShiboXing
pushed a commit
to ShiboXing/tvm
that referenced
this pull request
Aug 10, 2025
[FFI] Replace Arg2Str with a more powerful for_each
ShiboXing
pushed a commit
to ShiboXing/tvm
that referenced
this pull request
Aug 10, 2025
…che#18121) Revert "[FFI] Replace `Arg2Str` with a more powerful `for_each` (apache#18117)" This reverts commit 49b139b.
tqchen
pushed a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
[FFI] Replace Arg2Str with a more powerful for_each
tqchen
added a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
…che#18121) Revert "[FFI] Replace `Arg2Str` with a more powerful `for_each` (apache#18117)" This reverts commit ad328f5.
tqchen
pushed a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
[FFI] Replace Arg2Str with a more powerful for_each
tqchen
added a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
…che#18121) Revert "[FFI] Replace `Arg2Str` with a more powerful `for_each` (apache#18117)" This reverts commit ad328f5.
tqchen
pushed a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
[FFI] Replace Arg2Str with a more powerful for_each
tqchen
added a commit
to tqchen/tvm
that referenced
this pull request
Sep 13, 2025
…che#18121) Revert "[FFI] Replace `Arg2Str` with a more powerful `for_each` (apache#18117)" This reverts commit ad328f5.
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.
Currently
for_eachaccepts a callable with parameters typed(size_t, Arg).In this PR we extend it to three kinds of parameter types:
(size_t, Arg): same as original one(Arg):size_tcan be omitted if possible(std::integral_constant<size_t, I>, Arg): the index is passed as aconstexprvalue so that it can be used in template arguments (e.g. forstd::get<I>) andif constexprs.Also as a demonstration we replace the
struct Arg2Strwith a simplefor_eachcall.