Skip to content

feat(cuda-oxide): lower libm lgamma_r through libdevice - #1652

Open
uurl wants to merge 7 commits into
NVIDIA:mainfrom
uurl:feat/libdevice-lgamma-r
Open

uurl wants to merge 7 commits into
NVIDIA:mainfrom
uurl:feat/libdevice-lgamma-r

Conversation

@uurl

@uurl uurl commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add generated mappings for libm::lgamma_r and libm::lgammaf_r, bringing coverage to 110 of 124 f32/f64 exports.
  • Compose libm's (log(abs(gamma(x))), signgam) tuple from the existing validated libdevice lgamma, floor, and fmod symbols. Handle negative intervals, integer poles, signed zero, and infinities.
  • Add compiler tests for both backends, tuple layouts, and invalid signatures, plus a CUDA example comparing both precisions against libm.

Validation

  • cargo run -p cuda-intrinsics-gen --locked -- check
  • cargo test -p cuda-intrinsics-gen -p dialect-mir -p mir-importer -p mir-lower --all-targets --locked
  • cargo clippy -p cuda-intrinsics-gen -p dialect-mir -p mir-importer -p mir-lower --all-targets --locked -- -D warnings
  • cargo oxide run math_lgamma_r: 208 checks passed across f32 and f64
  • just check: passed

Depends on #1651. Part of #1224; the remaining 14 exports are outside this PR.

Testing

  • just -f cuda-oxide/Justfile check passes (the local mirror of CI: fmt, clippy, tests, guards, docs)
  • cargo oxide run <example> passes, or cuda-oxide/scripts/smoketest.sh -o '^<example>$'
  • New example added

Checklist

  • All commits signed off (git commit -s)
  • SPDX headers on new source files

uurl added 7 commits October 25, 2026 19:16
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

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.

@uurl
uurl marked this pull request as ready for review October 26, 2026 06:56
@uurl
uurl requested a review from nihalpasham as a code owner October 26, 2026 06:56

This branch has not been deployed

No deployments
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.

1 participant