Skip to content

[libcudacxx][fp] add fpemu (double-precision emulation) + unit tests#9777

Draft
akolesov-nvidia wants to merge 4 commits into
NVIDIA:mainfrom
akolesov-nvidia:dev/akolesov/fpemu_draft_v2
Draft

[libcudacxx][fp] add fpemu (double-precision emulation) + unit tests#9777
akolesov-nvidia wants to merge 4 commits into
NVIDIA:mainfrom
akolesov-nvidia:dev/akolesov/fpemu_draft_v2

Conversation

@akolesov-nvidia

Copy link
Copy Markdown

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.

Description

closes

Checklist

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

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.
@copy-pr-bot

copy-pr-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 Progress in CCCL Jul 9, 2026
@fbusato

fbusato commented Jul 9, 2026

Copy link
Copy Markdown
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

@akolesov-nvidia

Copy link
Copy Markdown
Author

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

@davebayer requested the full fpemu component as initial step of the new full FP set integration. Current PR is re-factored previous one #9655 with addressed comments. I suppose that David will look into this update when he is back from vacation. Thanks.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants