Skip to content

Commit fe21ae1

Browse files
authored
Updates for ArrayInterface 3. (#63)
1 parent 051ddfa commit fe21ae1

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Octavian"
22
uuid = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
33
authors = ["Mason Protter", "Chris Elrod", "Dilum Aluthge", "contributors"]
4-
version = "0.2.7"
4+
version = "0.2.8"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
@@ -10,10 +10,10 @@ ThreadingUtilities = "8290d209-cae3-49c0-8002-c8c24d57dab5"
1010
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
1111

1212
[compat]
13-
ArrayInterface = "2.14"
14-
LoopVectorization = "0.10"
13+
ArrayInterface = "3"
14+
LoopVectorization = "0.11"
1515
ThreadingUtilities = "0.2"
16-
VectorizationBase = "0.16"
16+
VectorizationBase = "0.17"
1717
julia = "1.5"
1818

1919
[extras]

src/Octavian.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ using VectorizationBase: align, AbstractStridedPointer, zstridedpointer,
77
snum_cache_levels, scache_size, snum_cores, num_cores, cache_inclusivity, scacheline_size
88
using LoopVectorization: maybestaticsize, matmul_params, preserve_buffer, CloseOpen
99
using ArrayInterface: StaticInt, Zero, One, OptionallyStaticUnitRange, size, strides, offsets, indices,
10-
static_length, static_first, static_last, axes,
11-
dense_dims, DenseDims, stride_rank, StrideRank
10+
static_length, static_first, static_last, axes, dense_dims, stride_rank
1211

1312
using ThreadingUtilities:
1413
_atomic_add!, _atomic_umax!, _atomic_umin!,

src/matmul.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function matmul_st_pack_A_and_B!(
7474
nothing
7575
end
7676

77-
@inline contiguousstride1(A) = ArrayInterface.contiguous_axis(A) === ArrayInterface.Contiguous{1}()
77+
@inline contiguousstride1(A) = ArrayInterface.contiguous_axis(A) === One()
7878
@inline contiguousstride1(A::AbstractStridedPointer{T,N,1}) where {T,N} = true
7979
# @inline bytestride(A::AbstractArray, i) = VectorizationBase.bytestrides(A)[i]
8080
@inline bytestride(A::AbstractStridedPointer, i) = strides(A)[i]
@@ -125,11 +125,11 @@ end
125125
@inline function matmul_serial!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β)
126126
matmul_serial!(C, A, B, α, β, nothing, ArrayInterface.contiguous_axis(C))
127127
end
128-
@inline function matmul_serial!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, MKN, ::ArrayInterface.Contiguous{2})
128+
@inline function matmul_serial!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, MKN, ::StaticInt{2})
129129
_matmul_serial!(C', B', A', α, β, nothing)
130130
return C
131131
end
132-
@inline function matmul_serial!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, MKN, ::ArrayInterface.Contiguous)
132+
@inline function matmul_serial!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, MKN, ::StaticInt)
133133
_matmul_serial!(C, A, B, α, β, nothing)
134134
return C
135135
end
@@ -210,11 +210,11 @@ end
210210
@inline function matmul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, nthread)
211211
matmul!(C, A, B, α, β, nthread, nothing, ArrayInterface.contiguous_axis(C))
212212
end
213-
@inline function matmul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, nthread, MKN, ::ArrayInterface.Contiguous{2})
213+
@inline function matmul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, nthread, MKN, ::StaticInt{2})
214214
_matmul!(C', B', A', α, β, nthread, MKN)
215215
return C
216216
end
217-
@inline function matmul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, nthread, MKN, ::ArrayInterface.Contiguous)
217+
@inline function matmul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, α, β, nthread, MKN, ::StaticInt)
218218
_matmul!(C, A, B, α, β, nthread, MKN)
219219
return C
220220
end

0 commit comments

Comments
 (0)