MCPcopy Create free account
hub / github.com/numpy/numpy / array_dlpack_device

Function array_dlpack_device

numpy/core/src/multiarray/dlpack.c:279–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279PyObject *
280array_dlpack_device(PyArrayObject *self, PyObject *NPY_UNUSED(args))
281{
282 DLDevice device = array_get_dl_device(self);
283 if (PyErr_Occurred()) {
284 return NULL;
285 }
286 return Py_BuildValue("ii", device.device_type, device.device_id);
287}
288
289NPY_NO_EXPORT PyObject *
290from_dlpack(PyObject *NPY_UNUSED(self), PyObject *obj) {

Callers

nothing calls this directly

Calls 1

array_get_dl_deviceFunction · 0.85

Tested by

no test coverage detected