Skip to content

Commit

Permalink
Merge branch 'from_ptr_update' into 'main'
Browse files Browse the repository at this point in the history
Update from_ptr() deprecation warning

See merge request omniverse/warp!941
  • Loading branch information
daedalus5 committed Dec 20, 2024
2 parents c5b8568 + 6a3e860 commit 5b7a934
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion warp/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,13 @@ def array4d(*args, **kwargs):

def from_ptr(ptr, length, dtype=None, shape=None, device=None):
warp.utils.warn(
"This version of wp.from_ptr() is deprecated. OmniGraph applications should use from_omni_graph_ptr() instead. In the future, wp.from_ptr() will work only with regular pointers.",
"""This version of wp.from_ptr() is deprecated. OmniGraph
applications should use from_omni_graph_ptr() instead. To create an array
from a C pointer, use the array constructor and pass the ptr argument as a
uint64 value representing the start address in memory where the existing
array resides. For example, if using ctypes, pass
ptr=ctypes.cast(pointer, ctypes.POINTER(ctypes.c_size_t)).contents.value.
Be sure to also specify the dtype and shape parameters.""",
category=DeprecationWarning,
)

Expand Down

0 comments on commit 5b7a934

Please sign in to comment.