-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specialize sign-related functions #187
Merged
Merged
Conversation
This file contains 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
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.
|
|
I'll merge this, but wait a little longer for tagging. |
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
/flipsign
forNormed
. They should be confusing when the signedNormed
is supported in the future. Furthermore, if signedNormed
is available, we should not do unsafe sign operations for unsignedNormed
.