Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
__usm_ndarray_
_ protocol (#2261)
The PR is intended to adopt to dpctl changes implemented in [dpctl#1959](IntelPython/dpctl#1959). It implements support of `__usm_ndarray__` protocol for `dpnp.ndarray` and returns a property with `dpctl.tensor.usm_ndarray` instance corresponding to the content of the array object. This property is intended to speed-up conversion from `dpnp.ndarray` to `dpt.usm_ndarray` in `x=dpt.asarray(dpnp_array_obj)`. The input object that implements `__usm_ndarray__` is recognized as owner of USM allocation that is managed by a smart pointer, and asynchronous deallocation of `x` need not involve GIL.
- Loading branch information