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 ) =
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
4949end
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} =
155155end
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)))
159159struct 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))
196196end
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))
203203end
204204
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