Skip to content

Commit 7ad7b73

Browse files
committed
Merge branch 'master' into feature/topk
2 parents 809cb70 + 39a19c1 commit 7ad7b73

File tree

22 files changed

+632
-235
lines changed

22 files changed

+632
-235
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ per-file-ignores =
3131
dpctl/utils/_compute_follows_data.pyx: E999, E225, E227
3232
dpctl/utils/_onetrace_context.py: E501, W505
3333
dpctl/tensor/_array_api.py: E501, W505
34-
examples/cython/sycl_buffer/syclbuffer/_buffer_example.pyx: E999, E225, E402
35-
examples/cython/usm_memory/blackscholes/blackscholes.pyx: E999, E225, E226, E402
34+
examples/cython/sycl_buffer/syclbuffer/_syclbuffer.pyx: E999, E225, E402
35+
examples/cython/usm_memory/blackscholes/_blackscholes_usm.pyx: E999, E225, E226, E402
3636
examples/cython/use_dpctl_sycl/use_dpctl_sycl/_cython_api.pyx: E999, E225, E226, E402

.github/workflows/conda-package.yml

Lines changed: 14 additions & 19 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:
@@ -64,12 +64,12 @@ jobs:
6464
$CHANNELS \
6565
conda-recipe
6666
- name: Upload artifact
67-
uses: actions/upload-artifact@v4.4.3
67+
uses: actions/upload-artifact@v4.5.0
6868
with:
6969
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
7070
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
7171
- name: Upload wheels artifact
72-
uses: actions/upload-artifact@v4.4.3
72+
uses: actions/upload-artifact@v4.5.0
7373
with:
7474
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
7575
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
@@ -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:
@@ -127,13 +127,13 @@ jobs:
127127
conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe
128128
129129
- name: Upload artifact
130-
uses: actions/upload-artifact@v4.4.3
130+
uses: actions/upload-artifact@v4.5.0
131131
with:
132132
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
133133
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
134134

135135
- name: Upload wheels artifact
136-
uses: actions/upload-artifact@v4.4.3
136+
uses: actions/upload-artifact@v4.5.0
137137
with:
138138
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
139139
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
@@ -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
@@ -549,7 +549,7 @@ jobs:
549549
- name: Install example requirements
550550
shell: bash -ex -l {0}
551551
env:
552-
DPCPP_CMPLR: "dpcpp_linux-64>=2024.2"
552+
DPCPP_CMPLR: "dpcpp_linux-64>=2025.0"
553553
run: |
554554
CHANNELS="${{ env.CHANNELS }}"
555555
. $CONDA/etc/profile.d/conda.sh
@@ -569,6 +569,7 @@ jobs:
569569
${{ env.DPCPP_CMPLR }} "${DPCTL_DEPENDS}" \
570570
"sysroot_linux-64>=2.28"
571571
echo "Compiler installed"
572+
conda list -n ${{ env.BUILD_ENV_NAME }}
572573
- name: Install dpctl
573574
shell: bash -l {0}
574575
run: |
@@ -586,14 +587,8 @@ jobs:
586587
for d in $(find . -maxdepth 1 -type d -not -path ".")
587588
do
588589
pushd $d
589-
export MKLROOT=${CONDA_PREFIX}
590-
export TBBROOT=${CONDA_PREFIX}
591590
conda activate --stack build_env
592-
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja -- \
593-
-DTBB_LIBRARY_DIR=${TBBROOT}/lib \
594-
-DMKL_LIBRARY_DIR=${MKLROOT}/lib \
595-
-DMKL_INCLUDE_DIR=${MKLROOT}/include \
596-
-DTBB_INCLUDE_DIR=${TBBROOT}/include || exit 1
591+
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja || exit 1
597592
conda deactivate
598593
if [ -e tests ]
599594
then
@@ -614,7 +609,7 @@ jobs:
614609
do
615610
pushd $d
616611
conda activate --stack ${{ env.BUILD_ENV_NAME }}
617-
python setup.py build_ext --inplace || exit 1
612+
CC=icx CXX=icpx python setup.py develop -G Ninja || exit 1
618613
conda deactivate
619614
python -m pytest tests || exit 1
620615
popd

.github/workflows/generate-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
git push tokened_docs gh-pages
109109
- name: Save built docs as an artifact
110110
if: ${{ github.event.pull_request && github.event.pull_request.head.repo.fork && github.event.action != 'closed'}}
111-
uses: actions/upload-artifact@v4.4.3
111+
uses: actions/upload-artifact@v4.5.0
112112
with:
113113
name: ${{ env.PACKAGE_NAME }} rendered documentation
114114
path: ~/docs

.github/workflows/openssf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ jobs:
6161
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6262
# format to the repository Actions tab.
6363
- name: "Upload artifact"
64-
uses: actions/upload-artifact@184d73b71b93c222403b2e7f1ffebe4508014249 # v4.4.0
64+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.4.0
6565
with:
6666
name: SARIF file
6767
path: results.sarif
6868
retention-days: 14
6969

7070
# Upload the results to GitHub's code scanning dashboard.
7171
- name: "Upload to code-scanning"
72-
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
72+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
7373
with:
7474
sarif_file: results.sarif

.github/workflows/run-tests-from-dppy-bits.yaml

Lines changed: 2 additions & 2 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
experimental: [false]
2929
runner: [ubuntu-22.04, ubuntu-24.04]
3030
continue-on-error: ${{ matrix.experimental }}
@@ -75,7 +75,7 @@ jobs:
7575
shell: cmd /C CALL {0}
7676
strategy:
7777
matrix:
78-
python: ['3.9', '3.10', '3.11', '3.12']
78+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
7979
experimental: [false]
8080
runner: [windows-2019]
8181

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;

dpctl/tensor/_indexing_functions.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ def take_along_axis(x, indices, /, *, axis=-1, mode="wrap"):
491491
"from input arguments. "
492492
)
493493
mode_i = _get_indexing_mode(mode)
494-
indexes_dt = ti.default_device_index_type(exec_q.sycl_device)
494+
indexes_dt = (
495+
dpt.uint64
496+
if indices.dtype == dpt.uint64
497+
else ti.default_device_index_type(exec_q.sycl_device)
498+
)
495499
_ind = tuple(
496500
(
497501
indices
@@ -567,7 +571,11 @@ def put_along_axis(x, indices, vals, /, *, axis=-1, mode="wrap"):
567571
)
568572
out_usm_type = dpctl.utils.get_coerced_usm_type(usm_types_)
569573
mode_i = _get_indexing_mode(mode)
570-
indexes_dt = ti.default_device_index_type(exec_q.sycl_device)
574+
indexes_dt = (
575+
dpt.uint64
576+
if indices.dtype == dpt.uint64
577+
else ti.default_device_index_type(exec_q.sycl_device)
578+
)
571579
_ind = tuple(
572580
(
573581
indices

0 commit comments

Comments
 (0)