Skip to content

Commit

Permalink
Merge pull request #601 from JuliaArrays/fe/fixes
Browse files Browse the repository at this point in the history
Drop 0.7
  • Loading branch information
c42f authored Apr 26, 2019
2 parents 13a25d9 + 2f541ed commit d3f739e
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
/Manifest.toml
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ os:
- linux
- osx
julia:
- 0.7
- 1.0
- 1.1
- nightly
notifications:
email: false
Expand All @@ -17,12 +17,8 @@ branches:
# allow_failures:
# - julia: nightly
# - os: osx
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("StaticArrays"); Pkg.test("StaticArrays"; coverage=true)'
after_success:
- if [ $TRAVIS_JULIA_VERSION = "0.7" ] && [ $TRAVIS_OS_NAME = "linux" ]; then
- if [ $TRAVIS_JULIA_VERSION = "1.1" ] && [ $TRAVIS_OS_NAME = "linux" ]; then
julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())';
fi
- julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps)'
Expand Down
16 changes: 16 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "StaticArrays"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.10.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[extras]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["InteractiveUtils", "SpecialFunctions", "Test"]
1 change: 0 additions & 1 deletion REQUIRE

This file was deleted.

2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- julia_version: 0.7
- julia_version: 1.0
- julia_version: 1.1
- julia_version: latest

platform:
Expand Down
4 changes: 1 addition & 3 deletions src/MArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ end

@inline Tuple(v::MArray) = v.data

if isdefined(Base, :dataids) # v0.7-
Base.dataids(ma::MArray) = (UInt(pointer(ma)),)
end
Base.dataids(ma::MArray) = (UInt(pointer(ma)),)

@inline function Base.unsafe_convert(::Type{Ptr{T}}, a::MArray{S,T}) where {S,T}
Base.unsafe_convert(Ptr{T}, pointer_from_objref(a))
Expand Down
4 changes: 1 addition & 3 deletions src/SArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ end

@inline Tuple(v::SArray) = v.data

if isdefined(Base, :dataids) # v0.7-
Base.dataids(::SArray) = ()
end
Base.dataids(::SArray) = ()

# See #53
Base.cconvert(::Type{Ptr{T}}, a::SArray) where {T} = Base.RefValue(a)
Expand Down
4 changes: 1 addition & 3 deletions src/SizedArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ SizedMatrix{S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M}
@inline SizedMatrix{S1,S2}(a::Array{T,M}) where {S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M}(a)
@inline SizedMatrix{S1,S2}(x::NTuple{L,T}) where {S1,S2,T,L} = SizedArray{Tuple{S1,S2},T,2,2}(x)

if isdefined(Base, :dataids) # v0.7-
Base.dataids(sa::SizedArray) = Base.dataids(sa.data)
end
Base.dataids(sa::SizedArray) = Base.dataids(sa.data)

