Skip to content

Commit d9c9587

Browse files
author
khaled
committed
Fix make_queue() only when arrtype is DpnpNdArray
1 parent eace93a commit d9c9587

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numba_dpex/_patches.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ def _empty_nd_impl(context, builder, arrtype, shapes):
243243
LLVM value pointing at a Numba runtime allocated array.
244244
"""
245245

246-
(queue, queue_ptr, pyapi) = make_queue(context, builder, arrtype)
247-
248246
arycls = make_array(arrtype)
249247
ary = arycls(context, builder)
250248

@@ -296,6 +294,7 @@ def _empty_nd_impl(context, builder, arrtype, shapes):
296294
)
297295

298296
if isinstance(arrtype, DpnpNdArray):
297+
(queue, queue_ptr, pyapi) = make_queue(context, builder, arrtype)
299298
usm_ty = arrtype.usm_type
300299
usm_ty_map = {"device": 1, "shared": 2, "host": 3}
301300
usm_type = context.get_constant(
@@ -356,7 +355,8 @@ def _empty_nd_impl(context, builder, arrtype, shapes):
356355
meminfo=meminfo,
357356
)
358357

359-
ret = (ary, queue)
358+
ret = (ary, queue) if isinstance(arrtype, DpnpNdArray) else ary
359+
360360
return ret
361361

362362

0 commit comments

Comments
 (0)