-
Notifications
You must be signed in to change notification settings - Fork 473
Open
Description
Kernels with generic arguments like wp.array(dtype=Any) currently cannot be provided with None for these generic arguments even though it should be possible.
from typing import Any
import warp as wp
wp.init()
@wp.kernel
def foo(
in_values: wp.array(dtype=Any),
out: wp.array(dtype=Any),
):
tid = wp.tid()
if not in_values:
return
out[tid] = in_values[tid]
out = wp.ones(10, dtype=wp.float32)
values = None
wp.launch(foo, dim=out.shape, inputs=(values,), outputs=(out,))Output:
File "/home/eshi/code-projects/warp/warp/context.py", line 5490, in launch
kernel = kernel.add_overload(fwd_types)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eshi/code-projects/warp/warp/context.py", line 715, in add_overload
raise TypeError(
TypeError: Kernel foo argument 'in_values' cannot be generic, got arraytyping.Any
Reactions are currently unavailable