Skip to content

More nightly compiler fixes#1169

Merged
cliffburdick merged 3 commits into
mainfrom
cliffburdick-patch-1
May 7, 2026
Merged

More nightly compiler fixes#1169
cliffburdick merged 3 commits into
mainfrom
cliffburdick-patch-1

Conversation

@cliffburdick
Copy link
Copy Markdown
Collaborator

No description provided.

@cliffburdick
Copy link
Copy Markdown
Collaborator Author

/build

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR applies three targeted nightly-compiler fixes across the matx library — value-initializing a zero-element array, removing an unnecessary else branch on a if constexpr, and annotating two constexpr booleans with [[maybe_unused]]. All changes are mechanical warning-suppression patches with no behavioral impact.

  • make_tensor.h: cuda::std::array<index_t, 0> shape{} adds value-initialization to a zero-element array, silencing an uninitialized-variable diagnostic from newer compiler front-ends.
  • collapse.h: input_rank is now default-initialized to T1::Rank() and conditionally overridden in the dynamic-rank branch, logically equivalent to the original if/else but free of "potentially uninitialized" warnings.
  • channelize_poly.h: kMaxDec and kOversampled gain [[maybe_unused]] because some compiler versions do not count a template non-type argument as a "use" of the variable, despite both constants still appearing in the kernel dispatch calls.

Confidence Score: 5/5

All three changes are safe to merge — they suppress compiler diagnostics without altering any runtime behavior.

Each change is a minimal, targeted fix: value-initialization of a zero-element array, collapsing an if/else into a default-plus-override initialization, and adding [[maybe_unused]] to two constants that are already referenced in template arguments. No logic is altered and no new code paths are introduced.

No files require special attention.

Important Files Changed

Filename Overview
include/matx/core/make_tensor.h Adds value-initialization {} to a zero-element cuda::std::array, silencing potential uninitialized-variable warnings from newer compiler versions.
include/matx/operators/collapse.h Refactors input_rank initialization so the static T1::Rank() value is the default and the dynamic override only runs inside the if constexpr branch, eliminating the else and fixing an "uninitialized variable" diagnostic in nightly compilers.
include/matx/transforms/channelize_poly.h Annotates kMaxDec and kOversampled with [[maybe_unused]] to suppress compiler warnings; both variables are still referenced as template non-type arguments in kernel launch calls.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[make_tensor 0D overload] -->|value-init shape| B[zero-element array shape curly braces]
    B --> C[forward to make_tensor with decltype shape]

    D[LCollapseOp constructor] -->|int input_rank = T1::Rank| E{is_dynamic_rank_op?}
    E -->|true| F[input_rank = op_.DynRank + assert rank >= DIM]
    E -->|false| G[keep static T1::Rank value]
    F --> H[Compute collapsed size_]
    G --> H

    I[SmemTiledImpl] -->|maybe_unused kMaxDec and kOversampled| J{decimation_factor == num_channels?}
    J -->|yes| K[Kernel with kMaxDec template arg]
    J -->|no| L[Kernel with kOversampled template arg]
Loading

Reviews (1): Last reviewed commit: "Mark constants as maybe unused in channe..." | Re-trigger Greptile

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage is 94.309%cliffburdick-patch-1 into main. No base build found for main.

@cliffburdick cliffburdick merged commit b44d426 into main May 7, 2026
1 check passed
@cliffburdick cliffburdick deleted the cliffburdick-patch-1 branch May 7, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants