Specialize sign-related functions#187
Merged
kimikage merged 1 commit intoJuliaMath:masterfrom Jul 14, 2020
Merged
Conversation
Collaborator
Author
Benchmarkjulia> versioninfo()
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)beforejulia> @btime copysign.(x, y) setup=(x=collect(rand(Q0f7,100,100)); y=collect(rand(Q0f7,100,100)));
31.100 μs (1 allocation: 9.94 KiB)
julia> @btime flipsign.(x, y) setup=(x=collect(rand(Q0f7,100,100)); y=collect(rand(Q0f7,100,100)));
30.900 μs (1 allocation: 9.94 KiB)
julia> @btime signbit.(x) setup=(x=collect(rand(Q0f7,100,100)));
5.750 μs (3 allocations: 5.56 KiB)
julia> @btime signbit.(x) setup=(x=collect(rand(N0f8,100,100)));
2.744 μs (3 allocations: 5.56 KiB)
julia> @btime abs.(x) setup=(x=collect(rand(N0f8,100,100)));
2.962 μs (1 allocation: 9.94 KiB)afterjulia> @btime copysign.(x, y) setup=(x=collect(rand(Q0f7,100,100)); y=collect(rand(Q0f7,100,100)));
7.500 μs (1 allocation: 9.94 KiB)
julia> @btime flipsign.(x, y) setup=(x=collect(rand(Q0f7,100,100)); y=collect(rand(Q0f7,100,100)));
5.350 μs (1 allocation: 9.94 KiB)
julia> @btime signbit.(x) setup=(x=collect(rand(Q0f7,100,100)));
5.316 μs (3 allocations: 5.56 KiB)
julia> @btime signbit.(x) setup=(x=collect(rand(N0f8,100,100)));
1.700 μs (3 allocations: 5.56 KiB)
julia> @btime abs.(x) setup=(x=collect(rand(N0f8,100,100)));
2.962 μs (1 allocation: 9.94 KiB) |
12 tasks
Codecov Report
@@ Coverage Diff @@
## master #187 +/- ##
==========================================
+ Coverage 89.15% 89.30% +0.14%
==========================================
Files 6 6
Lines 452 458 +6
==========================================
+ Hits 403 409 +6
Misses 49 49
Continue to review full report at Codecov.
|
Collaborator
Author
|
|
Collaborator
Author
|
I'll merge this, but wait a little longer for tagging. |
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.
This is part of the issue #185.
Edit:
This prohibits
copysign/flipsignforNormed. They should be confusing when the signedNormedis supported in the future. Furthermore, if signedNormedis available, we should not do unsafe sign operations for unsignedNormed.