You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wp.indexedarray cannot currently be used as a field in wp.struct (assignment/device transfer/NumPy structured values) while it can be passed as an argument to a wp.kernel. There is no apparent reason not to support this possibility as all the blocks are already in place.
Traceback (most recent call last):
File "examples/tmp.py", line 4, in <module>
@wp.struct
^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/warp/_src/context.py", line 1451, in struct
return wrapper(c)
^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/warp/_src/context.py", line 1443, in wrapper
s = warp._src.codegen.Struct(key=warp._src.codegen.make_full_qualified_name(c), cls=c, module=m)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/warp/_src/codegen.py", line 522, in __init__
elif issubclass(var.type, ctypes.Array):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: issubclass() arg 1 must be a class
Expected:
Allow wp.indexedarray fields in structs with the same behavior as wp.array:
assign indexedarray (or None) to struct fields
StructInstance.to(device) moves indexedarray members
works in kernels, nested structs, and struct arrays
Struct.numpy_dtype() / StructInstance.numpy_value() work
Activity
shi-eric commentedon Apr 16, 2026
This was merged in 537ae37