[ANN] gmpxx_mkII.h: Yet another GMP C++ Wrapper for High-Precision Calculations

maho nakata nakatamaho at outlook.com
Wed Oct 9 16:20:01 CEST 2024


Dear GMP Developers and Users,

I am pleased to announce the release of gmpxx_mkII.h, a new C++ wrapper designed to enhance high-precision arithmetic using the GMP library. This project is licensed under the 2-clause BSD license, offering flexible integration for both open-source and proprietary projects.

Key Features of gmpxx_mkII.h:

 *   High-Level Source Compatibility: gmpxx_mkII.h is designed to be highly compatible with the existing gmpxx.h, allowing for a smooth transition.
  *  Enhanced Usability: The wrapper simplifies usage by removing template limitations and avoiding complex macros, providing a clearer and more maintainable interface. cf. https://gmplib.org/manual/C_002b_002b-Interface-Limitations
   * Namespace Support: We've introduced the gmpxx namespace to avoid conflicts, though it can be disabled if strict compatibility is required.
    * Comprehensive Mathematical Functions: New trigonometric and transcendental functions such as sin, log, and exp have been added, making it more versatile for complex computations.
    * Performance Improvements: In specific single-core benchmarks, gmpxx_mkII.h has shown up to 25% performance improvement over gmpxx.h.
   * Header-Only Library: There's no need for a separate libgmpxx library, simplifying integration and deployment.
    * Flexible Precision Control: You can configure precision at runtime using environment variables, enabling dynamic adjustments without code changes.

Recent Releases:

    v1.0.0 (2024-09-16): Initial release.
    v1.1.0 (2024-10-06): Namespace reintroduced (default: gmpxx).

Platform and Requirements:

    Supported OS: 64-bit Linux and macOS (LP64 environments).
    Compiler Requirement: C++17 or higher.

Performance Benchmarks:
We've tested various operations, including inner products and matrix multiplications, on a Ryzen 3970X. Here are some highlights:

    Rdot (Inner Product): Single-core operations show up to a 25% performance increase compared to the original gmpxx.h.
    Raxpy, Rgemv, Rgemm: Multi-core performance using OpenMP is comparable to gmpxx.h, with ongoing optimizations planned.

Please refer to the README on the project's GitHub repository for a detailed benchmark and more information.

Contributions and Feedback:
We welcome contributions and feedback from the community. If you have suggestions or encounter problems, please feel free to submit pull requests or open issues on GitHub.

GitHub Repository: https://github.com/nakatamaho/gmpxx_mkII

Thank you for your attention, and I look forward to any feedback from the GMP community!

Best regards,
Nakata Maho


More information about the gmp-discuss mailing list