Skip to content

Support python 3.13 #1941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/checkout@v4.2.2
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/checkout@v4.2.2
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
Loading