Skip to content

Commit 97a7266

Browse files
author
Diptorup Deb
committed
Improve debug messages in dpexrt_python.c
1 parent e066286 commit 97a7266

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

numba_dpex/core/runtime/_dpexrt_python.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ static NRT_MemInfo *NRT_MemInfo_new_from_usmndarray(PyObject *ndarrobj,
467467
mi->size = nitems * itemsize;
468468
mi->external_allocator = ext_alloca;
469469

470-
DPEXRT_DEBUG(drt_debug_print(
471-
"DPEXRT-DEBUG: NRT_MemInfo_init mi=%p external_allocator=%p\n", mi,
472-
ext_alloca));
470+
DPEXRT_DEBUG(drt_debug_print("DPEXRT-DEBUG: NRT_MemInfo_init mi=%p "
471+
"external_allocator=%p at %s, line %d\n",
472+
mi, ext_alloca, __FILE__, __LINE__));
473473

474474
return mi;
475475

@@ -797,14 +797,15 @@ static int DPEXRT_sycl_usm_ndarray_from_python(PyObject *obj,
797797
Py_IncRef(obj);
798798

799799
DPEXRT_DEBUG(drt_debug_print(
800-
"DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python.\n"));
800+
"DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at %s, line %d\n",
801+
__FILE__, __LINE__));
801802

802803
// Check if the PyObject obj has an _array_obj attribute that is of
803804
// dpctl.tensor.usm_ndarray type.
804805
if (!(arrayobj = PyUSMNdArray_ARRAYOBJ(obj))) {
805806
DPEXRT_DEBUG(drt_debug_print(
806-
"DPEXRT-ERROR: PyUSMNdArray_ARRAYOBJ check failed %d\n", __FILE__,
807-
__LINE__));
807+
"DPEXRT-ERROR: PyUSMNdArray_ARRAYOBJ check failed at %s, line %d\n",
808+
__FILE__, __LINE__));
808809
goto error;
809810
}
810811

@@ -874,6 +875,11 @@ static int DPEXRT_sycl_usm_ndarray_from_python(PyObject *obj,
874875
}
875876
}
876877

878+
DPEXRT_DEBUG(
879+
drt_debug_print("DPEXRT-DEBUG: Done with unboxing call to "
880+
"DPEXRT_sycl_usm_ndarray_from_python at %s, line %d\n",
881+
__FILE__, __LINE__));
882+
877883
return 0;
878884

879885
error:

0 commit comments

Comments
 (0)