-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix copyto!(dest, Rdest::CartesianIndices, src, Rsrc::CartesianIndices)
with different step.
#45289
Conversation
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`.
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.00042132882f0 Edit: 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 |
@N5N3 that's annoying, but I don't think there's anything good to do here. Given this, I see 3 possible paths:
|
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39)
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39)
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39)
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39)
There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39)
Local bench shows no performance regression, if the
indices
s ofRdest
andRsrc
are allNTuple{N,<:AbstractUnitRange}
.Close #45282.