Repository navigation
mir: lower f32::atan{,2} / f64::atan{,2} via libdevice (rebased #78) - #109
Merged
Merged
Conversation
Kernels can now write `y.atan2(x)` / `x.atan()` directly. Signed-off-by: Paul Zhang <[email protected]>
The ys_f32 test array used 3.14 / -3.14, which clippy's approx_constant (deny-by-default) flags as approximations of PI. Swap for 3.25 / -3.25: same mid-range coverage, exactly f32-representable, not a constant.
2 tasks
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
…tion. (NVIDIA#109) Signed-off-by: Melih Elibol <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased + verified version of #78 by @paulzhng, brought onto current
main. #78 overlapped #62'sRustFloatMathIntrinsicblock so it could not merge as-is; the original commit is preserved as-authored (only rebased and conflict-resolved).What it does
f32::atan/atan2(and the f64 forms) route throughstd::sys::cmathshims rather than core intrinsics, so this:__nv_atan{,2}{,f}through the existing float-math placeholder pipeline.Verification
cargo oxide run math_atan->SUCCESS: 16 cases x 4 variants within 2 ULP of host libm.f32::atanfail withFORBIDDEN CRATE IN DEVICE CODE: std::sys::cmath::atanf, confirming the change is load-bearing.Closes #77. Supersedes #78 (@paulzhng's original).