warp.from_dlpack#
- warp.from_dlpack(source, dtype=None, hint=None)[source]#
Convert a source array or DLPack capsule into a Warp array without copying.
- Parameters:
source – A DLPack-compatible array or PyCapsule
dtype – An optional Warp data type to interpret the source data.
hint – A hint that helps to interpret opaque pointers. Currently supported hints are
warp.Texture1D,warp.Texture2D, andwarp.Texture3Dwhen the opaque pointer is acudaArray_thandle. Hints are ignored when the data type is notkDLOpaquePointer.
- Returns:
A new Warp array or texture that uses the same underlying memory as the source.
- Return type: