Skip to content

Commit 1a50023

Browse files
committed
clarify load store oob behavior
Signed-off-by: Boyan Li <boyanl@nvidia.com>
1 parent 4d4c491 commit 1a50023

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/cuda/tile/_stub.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,11 @@ def load(self, index: Shape, *,
492492
allow_tma: Optional[bool] = None) -> Tile:
493493
"""Loads a tile from the |tiled view| at the given tile `index`.
494494
495-
The returned tile has shape :attr:`tile_shape`. Out-of-bounds elements
495+
The returned tile has shape :attr:`tile_shape`.
496+
497+
For a tile that partially extends beyond the tiled view boundaries, out-of-bound elements
496498
are filled according to the view's padding mode.
499+
If the tile lies entirely outside the tiled view, the behavior is undefined.
497500
498501
Args:
499502
index (tuple[int,...]): An index in the |tiled view|'s tile space.
@@ -524,6 +527,10 @@ def store(self, index: Shape, tile: Tile, *,
524527
The `tile`'s shape must be broadcastable to :attr:`tile_shape`.
525528
If the `tile`'s dtype differs from the view's dtype, an implicit cast is performed.
526529
530+
For a tile that partially extends beyond the tiled view boundaries, out-of-bound elements
531+
are ignored.
532+
If the tile lies entirely outside the tiled view, the behavior is undefined.
533+
527534
Args:
528535
index (tuple[int,...]): An index in the |tiled view|'s tile space.
529536
tile (Tile): The tile to store.
@@ -660,7 +667,9 @@ def load(array: Array, /,
660667
661668
t[x, y] = array[i * tm + x, j * tn + y] (for all 0<=x<tm, 0<=y<tn)
662669
663-
For access that is out of bound, the value will be determined by `padding_mode`.
670+
For a tile that partially extends beyond the array boundaries, out-of-bound elements
671+
are filled according to `padding_mode`.
672+
If the tile lies entirely outside the array, the behavior is undefined.
664673
665674
`order` is used to map the tile axis to the array axis. The transposed example of the above call
666675
to `load` would be:
@@ -732,7 +741,9 @@ def store(array: Array, /,
732741
733742
array[i * tm + x, i * tn + y] = t[x, y] (for 0<=x<tm, 0<=y<tn)
734743
735-
Access which falls out of the boundary of the `array` will be ignored.
744+
For a tile that partially extends beyond the array boundaries, out-of-bound elements
745+
are ignored.
746+
If the tile lies entirely outside the array, the behavior is undefined.
736747
737748
Args:
738749
array (Array): The |array| to store to.

0 commit comments

Comments
 (0)