Skip to content

Commit 0b43117

Browse files
authored
Move PyErr_Occurred call right after sycl_kernel_launch call (#4162)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 32cbb05 commit 0b43117

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

third_party/intel/backend/driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,9 @@ def format_of(ty):
624624
625625
{newline.join(ptr_decls)}
626626
sycl_kernel_launch(gridX, gridY, gridZ, num_warps, threads_per_warp, shared_memory, stream, kernel {',' + ', '.join(internal_args_list) if len(internal_args_list) > 0 else ''});
627+
if (PyErr_Occurred()) {{
628+
return NULL;
629+
}}
627630
628631
if(launch_exit_hook != Py_None){{
629632
PyObject* args = Py_BuildValue("(O)", launch_metadata);
@@ -633,9 +636,6 @@ def format_of(ty):
633636
return NULL;
634637
Py_DECREF(ret);
635638
}}
636-
if (PyErr_Occurred()) {{
637-
return NULL;
638-
}}
639639
640640
Py_RETURN_NONE;
641641
}}

0 commit comments

Comments
 (0)