Skip to content

Commit

Permalink
Merge pull request #1941 from IntelPython/support-python-3.13
Browse files Browse the repository at this point in the history
Support python 3.13
  • Loading branch information
oleksandr-pavlyk authored Dec 18, 2024
2 parents 98f96e7 + cc902e7 commit 25a961f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
experimental: [false]
runner: [ubuntu-22.04]
continue-on-error: ${{ matrix.experimental }}
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
shell: cmd /C CALL {0}
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
experimental: [false]
runner: [windows-2019]
continue-on-error: ${{ matrix.experimental }}
Expand Down Expand Up @@ -408,7 +408,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Download conda artifact
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -445,7 +445,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Download artifact
uses: actions/download-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Add missing include of SYCL header to "math_utils.hpp" [gh-1899](https://github.com/IntelPython/dpctl/pull/1899)
* Add support of CV-qualifiers in `is_complex<T>` helper [gh-1900](https://github.com/IntelPython/dpctl/pull/1900)
* Tuning work for elementwise functions with modest performance gains (under 10%) [gh-1889](https://github.com/IntelPython/dpctl/pull/1889)
* Support for Python 3.13 for `dpctl` [gh-1941](https://github.com/IntelPython/dpctl/pull/1941)

## [0.18.3] - Dec. 07, 2024

Expand Down
8 changes: 7 additions & 1 deletion dpctl/_host_task_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ DPCTLSyclEventRef async_dec_ref(DPCTLSyclQueueRef QRef,
cgh.depends_on(*(unwrap<sycl::event>(depERefs[ev_id])));
}
cgh.host_task([obj_array_size, obj_vec]() {
const bool initialized = Py_IsInitialized();
#if PY_VERSION_HEX < 0x30d0000
const bool finalizing = _Py_IsFinalizing();
#else
const bool finalizing = Py_IsFinalizing();
#endif
// if the main thread has not finilized the interpreter yet
if (Py_IsInitialized() && !_Py_IsFinalizing()) {
if (initialized && !finalizing) {
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
for (size_t i = 0; i < obj_array_size; ++i) {
Expand Down
8 changes: 7 additions & 1 deletion dpctl/apis/include/dpctl4pybind11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ class dpctl_capi
{
void operator()(py::object *p) const
{
bool guard = (Py_IsInitialized() && !_Py_IsFinalizing());
const bool initialized = Py_IsInitialized();
#if PY_VERSION_HEX < 0x30d0000
const bool finilizing = _Py_IsFinalizing();
#else
const bool finilizing = Py_IsFinalizing();
#endif
const bool guard = initialized && !finilizing;

if (guard) {
delete p;
Expand Down

0 comments on commit 25a961f

Please sign in to comment.