Skip to content

Commit c630052

Browse files
author
Diptorup Deb
committed
Extra dbg prints added to _dpexrt_python.c
1 parent 094f852 commit c630052

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

numba_dpex/core/runtime/_dpexrt_python.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,13 +859,21 @@ static PyObject *box_from_arystruct_parent(arystruct_t *arystruct,
859859
struct PyUSMArrayObject *arrayobj = NULL;
860860
npy_intp itemsize = 0;
861861

862-
DPEXRT_DEBUG(drt_debug_print("DPEXRT-DEBUG: In try_to_return_parent.\n"));
862+
DPEXRT_DEBUG(
863+
drt_debug_print("DPEXRT-DEBUG: In box_from_arystruct_parent.\n"));
863864

864-
if (!(arrayobj = PyUSMNdArray_ARRAYOBJ(arystruct->parent)))
865+
if (!(arrayobj = PyUSMNdArray_ARRAYOBJ(arystruct->parent))) {
866+
DPEXRT_DEBUG(
867+
drt_debug_print("DPEXRT-DEBUG: Arrayobj cannot be boxed from "
868+
"parent as parent pointer is NULL.\n"));
865869
return NULL;
870+
}
866871

867-
if ((void *)UsmNDArray_GetData(arrayobj) != arystruct->data)
872+
if ((void *)UsmNDArray_GetData(arrayobj) != arystruct->data) {
873+
DPEXRT_DEBUG(drt_debug_print("DPEXRT-DEBUG: Arrayobj cannot be boxed "
874+
"from parent as data pointer is NULL.\n"));
868875
return NULL;
876+
}
869877

870878
if (UsmNDArray_GetNDim(arrayobj) != ndim)
871879
return NULL;
@@ -985,6 +993,10 @@ DPEXRT_sycl_usm_ndarray_to_python_acqref(arystruct_t *arystruct,
985993
// return back to Python memory that was allocated inside Numba and let
986994
// Python manage the lifetime of the memory.
987995
if (arystruct->meminfo) {
996+
DPEXRT_DEBUG(
997+
drt_debug_print("DPEXRT-DEBUG: Set the base of the boxed array "
998+
"from arystruct's meminfo pointer at %s, line %d\n",
999+
__FILE__, __LINE__));
9881000
// wrap into MemInfoObject
9891001
if (!(miobj = PyObject_New(MemInfoObject, &MemInfoType))) {
9901002
PyErr_Format(PyExc_ValueError,

0 commit comments

Comments
 (0)