Skip to content

[docs] Update cuda::maximum/minimum signatures to match actual API#8365

Merged
fbusato merged 2 commits intoNVIDIA:mainfrom
edenfunf:fix/maximum-minimum-docs
Apr 10, 2026
Merged

[docs] Update cuda::maximum/minimum signatures to match actual API#8365
fbusato merged 2 commits intoNVIDIA:mainfrom
edenfunf:fix/maximum-minimum-docs

Conversation

@edenfunf
Copy link
Copy Markdown
Contributor

Description

closes #8350

The documentation for cuda::maximum and cuda::minimum did not match the actual API in several ways:

Docs (before) Actual API
Parameters by value (T a, T b) by const reference (const T& a, const T& b)
Qualifier inline constexpr
Exception spec (not shown) noexcept(/* conditional */)
FP behavior (not documented) Uses fmax/fmin (NaN = missing data)

Changes:

  • Updated all four operator() signatures (typed + void specializations, for both maximum and minimum) to use const T& params, constexpr, and noexcept(/* see below */)
  • Added "Defined in the header" line (consistent with other docs in this directory)
  • Added "Floating-Point Behavior" section explaining that fmax/fmin is used for floating-point types, as requested by @fbusato in the issue comments

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

The documentation showed operator() taking parameters by value and
marked as inline, but the actual implementation takes const references
and is constexpr with a conditional noexcept specification.

Also add a section documenting the floating-point behavior: these
functors use fmax/fmin for floating-point types, which treats NaN
arguments as missing data rather than propagating them.

Fixes NVIDIA#8350
@edenfunf edenfunf requested a review from a team as a code owner April 10, 2026 14:50
@edenfunf edenfunf requested a review from gonidelis April 10, 2026 14:50
@github-project-automation github-project-automation bot moved this to Todo in CCCL Apr 10, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 10, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Apr 10, 2026
@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Apr 10, 2026
- Reference std::fmax/fmin specification instead of making specific
  claims about NaN handling that may not hold for all implementations
- Add note that cuda::maximum and cuda::minimum are commutative for
  floating-point types due to using fmax/fmin
@edenfunf
Copy link
Copy Markdown
Contributor Author

@fbusato Thanks for the review! I've pushed a follow-up commit addressing both points:

  • Replaced the NaN-specific claim with a reference to the std::fmax/std::fmin specification
  • Added a note about commutativity for floating-point types

Please take another look when you get a chance.

Copy link
Copy Markdown
Contributor

@fbusato fbusato left a comment

Choose a reason for hiding this comment

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

looks good.

@github-project-automation github-project-automation bot moved this from In Progress to In Review in CCCL Apr 10, 2026
@fbusato
Copy link
Copy Markdown
Contributor

fbusato commented Apr 10, 2026

/ok to test 7467f6b

@fbusato fbusato merged commit 0989bc2 into NVIDIA:main Apr 10, 2026
19 of 23 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Apr 10, 2026
@fbusato
Copy link
Copy Markdown
Contributor

fbusato commented Apr 10, 2026

thanks for the contribution, @edenfunf !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[DOC]: cuda::maximum and cuda::minimum docs differ from API

2 participants