https://github.com/JuliaLang/julia
Revision 1a9040908b9bb89927b2d318da3f9fe1e457abea authored by Jishnu Bhattacharya on 20 February 2024, 17:05:02 UTC, committed by GitHub on 20 February 2024, 17:05:02 UTC
With this, the following (and equivalent calls) work:
```julia
julia> copyto!(view(zeros(BigInt, 2), 1:2), Vector{BigInt}(undef,2))
2-element view(::Vector{BigInt}, 1:2) with eltype BigInt:
 #undef
 #undef

julia> copyto!(view(zeros(BigInt, 2), 1:2), view(Vector{BigInt}(undef,2), 1:2))
2-element view(::Vector{BigInt}, 1:2) with eltype BigInt:
 #undef
 #undef
```

Close https://github.com/JuliaLang/julia/issues/53098. With this, all
the `_unsetindex!` branches in `copyto_unaliased!` work for
`Array`-views, and this makes certain indexing operations vectorize and
speed-up:
```julia
julia> using BenchmarkTools

julia> a = view(rand(100,100), 1:100, 1:100); b = view(similar(a), axes(a)...);

julia> @btime copyto!($b, $a);
  16.427 μs (0 allocations: 0 bytes) # master
  2.308 μs (0 allocations: 0 bytes) # PR
``` 

Improves (but doesn't resolve)
https://github.com/JuliaLang/julia/issues/40962 and
https://github.com/JuliaLang/julia/issues/53158

```julia
julia> a = rand(40,40); b = rand(40,40);

julia> @btime $a[1:end,1:end] .= $b;
  5.383 μs (0 allocations: 0 bytes) # v"1.12.0-DEV.16"
  3.194 μs (0 allocations: 0 bytes) # PR
```
ƒ
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1 parent ea2b255
Raw File
Tip revision: 1a9040908b9bb89927b2d318da3f9fe1e457abea authored by Jishnu Bhattacharya on 20 February 2024, 17:05:02 UTC
Add `_unsetindex!` methods for `SubArray`s and `CartesianIndex`es (#53383)
Tip revision: 1a90409
.gitignore
/*.tar.gz
/tmp
/dist
/dist-extras
/julia
/julia.bat
/usr
/oprofile_data
/usr-staging
/Make.user
/julia-*
/source-dist.tmp
/source-dist.tmp1

*.expmap
*.exe
*.dll
*.dwo
*.do
*.o
*.o.tmp
*.obj
*.so
*.dylib
*.dSYM
*.h.gen
*.jl.cov
*.jl.*.cov
*.jl.mem
*.jl.*.mem
*.ji

/perf*
.DS_Store
.idea/*
.vscode/*
*.heapsnapshot
.cache
# Buildkite: Ignore the entire .buildkite directory
/.buildkite

# Builtkite: json test data
/test/results.json

# Buildkite: Ignore the unencrypted repo_key
repo_key

# Buildkite: Ignore any agent keys (public or private) we have stored
agent_key*
back to top