warp
warp copied to clipboard
[BUG] Warp does not auto-initialize when working with half precision
Bug Description
The expected behavior is that the user shouldn't need to explicitly invoke wp.init() when using the public API functions.
>>> import warp as wp
>>> a = wp.vec2h(2,2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/eshi/code-projects/warp/warp/types.py", line 324, in __init__
super().__setitem__(i, vec_t.scalar_import(args[i]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eshi/code-projects/warp/warp/types.py", line 181, in float_to_half_bits
return warp.context.runtime.core.wp_float_to_half_bits(value)
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'core'
This is because float_to_half_bits and half_bits_to_float both call into the native library.
System Information
No response
Moving to backlog for now as this has the potential to add a lot of overhead.