-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lang] Feat: using magic number 32 to limit loop unrolling (#8169)
Issue: #8151 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 9662871</samp> Add a new option `ti_unroll_limit` to limit the unrolling of static for loops in `ASTTransformer`. This can improve performance and memory usage in some cases. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 9662871</samp> * Introduce a new class attribute `ti_unroll_limit` to store the maximum number of iterations that can be unrolled in a static for loop ([link](https://github.com/taichi-dev/taichi/pull/8169/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR1130)) * Modify the `build_static_for` method to check the loop iterator against the `ti_unroll_limit` and raise a syntax error if it exceeds the limit ([link](https://github.com/taichi-dev/taichi/pull/8169/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fL1139-R1144), [link](https://github.com/taichi-dev/taichi/pull/8169/files?diff=unified&w=0#diff-3e22417ffade4af0564893b98dc5101d714b8ba6fd4423ab5bc5129e360fee8fR1156-R1157)) --------- Co-authored-by: Lin Jiang <linjiang@taichi.graphics>
- Loading branch information
1 parent
b8ca066
commit 1eed2b9
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
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