[Common] Fix "0" literal for compilation#2934
Conversation
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Greptile SummaryThis PR fixes a compilation ambiguity in CUDA 12.1 by replacing Confidence Score: 5/5Safe to merge — single-line, correctness-only fix with no behavioural changes at runtime. The change is minimal and provably correct: all instantiated types (float, fp16, bf16, fp8e4m3, fp8e5m2, int32_t, etc.) accept a float argument in a static_cast. No other instances of the ambiguous pattern remain in the file, and the fix directly targets the reported CUDA 12.1 compilation failure. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["permute_vec_loop<T>(...)"] --> B["Copy input data\n(vectorised loop)"]
B --> C{D_out > D?}
C -- No --> E[Return]
C -- Yes --> D["Padding zero-fill loop\nout[...] = static_cast<T>(0.f)"]
D --> E
style D fill:#d4edda,stroke:#28a745
Reviews (1): Last reviewed commit: "fix 0 literal" | Re-trigger Greptile |
Description
This PR fixes a zero-init ambiguity for CUDA 12.1 (used in GitHub CI). By using a floating zero literal,
static_cast<T>(0.f)goes down thefloatconstructor unambiguously.Type of change
Changes
See Description.
Checklist: