[libcudacxx][fp] add fpemu (double-precision emulation) + unit tests#9777
Draft
akolesov-nvidia wants to merge 4 commits into
Draft
[libcudacxx][fp] add fpemu (double-precision emulation) + unit tests#9777akolesov-nvidia wants to merge 4 commits into
akolesov-nvidia wants to merge 4 commits into
Conversation
Minimal fpemu-only set: the
double-precision emulation type (fpemu<_FpType=double, fpemu_accuracy>,
packed and unpacked) and its Catch2 (c2h) unit tests. This is a clean,
fully-refactored subset branched from main; fpmp, fptool, benchmarks,
docs, examples, and the dev harness are intentionally excluded so the
team can land the minimal core first.
Headers (libcudacxx/include/cuda):
- <cuda/fpemu> umbrella
- __fp/fpemu.h, fpemu_common.h (public accuracy enum + CCCL_FPEMU_* knobs),
fpemu_impl.h (internal base), and the per-op family headers
fpemu_impl_{add,sub,mul,div,fma,sqrt,cmp,cvt,unpack,others}.h.
Tests (test/libcudacxx/cuda/fp/units): 17 fpemu_*.cu single-pass Catch2
tests (host + device via one _CCCL_HOST_DEVICE run_test), auto-discovered
by CTest; fp_test_targets.h helper.
Contributor
Contributor
|
there is no way we can review 10K+ LoC in a single PR. Please split the PR in isolated functionalities, even better with stacked PRs |
Author
@davebayer requested the full |
Standardize internal variable/constant names across the fpemu headers to the CCCL __snake_case convention. Converts UPPER_SNAKE constants (e.g. __fpemu_MANTISSA_MASK, __FP64EMU_CVT_INF_EXP, __INF_EXP/__NAN_EXP) and leftover camelCase locals (e.g. __shiftDist, __roundBits, __sigExtra, __ptrSRC/__ptrDST) via word-boundary replacement. No functional change: pure identifier rename. Verified by standalone host compilation of every fpemu header and the full fpemu unit suite.
Fix codespell hits (lengh->length, beggining->beginning, posible->possible) in the fpemu headers and collapse the double trailing newline at EOF in fpemu_impl.h (end-of-file-fixer).
Apply the CCCL clang-format style (v20.1.7) to the fpemu headers and unit tests. Mechanical, whitespace-only reformat: namespace bodies dedented (NamespaceIndentation: None), preprocessor directives re-indented after the hash, and comment/blank-line normalization. No functional change; verified by the full fpemu unit suite.
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.
Minimal fpemu-only set: the
double-precision emulation type (fpemu<_FpType=double, fpemu_accuracy>, packed and unpacked) and its Catch2 (c2h) unit tests. This is a clean, fully-refactored subset branched from main; fpmp, fptool, benchmarks, docs, examples, and the dev harness are intentionally excluded so the team can land the minimal core first.
Headers (libcudacxx/include/cuda):
Tests (test/libcudacxx/cuda/fp/units): 17 fpemu_*.cu single-pass Catch2
tests (host + device via one _CCCL_HOST_DEVICE run_test), auto-discovered
by CTest; fp_test_targets.h helper.
Description
closes
Checklist