Skip to content

Commit 4fd868e

Browse files
authored
Document units for stride (#106)
stride is in number of elements, not bytes. This can be confusing for users coming from other libraries.
1 parent e1525b0 commit 4fd868e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/array/array.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ NDARRAY_HOST_DEVICE index_t clamp(index_t x, const Range& r) {
391391
* These parameters define a mapping from the indices of the dimension to
392392
* offsets: `offset(x) = (x - min)*stride`. The extent does not affect the
393393
* mapping directly. Values not in the interval `[min, min + extent)` are considered
394-
* to be out of bounds. */
394+
* to be out of bounds. Note that `stride` is in units of number of array elements,
395+
* not bytes. */
395396
template <index_t Min_ = dynamic, index_t Extent_ = dynamic, index_t Stride_ = dynamic>
396397
class dim : protected interval<Min_, Extent_> {
397398
public:

0 commit comments

Comments
 (0)