You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+72-4
Original file line number
Diff line number
Diff line change
@@ -134,12 +134,80 @@ Otherwise, returns `nothing`. For example, `known_step(UnitRange{Int})` returns
134
134
If `length` of an instance of type `T` is known at compile time, return it.
135
135
Otherwise, return `nothing`.
136
136
137
-
## Static(N::Int)
137
+
## device(::Type{T})
138
+
139
+
Indicates the most efficient way to access elements from the collection in low level code.
140
+
For `GPUArrays`, will return `ArrayInterface.GPU()`.
141
+
For `AbstractArray` supporting a `pointer` method, returns `ArrayInterface.CPUPointer()`.
142
+
For other `AbstractArray`s and `Tuple`s, returns `ArrayInterface.CPUIndex()`.
143
+
Otherwise, returns `nothing`.
144
+
145
+
## contiguous_axis(::Type{T})
146
+
147
+
Returns the axis of an array of type `T` containing contiguous data.
148
+
If no axis is contiguous, it returns `Contiguous{-1}`.
149
+
If unknown, it returns `nothing`.
150
+
151
+
## contiguous_axis_indicator(::Type{T})
152
+
153
+
Returns a tuple of boolean `Val`s indicating whether that axis is contiguous.
154
+
155
+
## contiguous_batch_size(::Type{T})
156
+
157
+
Returns the size of contiguous batches if `!isone(stride_rank(T, contiguous_axis(T)))`.
158
+
If `isone(stride_rank(T, contiguous_axis(T)))`, then it will return `ContiguousBatch{0}()`.
159
+
If `contiguous_axis(T) == -1`, it will return `ContiguousBatch{-1}()`.
160
+
If unknown, it will return `nothing`.
161
+
162
+
## stride_rank(::Type{T})
163
+
164
+
Returns the rank of each stride.
165
+
166
+
## dense_dims(::Type{T})
167
+
Returns a tuple of indicators for whether each axis is dense.
168
+
An axis `i` of array `A` is dense if `stride(A, i) * size(A, i) == stride(A, j)` where `j` is the axis (if it exists) such that `stride_rank(A)[i] + 1 == stride_rank(A)[j]`.
169
+
170
+
## ArrayInterface.size(A)
171
+
172
+
Returns the size of `A`. If the size of any axes are known at compile time,
173
+
these should be returned as `StaticInt`s. For example:
174
+
```julia
175
+
julia>using StaticArrays, ArrayInterface
176
+
177
+
julia> A =@SMatrixrand(3,4);
178
+
179
+
julia> ArrayInterface.size(A)
180
+
(StaticInt{3}(), StaticInt{4}())
181
+
```
182
+
183
+
## ArrayInterface.strides(A)
184
+
185
+
Returns the strides of array `A`. If any strides are known at compile time,
186
+
these should be returned as `StaticInt`s. For example:
187
+
```julia
188
+
julia>using ArrayInterface
189
+
190
+
julia> A =rand(3,4);
191
+
192
+
julia> ArrayInterface.strides(A)
193
+
(StaticInt{1}(), 3)
194
+
```
195
+
## offsets(A)
196
+
197
+
Returns offsets of indices with respect to 0. If values are known at compile time,
198
+
it should return them as `StaticInt`s.
199
+
For example, if `A isa Base.Matrix`, `offsets(A) === (StaticInt(1), StaticInt(1))`.
200
+
201
+
## can_avx(f)
202
+
203
+
Is the function `f` whitelisted for `LoopVectorization.@avx`?
204
+
205
+
## StaticInt(N::Int)
138
206
139
207
Creates a static integer with value known at compile time. It is a number,
140
-
supporting basic arithmetic. Many operations with two `Static` integers
141
-
will produce another `Static` integer. If one of the arguments to a
142
-
function call isn't static (e.g., `Static(4) + 3`) then the `Static`
208
+
supporting basic arithmetic. Many operations with two `StaticInt` integers
209
+
will produce another `StaticInt` integer. If one of the arguments to a
210
+
function call isn't static (e.g., `StaticInt(4) + 3`) then the `StaticInt`
0 commit comments