Skip to content

Commit b20bc37

Browse files
committed
strides->static_strides
1 parent 60f16f9 commit b20bc37

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/grouped_strided_pointers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545
DensePointerWrapper{D,T,N,C,B,R,X,O,P}(sp)
4646

4747
@inline _gp_strides(x::StrideIndex) = getfield(x, :strides)
48-
@inline _gp_strides(x) = strides(x)
48+
@inline _gp_strides(x) = static_strides(x)
4949
@inline _gp_strides(::NoStrides) = NoStrides()
5050
grouped_strided_pointer(::Tuple{}, ::Val{()}) = ((), ())
5151

src/stridedpointers.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212
(mulsizeof(T, getfield(x, 1, false)), mulsizeof(T, Base.tail(x))...)
1313

1414
@inline bytestrides(A::AbstractArray{T}) where {T} =
15-
mulsizeof(T, StaticArrayInterface.strides(A))
15+
mulsizeof(T, StaticArrayInterface.static_strides(A))
1616

1717
@inline memory_reference(A::NTuple) = memory_reference(StaticArrayInterface.device(A), A)
1818
@inline memory_reference(A::AbstractArray) =
@@ -43,7 +43,7 @@ end
4343
pA = parent(A)
4444
offset = StaticArrayInterface.reduce_tup(
4545
+,
46-
_map(*, _map(ind_diff, A.indices, offsets(pA)), strides(pA)),
46+
_map(*, _map(ind_diff, A.indices, offsets(pA)), static_strides(pA)),
4747
)
4848
p + sizeof(eltype(A)) * offset, m
4949
end
@@ -133,7 +133,7 @@ end
133133
)
134134
@inline zstridedpointer(A) = zero_offsets(stridedpointer(A))
135135
@inline function zstridedpointer_preserve(A::AbstractArray{T,N}) where {T,N}
136-
strd = mulsizeof(T, StaticArrayInterface.strides(A))
136+
strd = mulsizeof(T, StaticArrayInterface.static_strides(A))
137137
si = StrideIndex{N,known(stride_rank(A)),Int(contiguous_axis(A))}(
138138
strd,
139139
zerotuple(Val(N)),
@@ -155,7 +155,7 @@ Base.unsafe_convert(::Type{Ptr{T}}, ptr::AbstractStridedPointer{T}) where {T} =
155155
end
156156

157157
@inline dynamic_offsets(si::StrideIndex{N,R,C}) where {N,R,C} =
158-
StrideIndex{N,R,C}(strides(si), _map(Int, offsets(si)))
158+
StrideIndex{N,R,C}(static_strides(si), _map(Int, offsets(si)))
159159
struct StridedBitPointer{N,C,B,R,X,O} <: AbstractStridedPointer{Bit,N,C,B,R,X,O}
160160
p::Ptr{Bit}
161161
si::StrideIndex{N,R,C,X,O}
@@ -191,14 +191,14 @@ end
191191
ptr::Ptr,
192192
offset::Tuple,
193193
) where {T,N,C,B,R}
194-
si = StrideIndex{N,R,C}(strides(sptr), offset)
194+
si = StrideIndex{N,R,C}(static_strides(sptr), offset)
195195
stridedpointer(ptr, si, contiguous_batch_size(sptr))
196196
end
197197
@inline function similar_no_offset(
198198
sptr::AbstractStridedPointer{T,N,C,B,R},
199199
ptr::Ptr,
200200
) where {T,N,C,B,R}
201-
si = StrideIndex{N,R,C}(strides(sptr), zerotuple(Val(N)))
201+
si = StrideIndex{N,R,C}(static_strides(sptr), zerotuple(Val(N)))
202202
stridedpointer(ptr, si, contiguous_batch_size(sptr))
203203
end
204204

@@ -211,7 +211,7 @@ end
211211
# s += A[i,i]
212212
# end
213213
# first access is at zero-based index
214-
# (first(6:16) - StaticArrayInterface.offsets(a)[1]) * StaticArrayInterface.strides(A)[1] + (first(6:16) - StaticArrayInterface.offsets(a)[2]) * StaticArrayInterface.strides(A)[2]
214+
# (first(6:16) - StaticArrayInterface.offsets(a)[1]) * StaticArrayInterface.static_strides(A)[1] + (first(6:16) - StaticArrayInterface.offsets(a)[2]) * StaticArrayInterface.static_strides(A)[2]
215215
# equal to
216216
# (6 - 6)*1 + (6 - 5)*10 = 10
217217
# i.e., the 1-based index 11.

0 commit comments

Comments
 (0)