Skip to content

Commit a0b64c6

Browse files
NikeNanohaijieg
authored andcommitted
Checks are redundante
Signed-off-by: Niklas Hansson <niklas.sven.hansson@gmail.com>
1 parent 82f1291 commit a0b64c6

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

samples/VectorAddition.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,6 @@ def vec_add(a: torch.Tensor, b: torch.Tensor, use_gather: bool = False) -> torch
235235
# (TILE_X * TILE_Y) around 1024 (a common block size limit for threads).
236236
TILE_X = max(1, 1024 // TILE_Y)
237237

238-
# Further adjustment to ensure TILE_X * TILE_Y is not excessively large
239-
# if N (and thus TILE_Y) is small, or to prevent TILE_X from becoming zero.
240-
if TILE_X * TILE_Y > 1024 and TILE_X > 1:
241-
TILE_X = 1024 // TILE_Y
242-
if TILE_X == 0:
243-
TILE_X = 1 # Ensure TILE_X is at least 1
244-
245238
# Calculate the 2D grid dimensions for launching the kernel.
246239
# `math.ceil(M / TILE_X)` blocks along rows, `math.ceil(N / TILE_Y)` blocks along columns.
247240
grid = (math.ceil(M / TILE_X), math.ceil(N / TILE_Y), 1)

0 commit comments

Comments
 (0)