Skip to content

Commit 25a961f

Browse files
Merge pull request #1941 from IntelPython/support-python-3.13
Support python 3.13
2 parents 98f96e7 + cc902e7 commit 25a961f

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/conda-package.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
strategy:
2626
matrix:
27-
python: ['3.9', '3.10', '3.11', '3.12']
27+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
2828
steps:
2929
- uses: actions/checkout@v4.2.2
3030
with:
@@ -80,7 +80,7 @@ jobs:
8080

8181
strategy:
8282
matrix:
83-
python: ['3.9', '3.10', '3.11', '3.12']
83+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
8484
steps:
8585
- uses: actions/checkout@v4.2.2
8686
with:
@@ -145,7 +145,7 @@ jobs:
145145

146146
strategy:
147147
matrix:
148-
python: ['3.9', '3.10', '3.11', '3.12']
148+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
149149
experimental: [false]
150150
runner: [ubuntu-22.04]
151151
continue-on-error: ${{ matrix.experimental }}
@@ -239,7 +239,7 @@ jobs:
239239
shell: cmd /C CALL {0}
240240
strategy:
241241
matrix:
242-
python: ['3.9', '3.10', '3.11', '3.12']
242+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
243243
experimental: [false]
244244
runner: [windows-2019]
245245
continue-on-error: ${{ matrix.experimental }}
@@ -408,7 +408,7 @@ jobs:
408408
timeout-minutes: 20
409409
strategy:
410410
matrix:
411-
python: ['3.9', '3.10', '3.11', '3.12']
411+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
412412
steps:
413413
- name: Download conda artifact
414414
uses: actions/download-artifact@v4
@@ -445,7 +445,7 @@ jobs:
445445
timeout-minutes: 20
446446
strategy:
447447
matrix:
448-
python: ['3.9', '3.10', '3.11', '3.12']
448+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
449449
steps:
450450
- name: Download artifact
451451
uses: actions/download-artifact@v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
* Add missing include of SYCL header to "math_utils.hpp" [gh-1899](https://github.com/IntelPython/dpctl/pull/1899)
4040
* Add support of CV-qualifiers in `is_complex<T>` helper [gh-1900](https://github.com/IntelPython/dpctl/pull/1900)
4141
* Tuning work for elementwise functions with modest performance gains (under 10%) [gh-1889](https://github.com/IntelPython/dpctl/pull/1889)
42+
* Support for Python 3.13 for `dpctl` [gh-1941](https://github.com/IntelPython/dpctl/pull/1941)
4243

4344
## [0.18.3] - Dec. 07, 2024
4445

dpctl/_host_task_util.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ DPCTLSyclEventRef async_dec_ref(DPCTLSyclQueueRef QRef,
5858
cgh.depends_on(*(unwrap<sycl::event>(depERefs[ev_id])));
5959
}
6060
cgh.host_task([obj_array_size, obj_vec]() {
61+
const bool initialized = Py_IsInitialized();
62+
#if PY_VERSION_HEX < 0x30d0000
63+
const bool finalizing = _Py_IsFinalizing();
64+
#else
65+
const bool finalizing = Py_IsFinalizing();
66+
#endif
6167
// if the main thread has not finilized the interpreter yet
62-
if (Py_IsInitialized() && !_Py_IsFinalizing()) {
68+
if (initialized && !finalizing) {
6369
PyGILState_STATE gstate;
6470
gstate = PyGILState_Ensure();
6571
for (size_t i = 0; i < obj_array_size; ++i) {

dpctl/apis/include/dpctl4pybind11.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ class dpctl_capi
198198
{
199199
void operator()(py::object *p) const
200200
{
201-
bool guard = (Py_IsInitialized() && !_Py_IsFinalizing());
201+
const bool initialized = Py_IsInitialized();
202+
#if PY_VERSION_HEX < 0x30d0000
203+
const bool finilizing = _Py_IsFinalizing();
204+
#else
205+
const bool finilizing = Py_IsFinalizing();
206+
#endif
207+
const bool guard = initialized && !finilizing;
202208

203209
if (guard) {
204210
delete p;

0 commit comments

Comments
 (0)