Draft
Conversation
When a kernel has multiple top-level for loops, each becomes a separate GPU kernel. This adds a `name` parameter to `qd.loop_config()` that propagates through the compilation pipeline and appears in the compiled kernel names, making them identifiable in profilers and traces. Example: `qd.loop_config(name="compute_forces")` produces kernel names like `my_kernel_c0_abc_0_compute_forces_range_for` instead of the generic `my_kernel_c0_abc_0_range_for`. The loop_name also appears in IR dumps (QD_DUMP_IR=1) as `loop_name=...` on offloaded range_for/struct_for statements. Includes 6 unit tests covering correctness, name propagation in IR dumps, no-leak between loops, mixed named/unnamed, and serialize combo.
The clone() methods for RangeForStmt, StructForStmt, and OffloadedStmt were not copying the loop_name field. Since the LLVM codegen clones each offloaded task before compilation, the user-provided loop name was lost.
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.
Issue: #
Brief Summary
copilot:summary
Walkthrough
copilot:walkthrough