Skip to content

Fix build issues exposed by newer Clang 21 toolchains#6348

Merged
JanuszL merged 1 commit into
NVIDIA:mainfrom
JanuszL:fix-cvcuda-stdint-include
May 18, 2026
Merged

Fix build issues exposed by newer Clang 21 toolchains#6348
JanuszL merged 1 commit into
NVIDIA:mainfrom
JanuszL:fix-cvcuda-stdint-include

Conversation

@JanuszL

@JanuszL JanuszL commented May 15, 2026

Copy link
Copy Markdown
Contributor

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

Fix build issues exposed by newer Clang 21 toolchains.

The DALI remap headers included obsolete <ctgmath>. This PR replaces
those includes with <cmath> in the sphere and water remap operators.

The CVCUDA legacy OSD header uses uint8_t directly but did not include
a header that defines it. Some toolchains no longer provide uint8_t
transitively through the current include graph, which makes the CVCUDA
build fail with unknown type name 'uint8_t'. This PR updates the
CVCUDA submodule to a fork commit that adds the missing <stdint.h>
include.

The CVCUDA submodule URL is changed to
https://github.com/JanuszL/CV-CUDA.git so CI can fetch the fix commit.

Additional information:

Affected modules and functionalities:

  • dali/operators/image/remap/sphere.h
  • dali/operators/image/remap/water.h
  • third_party/cvcuda submodule advanced to 3f8cc441
    (Include stdint in OSD legacy header).
  • .gitmodules updated for third_party/cvcuda to use
    https://github.com/JanuszL/CV-CUDA.git.

Key points relevant for the review:

  • The DALI source changes only replace <ctgmath> with <cmath>.
  • The CVCUDA change is intentionally minimal: it adds the missing
    fixed-width integer include in the header that uses uint8_t.
  • The submodule URL points to a fork because the fix commit is not in
    upstream CVCUDA.

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

@greptile-apps

greptile-apps Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Clang 21 build failures by replacing the removed <ctgmath> header with <cmath> in three remap operator headers, and by bumping the third_party/cvcuda submodule (on a temporary fork branch) to a commit that adds the missing <stdint.h> include in the CVCUDA OSD legacy header.

  • <ctgmath><cmath> in jitter.cuh, sphere.h, and water.h<ctgmath> was deprecated in C++17 and removed in C++20; <cmath> is the correct replacement and is sufficient since none of the three files use complex-math functions.
  • CVCUDA submodule advanced to commit 3f8cc441 from a personal fork; .gitmodules updated accordingly until the upstream PR lands in the official repo.

Confidence Score: 5/5

Safe to merge — all changes are minimal and targeted; no logic or API surface is modified.

The DALI source changes are purely mechanical header substitutions: <ctgmath> was removed from C++20 and <cmath> is the correct, sufficient replacement for all three files (none use complex math). The cvcuda submodule bump is a one-line <stdint.h> addition in a third-party legacy header. No logic, data types, or public interfaces change.

No files require special attention. The .gitmodules fork-URL situation was already raised and acknowledged in the prior review thread.

Important Files Changed

Filename Overview
dali/operators/image/remap/jitter.cuh Replaces deprecated <ctgmath> with <cmath>; no math functions from <cmath> are directly invoked in this file but the change is safe and consistent with the other remap headers.
dali/operators/image/remap/sphere.h Replaces <ctgmath> with <cmath>; uses sqrtf() which is correctly provided by <cmath>.
dali/operators/image/remap/water.h Replaces <ctgmath> with <cmath>; uses sinf() and cosf() which are correctly provided by <cmath>.
.gitmodules cvcuda submodule URL changed to a personal fork; discussed in the previous review thread — temporary pending upstream merge.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Clang 21 build failure"] --> B{"Root cause"}
    B --> C["ctgmath removed in C++20\n(jitter.cuh, sphere.h, water.h)"]
    B --> D["uint8_t undeclared in\nCVCUDA OSD legacy header"]
    C --> E["Replace with cmath\n(sufficient — no complex math used)"]
    D --> F["Bump cvcuda submodule\nto fork commit 3f8cc441\n(adds #include stdint.h)"]
    E --> G["Build succeeds"]
    F --> G
