diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 92ac58c74..41f75f026 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -69,3 +69,15 @@ steps: Pkg.instantiate() include("test/gpu/metal.jl")' timeout_in_minutes: 30 + + - label: "CPUs -- StaticArrays.jl" + plugins: + - JuliaCI/julia#v1: + version: 1.9 + command: | + julia --color=yes --project -e ' + using Pkg + Pkg.add("StaticArrays") + Pkg.instantiate() + include("test/test_extensions.jl")' + timeout_in_minutes: 30 diff --git a/src/krylov_utils.jl b/src/krylov_utils.jl index 137a97386..3334297d3 100644 --- a/src/krylov_utils.jl +++ b/src/krylov_utils.jl @@ -210,9 +210,9 @@ function ktypeof(v::S) where S <: DenseVector end function ktypeof(v::S) where S <: AbstractVector - if S.name.name == :Zeros || S.name.name == :Ones + if S.name.name == :Zeros || S.name.name == :Ones || S.name.name == :SArray || S.name.name || :MArray T = eltype(S) - return Vector{T} # FillArrays + return Vector{T} # FillArrays, StaticArrays else return S # BlockArrays, PartitionedArrays, etc... end diff --git a/test/test_extensions.jl b/test/test_extensions.jl new file mode 100644 index 000000000..744d18c8a --- /dev/null +++ b/test/test_extensions.jl @@ -0,0 +1,21 @@ +using LinearAlgebra, SparseArrays, Test +using Krylov, StaticArrays + +@testset "StaticArrays" begin + n = 2 + m = 3 + + for T in (Float32, Float64) + A = rand(Float32, n, n) + b = SVector{n}(rand(Float32, n)) + @test Krylov.ktypeof(b) == Vector{T} + x, stats = gmres(A, b) + @test stats.solved + + A = rand(Float64, m, m) + b = MVector{m}(rand(Float64, m)) + @test Krylov.ktypeof(b) == Vector{T} + x, stats = gmres(A, b) + @test stats.solved + end +end