Skip to content

Commit 243cbf8

Browse files
authored
Merge branch 'main' into fix/cuda-graph-memfree-dep-tracking
2 parents 310b196 + 8f73736 commit 243cbf8

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

docs/user_guide/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Kernel-level settings can be passed as arguments to the :func:`@wp.kernel <warp.
159159
160160
161161
@wp.kernel(module_options={"fast_math": True}, module="unique")
162-
def fast_kernel(a: wp.array(dtype=float), b: wp.array(dtype=float)):
162+
def fast_kernel(a: wp.array[float], b: wp.array[float]):
163163
# fast_math is applied to this kernel's unique module
164164
tid = wp.tid()
165165
b[tid] = a[tid] + 1.0

docs/user_guide/tiles.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ In Warp, tile objects are arrays of data where the tile elements may be scalars,
7878
TILE_THREADS = 64
7979
8080
@wp.kernel
81-
def compute(a: array2d(dtype=float)):
81+
def compute(a: wp.array2d[float]):
8282
8383
# obtain our 2d block index
8484
i, j = wp.tid()
@@ -483,7 +483,7 @@ The ``capacity`` must be a compile-time constant and ``dtype`` specifies the ele
483483
CAPACITY = wp.constant(256)
484484
485485
@wp.kernel
486-
def my_kernel(data: wp.array(dtype=float)):
486+
def my_kernel(data: wp.array[float]):
487487
i, j = wp.tid()
488488
s = wp.tile_stack(capacity=CAPACITY, dtype=float)
489489
...
@@ -554,7 +554,7 @@ output array:
554554
CAPACITY = wp.constant(BLOCK_DIM) # at most one output per thread
555555
556556
@wp.kernel
557-
def compact_kernel(data: wp.array(dtype=float), out: wp.array(dtype=float)):
557+
def compact_kernel(data: wp.array[float], out: wp.array[float]):
558558
_i, j = wp.tid()
559559
560560
val = data[j]
@@ -982,8 +982,8 @@ then moves on. The next load cannot begin until the current store completes:
982982

983983
@wp.kernel
984984
def sequential(
985-
inp: wp.array2d(dtype=float),
986-
out: wp.array2d(dtype=float),
985+
inp: wp.array2d[float],
986+
out: wp.array2d[float],
987987
):
988988
for i in range(N_ROWS):
989989
a = wp.tile_load(inp, shape=(1, TILE_N), offset=(i, 0), storage="register")
@@ -995,8 +995,8 @@ then moves on. The next load cannot begin until the current store completes:
995995

996996
@wp.kernel
997997
def pipelined(
998-
inp: wp.array2d(dtype=float),
999-
out: wp.array2d(dtype=float),
998+
inp: wp.array2d[float],
999+
out: wp.array2d[float],
10001000
):
10011001
# Load first tile
10021002
a = wp.tile_load(inp, shape=(1, TILE_N), offset=(0, 0), storage="register")

warp/__init__.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,7 +3378,7 @@ def tile_scatter_add(a: Tile[Any, tuple[int, ...]], i: int32, value: Any, has_va
33783378
.. code-block:: python
33793379
33803380
@wp.kernel
3381-
def histogram(data: wp.array(dtype=float), out: wp.array(dtype=float)):
3381+
def histogram(data: wp.array[float], out: wp.array[float]):
33823382
33833383
bins = wp.tile_zeros(dtype=float, shape=4, storage="shared")
33843384
i = wp.tid()
@@ -4316,7 +4316,7 @@ def tile_stack(capacity: int32, dtype: Any) -> TileStack[Any, Any]:
43164316
CAP = wp.constant(8)
43174317
43184318
@wp.kernel
4319-
def compact_kernel(data: wp.array(dtype=int), out: wp.array(dtype=int), out_count: wp.array(dtype=int)):
4319+
def compact_kernel(data: wp.array[int], out: wp.array[int], out_count: wp.array[int]):
43204320
_i, j = wp.tid()
43214321
s = wp.tile_stack(capacity=CAP, dtype=int)
43224322
@@ -4365,7 +4365,7 @@ def tile_stack_push(s: Any, value: Any, has_value: bool) -> int:
43654365
CAP = wp.constant(8)
43664366
43674367
@wp.kernel
4368-
def push_kernel(out_idx: wp.array(dtype=int)):
4368+
def push_kernel(out_idx: wp.array[int]):
43694369
_i, j = wp.tid()
43704370
s = wp.tile_stack(capacity=CAP, dtype=int)
43714371
idx = wp.tile_stack_push(s, j * 10, j < 4)
@@ -4408,7 +4408,7 @@ def tile_stack_pop(s: Any) -> tuple[Any, int]:
44084408
CAP = wp.constant(8)
44094409
44104410
@wp.kernel
4411-
def pop_kernel(out: wp.array(dtype=int)):
4411+
def pop_kernel(out: wp.array[int]):
44124412
_i, j = wp.tid()
44134413
s = wp.tile_stack(capacity=CAP, dtype=int)
44144414
wp.tile_stack_push(s, j * 10, j < 4)
@@ -4443,7 +4443,7 @@ def tile_stack_clear(s: Any) -> None:
44434443
CAP = wp.constant(8)
44444444
44454445
@wp.kernel
4446-
def clear_kernel(before: wp.array(dtype=int), after: wp.array(dtype=int)):
4446+
def clear_kernel(before: wp.array[int], after: wp.array[int]):
44474447
_i, j = wp.tid()
44484448
s = wp.tile_stack(capacity=CAP, dtype=int)
44494449
wp.tile_stack_push(s, j, True)
@@ -4489,7 +4489,7 @@ def tile_stack_count(s: Any) -> int:
44894489
CAP = wp.constant(8)
44904490
44914491
@wp.kernel
4492-
def count_kernel(out_count: wp.array(dtype=int)):
4492+
def count_kernel(out_count: wp.array[int]):
44934493
_i, j = wp.tid()
44944494
s = wp.tile_stack(capacity=CAP, dtype=int)
44954495
wp.tile_stack_push(s, j, j % 2 == 0)

warp/_src/builtins.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4758,7 +4758,7 @@ def tile_scatter_add_dispatch_func(input_types, return_type, args):
47584758
.. code-block:: python
47594759
47604760
@wp.kernel
4761-
def histogram(data: wp.array(dtype=float), out: wp.array(dtype=float)):
4761+
def histogram(data: wp.array[float], out: wp.array[float]):
47624762
47634763
bins = wp.tile_zeros(dtype=float, shape=4, storage="shared")
47644764
i = wp.tid()
@@ -7018,7 +7018,7 @@ def tile_stack_dispatch_func(arg_types, return_type, arg_values):
70187018
CAP = wp.constant(8)
70197019
70207020
@wp.kernel
7021-
def compact_kernel(data: wp.array(dtype=int), out: wp.array(dtype=int), out_count: wp.array(dtype=int)):
7021+
def compact_kernel(data: wp.array[int], out: wp.array[int], out_count: wp.array[int]):
70227022
_i, j = wp.tid()
70237023
s = wp.tile_stack(capacity=CAP, dtype=int)
70247024
@@ -7098,7 +7098,7 @@ def tile_stack_push_dispatch_func(arg_types, return_type, arg_values):
70987098
CAP = wp.constant(8)
70997099
71007100
@wp.kernel
7101-
def push_kernel(out_idx: wp.array(dtype=int)):
7101+
def push_kernel(out_idx: wp.array[int]):
71027102
_i, j = wp.tid()
71037103
s = wp.tile_stack(capacity=CAP, dtype=int)
71047104
idx = wp.tile_stack_push(s, j * 10, j < 4)
@@ -7166,7 +7166,7 @@ def tile_stack_pop_dispatch_func(arg_types, return_type, arg_values):
71667166
CAP = wp.constant(8)
71677167
71687168
@wp.kernel
7169-
def pop_kernel(out: wp.array(dtype=int)):
7169+
def pop_kernel(out: wp.array[int]):
71707170
_i, j = wp.tid()
71717171
s = wp.tile_stack(capacity=CAP, dtype=int)
71727172
wp.tile_stack_push(s, j * 10, j < 4)
@@ -7226,7 +7226,7 @@ def tile_stack_clear_dispatch_func(arg_types, return_type, arg_values):
72267226
CAP = wp.constant(8)
72277227
72287228
@wp.kernel
7229-
def clear_kernel(before: wp.array(dtype=int), after: wp.array(dtype=int)):
7229+
def clear_kernel(before: wp.array[int], after: wp.array[int]):
72307230
_i, j = wp.tid()
72317231
s = wp.tile_stack(capacity=CAP, dtype=int)
72327232
wp.tile_stack_push(s, j, True)
@@ -7297,7 +7297,7 @@ def tile_stack_count_dispatch_func(arg_types, return_type, arg_values):
72977297
CAP = wp.constant(8)
72987298
72997299
@wp.kernel
7300-
def count_kernel(out_count: wp.array(dtype=int)):
7300+
def count_kernel(out_count: wp.array[int]):
73017301
_i, j = wp.tid()
73027302
s = wp.tile_stack(capacity=CAP, dtype=int)
73037303
wp.tile_stack_push(s, j, j % 2 == 0)

0 commit comments

Comments
 (0)