Voronoi multi-precision using 64bit limbs on a 64bit compiler, GMP integration#42
Open
bubnikv wants to merge 4 commits intoboostorg:developfrom
Open
Voronoi multi-precision using 64bit limbs on a 64bit compiler, GMP integration#42bubnikv wants to merge 4 commits intoboostorg:developfrom
bubnikv wants to merge 4 commits intoboostorg:developfrom
Conversation
sqr operator instead of x * x, as the sqr operator may be optimized for complex (multi-precision) types. Conditional GMP integration for integer multi-precision expressions.
by an eval2ext() function, which is a variant of eval2(), which avoids overflow by normalization.
(Visual Studio compiler does not support int128 types) Fixed regression - compilation on 32bit systems.
Author
|
It looks like my overly optimistic comments on performance increase were due to some bug that I have fixed now. The performance gains are there, but less pronounced, likely around 30% for GMP. That was measured on a single thread on a modern AMD chip with a lot of cache. Switching to uint64 for the limbs does not make sense on Visual Studio with the current implementation, where there the compiler does not support uint64 natively and boost multiprecision is used instead. On my old Intel Haswell laptop with 6GB cache and compiled with Visual Studio, the GMP gains are in the range of 23% when running Voronoi on a single thread, but only around 7% when running on all hardware threads as the Voronoi generator is is not quite cache friendly. |
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.
A sqr() operator was introduced instead of x * x, as the sqr operator may be optimized by GMP better than mul.
The unit tests seem to pass all right. I was not quite sure about voronoi_ctype_traits
I am using 33 limbs on a 64bit compiler instead of 32. The extended_int multiplication, add and subtract operators drop the top most zero, which leaves space for one limb. With 32bit limbs, the top most 32bit limb is released, while with the same operands the top most 64bit limb would possibly not be zero, therefore it would not be released. Therefore I increased the number of 64bit limbs to 33. Maybe @asydorchuk will consider this one extra limb unnecessary?