"""
Size(dims)(array)
Expand Down
34 changes: 10 additions & 24 deletions src/matrix_multiply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,30 +303,16 @@ end
gemm = :cgemm_
end

if VERSION < v"0.7-"
blascall = quote
ccall((Base.BLAS.@blasfunc($gemm), Base.BLAS.libblas), Nothing,
(Ref{UInt8}, Ref{UInt8}, Ref{Base.BLAS.BlasInt}, Ref{Base.BLAS.BlasInt},
Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{Base.BLAS.BlasInt},
Ptr{$T}, Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
Ref{Base.BLAS.BlasInt}),
transA, transB, m, n,
ka, alpha, a, strideA,
b, strideB, beta, c,
strideC)
end
else
blascall = quote
ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing,
(Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt},
Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt},
Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
Ref{LinearAlgebra.BLAS.BlasInt}),
transA, transB, m, n,
ka, alpha, a, strideA,
b, strideB, beta, c,
strideC)
end
blascall = quote
ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing,
(Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt},
Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt},
Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T},
Ref{LinearAlgebra.BLAS.BlasInt}),
transA, transB, m, n,
ka, alpha, a, strideA,
b, strideB, beta, c,
strideC)
end

return quote
Expand Down
14 changes: 5 additions & 9 deletions test/MArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,11 @@

@test length(m) === 4

if isdefined(Base, :mightalias) # v0.7-
@test Base.mightalias(m, m)
@test !Base.mightalias(m, copy(m))
@test Base.mightalias(m, view(m, :, 1))
end

if isdefined(Base, :dataids) # v0.7-
@test Base.dataids(m) == (UInt(pointer(m)),)
end
@test Base.mightalias(m, m)
@test !Base.mightalias(m, copy(m))
@test Base.mightalias(m, view(m, :, 1))

@test Base.dataids(m) == (UInt(pointer(m)),)
end

@testset "setindex!" begin
Expand Down
1 change: 0 additions & 1 deletion test/REQUIRE

This file was deleted.

4 changes: 1 addition & 3 deletions test/SArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@

@test_throws Exception m[1] = 1

if isdefined(Base, :dataids) # v0.7-
@test Base.dataids(m) === ()
end
@test Base.dataids(m) === ()
end

@testset "promotion" begin
Expand Down
26 changes: 12 additions & 14 deletions test/SizedArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@
sa[1] = 2
@test sa.data == [2, 4]

if isdefined(Base, :mightalias) # v0.7-
@testset "aliasing" begin
a1 = rand(4)
a2 = copy(a1)
sa1 = SizedVector{4}(a1)
sa2 = SizedVector{4}(a2)
@test Base.mightalias(a1, sa1)
@test Base.mightalias(sa1, SizedVector{4}(a1))
@test !Base.mightalias(a2, sa1)
@test !Base.mightalias(sa1, SizedVector{4}(a2))
@test Base.mightalias(sa1, view(sa1, 1:2))
@test Base.mightalias(a1, view(sa1, 1:2))
@test Base.mightalias(sa1, view(a1, 1:2))
end
@testset "aliasing" begin
a1 = rand(4)
a2 = copy(a1)
sa1 = SizedVector{4}(a1)
sa2 = SizedVector{4}(a2)
@test Base.mightalias(a1, sa1)
@test Base.mightalias(sa1, SizedVector{4}(a1))
@test !Base.mightalias(a2, sa1)
@test !Base.mightalias(sa1, SizedVector{4}(a2))
@test Base.mightalias(sa1, view(sa1, 1:2))
@test Base.mightalias(a1, view(sa1, 1:2))
@test Base.mightalias(sa1, view(a1, 1:2))
end

@testset "back to Array" begin
Expand Down
40 changes: 15 additions & 25 deletions test/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,31 +168,21 @@ using StaticArrays, Test, LinearAlgebra

# issue #388
let x = SVector(1, 2, 3)
if VERSION >= v"0.7.0-beta.47"
# current limit: 34 arguments
hcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated hcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
vcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated vcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
else
# current limit: 14 arguments
hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
end
# current limit: 34 arguments
hcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated hcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
vcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
allocs = @allocated vcat(
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x)
@test allocs == 0
end

# issue #561
Expand Down
4 changes: 1 addition & 3 deletions test/mapreduce.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using StaticArrays, Test
if VERSION >= v"0.7.0-beta.85"
import Statistics: mean
end
using Statistics: mean

@testset "Map, reduce, mapreduce, broadcast" begin
@testset "map and map!" begin
Expand Down
14 changes: 4 additions & 10 deletions test/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,9 @@ end
@test (transpose(SA)*SB)::SMatrix{n,n} transpose(A)*transpose(B)
@test (transpose(SA)*transpose(SB))::SVector{n} transpose(A)*B
@test (transpose(SA)*SB')::SVector{n} transpose(A)*conj(B)
if VERSION < v"0.7-"
@test (SB*SA)::RowVector{<:Any,<:SVector{n}} transpose(B)*A
@test (SB*SA')::RowVector{<:Any,<:SVector{n}} transpose(B)*A'
@test (SB*transpose(SA))::RowVector{<:Any,<:SVector{n}} transpose(B)*transpose(A)
else
@test (SB*SA)::Transpose{<:Any,<:SVector{n}} transpose(B)*A
@test (SB*SA')::Transpose{<:Any,<:SVector{n}} transpose(B)*A'
@test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} transpose(B)*transpose(A)
end
@test (SB*SA)::Transpose{<:Any,<:SVector{n}} transpose(B)*A
@test (SB*SA')::Transpose{<:Any,<:SVector{n}} transpose(B)*A'
@test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} transpose(B)*transpose(A)
@test (transpose(SB)*SA)::SMatrix{n,n} B*A
@test (SB'*SA)::SMatrix{n,n} conj(B)*A
@test (transpose(SB)*transpose(SA))::SMatrix{n,n} B*transpose(A)
Expand All @@ -88,7 +82,7 @@ end
eltyB in (Float64, ComplexF64, Int),
(ta, uploa) in ((UpperTriangular, :U), (LowerTriangular, :L)),
(tb, uplob) in ((UpperTriangular, :U), (LowerTriangular, :L))

A = ta(eltyA == Int ? rand(1:7, n, n) : rand(eltyA, n, n))
B = tb(eltyB == Int ? rand(1:7, n, n) : rand(eltyB, n, n))

Expand Down

0 comments on commit d3f739e

Please sign in to comment.