forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] [llvm] Allocate the runtime context for real functions on …
…the stack (taichi-dev#7971) Issue: # ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at a4f1255</samp> This pull request removes the `gc_rc` task type and the runtime context buffer from the codebase. These were used to perform garbage collection on the memory pool that stored the runtime context for each offloaded task. However, they are no longer needed as the runtime context is now allocated on the stack instead of the heap. This simplifies the codegen and runtime logic and reduces the memory and performance overhead of the LLVM and CUDA backends. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at a4f1255</samp> * Remove the gc_rc task type and its related code, as it is no longer needed for the runtime context management ([link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-331e185d09584e49150b1695bf6ecc1c3b558b805075984750bb94f4de508975L7), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-05e2a2d0a9c9879a4fb5fde9baf5a43738c7601fc53e234a40ab9bc27d1512a5L321-L322), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-917d9436dcaafa0f1e41ae9bad90273a303f036f00da94e417788a7fa1dc5260L1363-R1363), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-77422b8748a46e70519217be594cd28433edadf98ca4960ce116f85da8dbccc3L658-L659), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-d47b571f975c1002b8cb93634ac2a3d5f090f3fa9676ec3e0004c2ec4116ee21L696-L702)) * Remove the codegen functions and branches for the gc_rc task type in the CPU, CUDA, and LLVM backends (`codegen_cpu.cpp`, `codegen_cuda.cpp`, `codegen_llvm.cpp`, `codegen_llvm.h`) ([link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-b6e86fbdf536db46b321f67942f66d809c213a4142ceb9f5f81d016684c2d5c8L190-L191), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-50537ad5ea3b900c0d55a088f3cc285986340ad68c9b96fea481187c4dce49eaL559-L588), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-50537ad5ea3b900c0d55a088f3cc285986340ad68c9b96fea481187c4dce49eaL633-L634), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L1134-L1137), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L2776-R2772), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L2795), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-aebc3d71bb555fba77f1d303d5c29ac7e07d392440b0e54cf556ff5a10a81d0aL167)) * Modify the codegen function for the func_call task type in the LLVM backend to allocate the runtime context on the stack instead of the heap (`codegen_llvm.cpp`) ([link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L2776-R2772), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L2795)) * Remove the initialization and management of the runtime context buffer in the LLVM runtime executor and module (`llvm_runtime_executor.cpp`, `runtime.cpp`) ([link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-b9155792159f392bd8bacd44cb1819be5239b022d707499fc364c0f93dd8c5e5L700-L703), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L561), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L869-L877), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L955-L959), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L1670-L1673), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L1705-L1709), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L1727-L1731), [link](https://github.com/taichi-dev/taichi/pull/7971/files?diff=unified&w=0#diff-980b2254ce0f4c654a946673ab6cd7a84f78cc6f0d6560bc1361670ec6e678c4L1775-R1746))
- Loading branch information
1 parent
89db415
commit c3e1d3f
Showing
11 changed files
with
2 additions
and
93 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ PER_TASK_TYPE(struct_for) | |
PER_TASK_TYPE(mesh_for) | ||
PER_TASK_TYPE(listgen) | ||
PER_TASK_TYPE(gc) | ||
PER_TASK_TYPE(gc_rc) |
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
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
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