One BEND_RTC macro for the six __CUDACC_RTC__ tests, and gpu_hash above the lanes - #963
Closed
costamatheus97 wants to merge 1 commit into
Closed
costamatheus97 wants to merge 1 commit into
costamatheus97 wants to merge 1 commit into
Conversation
…ve the lanes Two behaviour-neutral pieces of the HIP lane (bendlang#958, on `hip`) that do not depend on it, as offered there. BEND_RTC is defined when the file is compiled by the device's runtime compiler, and the six `__CUDACC_RTC__` tests read it. A second RTC lane then adds its macro to one definition and leaves the six sites alone. gpu_hash moves out of the CUDA block to just above the lane blocks, under `#if BEND_CUDA`. It reads only BEND_SRC and CUBE_LOG, so a lane that keeps a `.gpu` cache can share it by widening that one guard. With both on main, `hip` differs from main in shared code by `|| defined(__HIPCC_RTC__)` and `|| BEND_HIP` on those two lines.
costamatheus97
force-pushed
the
rtc-macro-gpu-hash
branch
from
September 21, 2026 15:04
65b32aa to
cf77970
Compare
VictorTaelin
pushed a commit
that referenced
this pull request
Sep 21, 2026
…ove the lanes A second runtime compiler adds its macro to one line; gpu_hash reads only BEND_SRC and CUBE_LOG, so it sits above the lane blocks where a lane that keeps a .gpu cache can share it. The preprocessed C is identical on the host, under CUDA RTC and under Metal. (PR #963)
Contributor
|
Merged into 2.0.25 under your authorship, thank you. We confirmed the preprocessed C is identical on the host, under CUDA RTC and under Metal, and the Metal tests pass here. Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
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.
The two pieces of the HIP lane (#958, merged to
hip) that do not depend on it, as offered in that thread. One commit onmainat e52cda4,bend2/comp.tsonly, +23 −14. No behaviour change.What it changes
BEND_RTC. Defined when the file is being compiled by the device's runtime compiler (#if defined(__CUDACC_RTC__)). The six__CUDACC_RTC__tests read it instead. A second RTC lane adds its macro to that one line and leaves the six sites alone.gpu_hash. Moved out of the CUDA block to just above the lane blocks, under#if BEND_CUDA. It reads onlyBEND_SRCandCUBE_LOG, both defined earlier. A lane that keeps a.gpucache shares it by widening that guard.hipalready builds and runs with the function at this position.With both on
main,hipdiffers frommainon these lines by|| defined(__HIPCC_RTC__)and|| BEND_HIP, which should keep its rebases quiet in shared code.Checks
I have no CUDA or Metal hardware, so the main check is on the preprocessor. I emitted C for
tests/run/gpu_mark.bendfrom pristinemainand from this branch, removed the#embed __FILE__line from both (the embedded text differs by construction), and comparedclang -E -Poutput:-D__CUDACC_RTC__-D__METAL_VERSION__-DBEND_CUDA=1(stubcuda.h/nvrtc.h)gpu_hashappears earliergates/test.ts's rules overgpu_*,compile_*,io_hello*,gfx_*: 120 / 122 on this branch and 120 / 122 on pristinemain. The two failures are the same on both,gfx_clicksandgfx_window, which need a display.comp.tsis 64967 tokens against the 65000 cap. I do not havettokhere; I counted withcl100k_base, which gives exactly your 64941 formainand 68028 forhip.gates/repo.tsneedsttok), the full test gate, anything on CUDA or Metal hardware.