Loading

Reviews (3): Last reviewed commit: "Fix DALI build with Clang 21" | Re-trigger Greptile

Comment thread .gitmodules
[submodule "third_party/cvcuda"]
path = third_party/cvcuda
url = https://github.com/CVCUDA/CV-CUDA.git
url = https://github.com/JanuszL/CV-CUDA.git

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 [Question] Permanent fork reference being merged to main

The PR description calls this change "temporary," but merging it means every developer checkout and every CI job will clone from github.com/JanuszL/CV-CUDA until a follow-up PR reverts it. If the fork is deleted, made private, or diverges further, all builds that depend on this submodule will break with no obvious error message. Personal forks are not appropriate long-term submodule URLs for a shared repository.

Is the upstream fix already submitted to CVCUDA/CV-CUDA? The typical safe path is to land the fix upstream first, then bump the submodule to the official commit, keeping the canonical URL intact. If the upstream PR will land soon, consider holding this change off main until then rather than merging the fork URL.

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant change has been opened in the corresponding project. Until it is included in the official release we need to use form :(

@JanuszL

JanuszL commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

!build

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51385562]: BUILD FAILED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51388370]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51388370]: BUILD FAILED

@JanuszL JanuszL force-pushed the fix-cvcuda-stdint-include branch 2 times, most recently from f77c3b3 to ec2d3fa Compare May 15, 2026 11:45
@JanuszL JanuszL changed the title Update CVCUDA submodule with stdint include fix Fix build issues exposed by newer Clang 21 toolchains May 15, 2026
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51396198]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51396198]: BUILD FAILED

Replace obsolete <ctgmath> includes in the remap headers with <cmath> so
they build with newer Clang toolchains.

Update the CVCUDA submodule to a fork commit that adds the missing
<stdint.h> include to CvCudaOSD.hpp. The legacy OSD header uses
uint8_t directly and no longer gets it transitively with the new
toolchain include graph.

Point the CVCUDA submodule URL to the fork that contains the fix so
CI can fetch the updated submodule commit.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL force-pushed the fix-cvcuda-stdint-include branch from ec2d3fa to 014ffdd Compare May 15, 2026 12:38
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51399721]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51399721]: BUILD PASSED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51600765]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51601446]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51600765]: BUILD FAILED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51601446]: BUILD FAILED

@JanuszL JanuszL merged commit 47b7735 into NVIDIA:main May 18, 2026
5 of 6 checks passed
@JanuszL JanuszL deleted the fix-cvcuda-stdint-include branch May 18, 2026 08:41
mdabek-nvidia pushed a commit to mdabek-nvidia/DALI that referenced this pull request May 27, 2026
The DALI remap headers included obsolete <ctgmath>. This PR replaces
those includes with <cmath> in the sphere and water remap operators.

The CVCUDA legacy OSD header uses uint8_t directly but did not include
a header that defines it. Some toolchains no longer provide uint8_t
transitively through the current include graph, which makes the CVCUDA
build fail with unknown type name 'uint8_t'. This PR updates the
CVCUDA submodule to a fork commit that adds the missing <stdint.h>
include.

The CVCUDA submodule URL is changed to
https://github.com/JanuszL/CV-CUDA.git so CI can fetch the fix commit.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
JanuszL added a commit that referenced this pull request May 28, 2026
The DALI remap headers included obsolete <ctgmath>. This PR replaces
those includes with <cmath> in the sphere and water remap operators.

The CVCUDA legacy OSD header uses uint8_t directly but did not include
a header that defines it. Some toolchains no longer provide uint8_t
transitively through the current include graph, which makes the CVCUDA
build fail with unknown type name 'uint8_t'. This PR updates the
CVCUDA submodule to a fork commit that adds the missing <stdint.h>
include.

The CVCUDA submodule URL is changed to
https://github.com/JanuszL/CV-CUDA.git so CI can fetch the fix commit.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
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.

5 participants