Skip to content

Commit 24fcf11

Browse files
authored
More copyto! to copy! (#37)
* Update linalg.jl * Update Project.toml * Update convert.jl * Update mapreduce.jl * Update blasmultests.jl
1 parent 8e3ccc4 commit 24fcf11

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Strided"
22
uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67"
33
authors = ["Lukas Devos <lukas.devos@ugent.be>", "Maarten Van Damme <maartenvd1994@gmail.com>", "Jutho Haegeman <jutho.haegeman@ugent.be>"]
4-
version = "2.3.1"
4+
version = "2.3.2"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/convert.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
function Base.Array(a::StridedView)
22
b = Array{eltype(a)}(undef, size(a))
3-
copyto!(StridedView(b), a)
3+
copy!(StridedView(b), a)
44
return b
55
end
66

77
function (Base.Array{T})(a::StridedView{S,N}) where {T,S,N}
88
b = Array{T}(undef, size(a))
9-
copyto!(StridedView(b), a)
9+
copy!(StridedView(b), a)
1010
return b
1111
end
1212

1313
function (Base.Array{T,N})(a::StridedView{S,N}) where {T,S,N}
1414
b = Array{T}(undef, size(a))
15-
copyto!(StridedView(b), a)
15+
copy!(StridedView(b), a)
1616
return b
1717
end

src/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LinearAlgebra.lmul!(α::Number, dst::StridedView) = mul!(dst, α, dst)
55
function LinearAlgebra.mul!(dst::StridedView{<:Number,N}, α::Number,
66
src::StridedView{<:Number,N}) where {N}
77
if α == 1
8-
copyto!(dst, src)
8+
copy!(dst, src)
99
else
1010
dst .= α .* src
1111
end
@@ -14,7 +14,7 @@ end
1414
function LinearAlgebra.mul!(dst::StridedView{<:Number,N}, src::StridedView{<:Number,N},
1515
α::Number) where {N}
1616
if α == 1
17-
copyto!(dst, src)
17+
copy!(dst, src)
1818
else
1919
dst .= src .* α
2020
end

src/mapreduce.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Base.conj!(a::StridedView{<:Real}) = a
66
Base.conj!(a::StridedView) = map!(conj, a, a)
77
function LinearAlgebra.adjoint!(dst::StridedView{<:Any,N},
88
src::StridedView{<:Any,N}) where {N}
9-
return copyto!(dst, adjoint(src))
9+
return copy!(dst, adjoint(src))
1010
end
1111
function Base.permutedims!(dst::StridedView{<:Any,N}, src::StridedView{<:Any,N},
1212
p) where {N}
13-
return copyto!(dst, permutedims(src, p))
13+
return copy!(dst, permutedims(src, p))
1414
end
1515

1616
function Base.mapreduce(f, op, A::StridedView; dims=:, kw...)

test/blasmultests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for T1 in (Float32, Float64, Complex{Float32}, Complex{Float64})
1919
for op3 in (identity, conj, transpose, adjoint)
2020
α = randn(T3)
2121
β = randn(T3)
22-
copyto!(A3, A4)
22+
copy!(A3, A4)
2323
mul!(op3(B3), op1(B1), op2(B2), α, β)
2424
@test B3 op3(β) * A4 + op3* op1(A1) * op2(A2)) # op3 is its own inverse
2525
end
@@ -47,7 +47,7 @@ for T1 in (Float32, Float64, Complex{Float32}, Complex{Float64})
4747
for op3 in (identity, conj, transpose, adjoint)
4848
α = randn(T3)
4949
β = randn(T3)
50-
copyto!(A3, A4)
50+
copy!(A3, A4)
5151
mul!(op3(B3), op1(B1), op2(B2), α, β)
5252
@test B3 op3(β) * A4 + op3* op1(A1) * op2(A2)) # op3 is its own inverse
5353
end
@@ -75,7 +75,7 @@ for T1 in (Float32, Float64, Complex{Float32}, Complex{Float64})
7575
for op3 in (identity, conj, transpose, adjoint)
7676
α = randn(T3)
7777
β = randn(T3)
78-
copyto!(A3, A4)
78+
copy!(A3, A4)
7979
mul!(op3(B3), op1(B1), op2(B2), α, β)
8080
@test B3 op3(β) * A4 + op3* op1(A1) * op2(A2)) # op3 is its own inverse
8181
end

0 commit comments

Comments
 (0)