Fix copyto!(dest, Rdest::CartesianIndices, src, Rsrc::CartesianIndices) with different step. #45289
Merged
KristofferC merged 1 commit intoJuliaLang:masterfrom May 16, 2022
Merged
Conversation
jishnub
reviewed
May 12, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
Member
Author
|
Unrelated julia> x, y = 48.718f0, -2.f0;
julia> Base.Math.pow_body(x,y)
0.0004213288f0
julia> x^y
0.00042132882f0
julia> x^-2
0.00042132882f0Edit: My local test shows that using Random
Random.seed!(0);
a = rand(Float32, 100000000) * 100;
f(x) = widen(inv(x)*inv(x));
g(x) = widen(inv(x*x));
c(x) = widen(x)^-2.0;
fa = f.(a);
ga = g.(a);
ca = c.(a);
maximum(x -> isnan(x) ? zero(x) : abs(x), (fa .- ca)./ca) #1.786684364953734e-7
sum(x -> isnan(x) ? zero(x) : abs(x), (fa .- ca)./ca) #4.616936626912864
maximum(x -> isnan(x) ? zero(x) : abs(x), (ga .- ca)./ca)#8.930594822349074e-8
sum(x -> isnan(x) ? zero(x) : abs(x), (ga .- ca)./ca) #2.965068731509999 |
This was referenced May 16, 2022
Member
|
@N5N3 that's annoying, but I don't think there's anything good to do here. Given this, I see 3 possible paths:
|
KristofferC
pushed a commit
that referenced
this pull request
May 18, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
(cherry picked from commit a91be39)
KristofferC
pushed a commit
that referenced
this pull request
May 18, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
(cherry picked from commit a91be39)
KristofferC
pushed a commit
that referenced
this pull request
May 23, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
(cherry picked from commit a91be39)
KristofferC
pushed a commit
that referenced
this pull request
Dec 21, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
(cherry picked from commit a91be39)
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
(cherry picked from commit a91be39)
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.
Local bench shows no performance regression, if the
indicess ofRdestandRsrcare allNTuple{N,<:AbstractUnitRange}.Close #45282.