diff --git a/src/macros.jl b/src/macros.jl index 3b25d8a..46f4fd1 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -53,7 +53,7 @@ macro unsafe_strided(args...) ex = Expr(:let, Expr(:block, [:($s = Strided.StridedView($s)) for s in syms]...), ex) warnex = :(Base.depwarn("`@unsafe_strided A B C ... ex` is deprecated, use `@strided ex` instead.", - Core.Typeof(var"@unsafe_strided").name.mt.name)) + Symbol("@unsafe_strided"); force=true)) return esc(Expr(:block, warnex, ex)) end diff --git a/src/mapreduce.jl b/src/mapreduce.jl index 551e6bd..d01aef5 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -1,5 +1,5 @@ # Methods based on map! -function Base.copyto!(dst::StridedView{<:Any,N}, src::StridedView{<:Any,N}) where {N} +function Base.copy!(dst::StridedView{<:Any,N}, src::StridedView{<:Any,N}) where {N} return map!(identity, dst, src) end Base.conj!(a::StridedView{<:Real}) = a diff --git a/test/othertests.jl b/test/othertests.jl index 4473bf7..ff813ff 100644 --- a/test/othertests.jl +++ b/test/othertests.jl @@ -115,15 +115,15 @@ end @test minimum(real, R1) ≈ minimum(real, StridedView(R1)) @test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R1)) - R1 = PermutedDimsArray(R1, (randperm(6)...,)) + R2 = PermutedDimsArray(R1, (randperm(6)...,)) - @test sum(R1) ≈ sum(StridedView(R1)) - @test maximum(abs, R1) ≈ maximum(abs, StridedView(R1)) - @test minimum(real, R1) ≈ minimum(real, StridedView(R1)) - @test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R1)) + @test sum(R2) ≈ sum(StridedView(R2)) + @test maximum(abs, R2) ≈ maximum(abs, StridedView(R2)) + @test minimum(real, R2) ≈ minimum(real, StridedView(R2)) + @test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R2)) - R2 = rand(T, (5, 5, 5)) - @test prod(exp, StridedView(R2)) ≈ exp(sum(StridedView(R2))) + R3 = rand(T, (5, 5, 5)) + @test prod(exp, StridedView(R3)) ≈ exp(sum(StridedView(R3))) end end @@ -272,13 +272,13 @@ end for op3 in (identity, conj, transpose, adjoint) α = 2 + im β = 3 - im - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2), α, β) @test B3 ≈ op3(β) * A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2), α, 0) @test B3 ≈ op3(α * op1(A1) * op2(A2)) # op3 is its own inverse - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2)) @test B3 ≈ op3(op1(A1) * op2(A2)) # op3 is its own inverse end @@ -318,13 +318,13 @@ end for op3 in (identity, conj, transpose, adjoint) α = 1 // 2 β = 3 // 2 - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2), α, β) @test B3 ≈ op3(β) * A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2), α, 1) @test B3 ≈ A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse - copyto!(B3, B4) + copy!(B3, B4) mul!(op3(B3), op1(B1), op2(B2), 1, 1) @test B3 ≈ A4 + op3(op1(A1) * op2(A2)) # op3 is its own inverse end