Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
trunk
trunk
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 60
    • Issues 60
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 9
    • Merge Requests 9
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • yade-dev
  • trunktrunk
  • Merge Requests
  • !362

Merged
Opened Dec 25, 2019 by Janek Kozicki@cosurgiOwner

Another step towards enabling high precision Real

  • Overview 15
  • Commits 212
  • Pipelines 44
  • Changes 53

EDIT: since everything works now, I will make this description a lot shorter, and move the relevant parts directly into documentation :) If you want I can paste it back (I have a backup of original text ;), but it was mostly describing the situation status for a month ago.

I have added high precision support for Real type based on following types:

type bits decimal places notes
float 32 6 hardware accelerated
double 64 15 hardware accelerated
long double 80 18 hardware accelerated
boost::multiprecision::float128 128 33 depending on processor type it can be hardware accelerated
boost::multiprecision::mpfr Nbit Nbit/(log(2)/log(10)) uses external mpfr library
boost::multiprecision::cpp_bin_float Nbit Nbit/(log(2)/log(10)) uses boost only, but is slower

It all works nicely in !383 (merged) (which should be merged last). This merge request aims to minimally modify files already existing in master and focuses on adding the new files that are necessary to make it all work. So the only file modified significantly is lib/base/Math.hpp also as a part of work on #97. It is a lot of commits here because that was a long journey. For historical reasons I would rather not squash these commits. Also the commits can be cherry picked between here and minieigen-real (@bchareyre and @gladk you have write access there). The files in lib/high-precision and py directories there are exactly the same files as here. Note that minieigen-real cannot be a separate library because binary compatibility is necessary for this to work.

During compilation you can provide one of these extra arguments (which affect resulting binaries):

  • REAL_PRECISION_BITS or REAL_DECIMAL_PLACES (the numbers according to the table above), they default to double if not specified.
  • ENABLE_MPFR in case if you wanted additional dependency and use MPFR.

This MR also adds vectorization, the make_SSE to the pipeline. It was accepted by Anton last month in !365 (merged). In fact Anton I have used your test scripts, and extended them even more.

When you use high precision, for example Vector3r becomes Vector3<boost::float128_t>. This works great with Eigen and CGAL.

To make it all work I need to modify lots of other files to call the math:: functions correctly (this name agreed upon). I have split them into many smaller merge requests for easier checking.

Edited Feb 03, 2020 by Janek Kozicki
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: yade-dev/trunk!362
Source branch: highPrecisionReal