Skip to content

Commit

Permalink
Correct compat, fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Aug 31, 2021
1 parent db1e16a commit 63e5a8f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
9 changes: 5 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TriangularSolve"
uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf"
authors = ["chriselrod <[email protected]> and contributors"]
version = "0.1.4"
version = "0.1.5"

[deps]
CloseOpenIntervals = "fb6a15b2-703c-40df-9091-08a04967cfa9"
Expand All @@ -18,13 +18,14 @@ CloseOpenIntervals = "0.1"
IfElse = "0.1"
LayoutPointers = "0.1.2"
LoopVectorization = "0.12.30"
Polyester = "0.3, 0.4"
Polyester = "0.4"
Static = "0.2, 0.3"
VectorizationBase = "0.20, 0.21"
VectorizationBase = "0.21"
julia = "1.5"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Aqua", "Test"]
20 changes: 12 additions & 8 deletions src/TriangularSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ end
end
@inline store_small_kern!(spa, ::Nothing, v, spu, i, n, ::Val{false}) = vstore!(spa, v / vload(spu, (n,n)), i)

function BdivU_small_kern!(spa::AbstractStridedPointer{T}, sp, spb::AbstractStridedPointer{T}, spu::AbstractStridedPointer{T}, N, mask, ::Val{UNIT}) where {T,UNIT}
W = VectorizationBase.pick_vector_width(T)
function BdivU_small_kern!(spa::AbstractStridedPointer{T}, sp, spb::AbstractStridedPointer{T}, spu::AbstractStridedPointer{T}, N, mask::AbstractMask{W}, ::Val{UNIT}) where {T,UNIT,W}
# W = VectorizationBase.pick_vector_width(T)
for n CloseOpen(N)
Amn = vload(spb, (MM(W, StaticInt(0)),n), mask)
Amn = vload(spb, (MM{W}(StaticInt(0)),n), mask)
for k SafeCloseOpen(n)
Amn = vfnmadd_fast(vload(spa, (MM(W, StaticInt(0)),k), mask), vload(spu, (k,n)), Amn)
Amn = vfnmadd_fast(vload(spa, (MM{W}(StaticInt(0)),k), mask), vload(spu, (k,n)), Amn)
end
store_small_kern!(spa, sp, Amn, spu, (MM(W, StaticInt(0)),n), n, mask, Val{UNIT}())
store_small_kern!(spa, sp, Amn, spu, (MM{W}(StaticInt(0)),n), n, mask, Val{UNIT}())
end
end
function BdivU_small_kern_u!(spa::AbstractStridedPointer{T}, sp, spb::AbstractStridedPointer{T}, spu::AbstractStridedPointer{T}, N, ::StaticInt{U}, ::Val{UNIT}) where {T,U,UNIT}
Expand Down Expand Up @@ -240,7 +240,7 @@ end
end
end

function rdiv_U!(spc::AbstractStridedPointer{T}, spa, spu, M, N, ::StaticInt{1}, ::Val{UNIT}) where {T,UNIT}
function rdiv_U!(spc::AbstractStridedPointer{T}, spa::AbstractStridedPointer, spu::AbstractStridedPointer, M, N, ::StaticInt{1}, ::Val{UNIT}) where {T,UNIT}
WS = pick_vector_width(T)
W = Int(WS)
UF = unroll_factor(WS)
Expand Down Expand Up @@ -291,8 +291,12 @@ const LDIVBUFFERS = Vector{UInt8}[]
si = StrideIndex{2,(1,2),1}((VectorizationBase.static_sizeof(T), RSUF), (StaticInt(0),StaticInt(0)))
stridedpointer(ptr, si, StaticInt{0}())
end
_canonicalize(x) = signed(x)
_canonicalize(::StaticInt{N}) where {N} = StaticInt{N}()
function div_dispatch!(C::AbstractMatrix{T}, A, U, ::Val{UNIT}, ::Val{THREAD}) where {UNIT,T,THREAD}
M, N = size(A)
_M, _N = size(A)
M = _canonicalize(_M)
N = _canonicalize(_N)
((N == 0) | (M == 0)) && return nothing
_spa, spap = stridedpointer_preserve(A)
_spc, spcp = stridedpointer_preserve(C)
Expand Down Expand Up @@ -475,7 +479,7 @@ function unroll_factor(::StaticInt{W}) where {W}
ifelse(Static.lt(num_blocks, StaticInt{1}()), StaticInt{1}(), num_blocks)
end

function rdiv_U!(spc::AbstractStridedPointer{T}, spa, spu, M, N, ::StaticInt, ::Val{UNIT}) where {T,UNIT}
function rdiv_U!(spc::AbstractStridedPointer{T}, spa::AbstractStridedPointer, spu::AbstractStridedPointer, M, N, ::StaticInt{var"#UNUSED#"}, ::Val{UNIT}) where {T,UNIT,var"#UNUSED#"}
WS = pick_vector_width(T)
W = Int(WS)
UF = unroll_factor(WS)
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ end
test_solve(Float32)
end
end

using Aqua
Aqua.test_all(TriangularSolve)

2 comments on commit 63e5a8f

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/43845

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.5 -m "<description of version>" 63e5a8f63ab5ccc9c8691de1756e61ca9bdb2c2d
git push origin v0.1.5

Please sign in to comment.