Skip to content

Commit 8e06a6c

Browse files
Merge pull request #794 from IntelPython/async_submit_host_task_tweak
Host task used by submit must ensure interpreter is not shutting down
2 parents ca39692 + 1c718b3 commit 8e06a6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

conda-recipe/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44

55
${PYTHON} -c "import dpctl; print(dpctl.__version__)"
66
${PYTHON} -c "import dpctl; dpctl.lsplatform()"
7-
${PYTHON} -m pytest -q -ra --disable-warnings --cov dpctl --cov-report term-missing --pyargs dpctl -vv
7+
${PYTHON} -m pytest -q -ra --disable-warnings -p no:faulthandler --cov dpctl --cov-report term-missing --pyargs dpctl -vv

dpctl/_host_task_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int async_dec_ref(DPCTLSyclQueueRef QRef,
5656
}
5757
cgh.host_task([obj_array_size, obj_vec]() {
5858
// if the main thread has not finilized the interpreter yet
59-
if (Py_IsInitialized()) {
59+
if (Py_IsInitialized() && !_Py_IsFinalizing()) {
6060
PyGILState_STATE gstate;
6161
gstate = PyGILState_Ensure();
6262
for (size_t i = 0; i < obj_array_size; ++i) {

0 commit comments

Comments
 (0)