Repository navigation
feat(cuda-oxide): generate libm-to-libdevice math dispatch and lower 120 libm exports - #1660
Merged
Merged
Conversation
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>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Signed-off-by: nihalpasham <nihalp@nvidia.com>
Collaborator
|
Thanks, this is a very clean implementation of
At |
Collaborator
|
/ok to test 8d77b1c |
nihalpasham
previously approved these changes
Oct 29, 2026
This was referenced Oct 29, 2026
…nd consolidate math_special - Drop dead duplicate generated file intrinsics/generated/libdevice_math.rs and align Markdown table columns in intrinsics/libdevice-math.md - Generate RustFloatMathLowering and ALL_FLOAT_MATH_INTRINSICS in dialect-mir::rust_intrinsics - Extract float-math lowering from mir-lower/src/convert/ops/call.rs into mir-lower/src/convert/ops/float_math.rs dispatching via RustFloatMathIntrinsic::lowering - Consolidate math_aliases, math_out_params, math_lgamma_r, math_c23_minmax, and math_bessel_j1 into examples/math_special (2,822 GPU checks) - Document all items across libdevice_math, rust_intrinsics, float_math, and update README export counts Signed-off-by: nihalpasham <nihalp@nvidia.com>
Collaborator
|
/ok to test e4d3319 |
nihalpasham
force-pushed
the
feat/libdevice-bessel-j1
branch
from
October 29, 2026 14:22
8d77b1c to
e4d3319
Compare
nihalpasham
approved these changes
Oct 29, 2026
5 tasks done
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.
What This PR Does
Implements
#1224across the 9-commitlibdevice_mathseries (#1638,#1645,#1646,#1649,#1650,#1651,#1652,#1653,#1660), replacing hand-maintained math dispatch tables across three crates with a single generated table backed bylibdevice.10.bcevidence and expandinglibm 0.2.16coverage from 72 to 120 of 124f32/f64exports:intrinsics/overlay/libdevice_math.toml+libdevice.10.bcsignature verification and generatedialect-mirmath dispatch (cuda-intrinsics-gen,dialect-mir,mir-importer,rustc-codegen-cuda)mir-lower/src/convert/ops/float_math.rsdriven by generatedRustFloatMathLowering(mir-lower)tgamma,ilogb,ldexp,erf,j0,y0, ...), entry-block out-parameter adapters (frexp,modf,remquo),lgamma_r, C23fmaximum/fminimum, andj1(mir-lower,examples/math_special)1. Generated
libm -> libdeviceDispatch (#1224)Previously, wiring a single
libmorstd::sys::cmathfunction required hand-editing ~10 sites acrossrustc-codegen-cuda/src/collector.rs,mir-importer,dialect-mir, andmir-lower:2. Entry-Block Out-Parameter Adapters & IEEE Edge-Case Lowerings (
mir-lower)Verification
sm_120a) GPU Execution & Sanitizer:cargo oxide run math_special: 2,822 / 2,822f32andf64checks PASS (compute-sanitizer --tool memcheck:0 errors,0.localinstructions emitted forfrexp,modf,remquo,lgamma_r, and C23minmax).cargo oxide run libm_math&cargo oxide run libdevice_math: PASS.cargo run -p cuda-intrinsics-gen -- check&verify-libdevice: PASS (102libdevice.10.bcsignatures verified).cargo test -p cuda-intrinsics-gen -p dialect-mir -p mir-importer -p mir-lower -p cuda-oxide-codegen --all-targets: 3,494 tests PASSjust fmt-check,just clippy,scripts/sync-example-locks.sh --check, and all 18scripts/check-*.shguards: all PASSCloses #1224