Skip to content

Commit b6d9804

Browse files
Merge remote-tracking branch 'origin/master' into add_sycl_queue_memset
2 parents 51c36df + 6b3c588 commit b6d9804

7 files changed

Lines changed: 61 additions & 69 deletions

File tree

.github/workflows/conda-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ jobs:
186186
- python: '3.14'
187187
python_spec: '3.14.* *_cp314'
188188
experimental: false
189-
runner: ubuntu-22.04
189+
runner: ubuntu-latest
190190
- python: '3.14'
191191
python_spec: '3.14.* *_cp314t'
192192
experimental: false
193-
runner: ubuntu-22.04
193+
runner: ubuntu-latest
194194
experimental: [false]
195195
runner: [ubuntu-latest]
196196
continue-on-error: ${{ matrix.experimental }}

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions: read-all
99
jobs:
1010
install-compiler:
1111
name: Build with nightly build of DPC++ toolchain
12-
runs-on: ubuntu-24.04
12+
runs-on: ubuntu-latest
1313
timeout-minutes: 90
1414

1515
env:

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
pre-commit:
1212
name: pre-commit
1313

14-
runs-on: ubuntu-24.04
14+
runs-on: ubuntu-latest
1515
timeout-minutes: 30
1616

1717
steps:

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

Lines changed: 45 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
permissions: read-all
1313

1414
env:
15-
PACKAGE_NAME: dpctl
1615
MODULE_NAME: dpctl
1716
TEST_ENV_NAME: test_dpctl
1817
INTEL_CHANNEL: "https://software.repos.intel.com/python/conda/"
@@ -22,42 +21,36 @@ jobs:
2221
# disable scheduled workflow to be run in forks
2322
if: github.event.repository.fork == false
2423

25-
runs-on: ${{ matrix.runner }}
24+
runs-on: ${{ matrix.runner }}
2625
timeout-minutes: 45
2726

2827
strategy:
2928
matrix:
30-
python: ['3.10', '3.11', '3.12', '3.13']
31-
python_spec: ['']
32-
include:
33-
- python: '3.14'
34-
python_spec: '3.14.* *_cp314'
35-
- python: '3.14'
36-
python_spec: '3.14.* *_cp314t'
37-
experimental: [false]
29+
dependencies: [conda-forge, intel]
30+
python_spec: ['3.10', '3.11', '3.12', '3.13', '3.14.* *_cp314', '3.14.* *_cp314t']
3831
runner: [ubuntu-22.04, ubuntu-24.04]
39-
continue-on-error: ${{ matrix.experimental }}
4032

4133
steps:
4234
- name: Construct channels line
4335
run: |
44-
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> "$GITHUB_ENV"
45-
46-
- name: Display channels line
47-
run: |
48-
echo "${{ env.CHANNELS }}"
36+
if [ "${{ matrix.dependencies }}" = "intel" ]; then
37+
echo "CHANNELS=-c dppy/label/dev -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> "$GITHUB_ENV"
38+
else
39+
echo "CHANNELS=-c dppy/label/dev -c conda-forge --override-channels" >> "$GITHUB_ENV"
40+
fi
4941
5042
- name: Set pkgs_dirs
5143
run: |
5244
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
5345
5446
- name: Install dpctl
5547
run: |
56-
PYTHON_SPEC="${{ matrix.python_spec }}"
57-
if [ -z "${PYTHON_SPEC}" ]; then
58-
PYTHON_SPEC="${{ matrix.python }}"
59-
fi
60-
conda create -n "${{ env.TEST_ENV_NAME }}" -c dppy/label/dev "${{ env.CHANNELS }}" dpctl pytest cython setuptools c-compiler cxx-compiler python="${PYTHON_SPEC}"
48+
# shellcheck disable=SC2086
49+
conda create -n "${{ env.TEST_ENV_NAME }}" ${{ env.CHANNELS }} dpctl pytest cython setuptools c-compiler cxx-compiler python="${{ matrix.python_spec }}"
50+
51+
- name: Report content of test environment
52+
run: |
53+
conda list -n "${{ env.TEST_ENV_NAME }}"
6154
6255
- name: Smoke test
6356
run: |
@@ -81,85 +74,79 @@ jobs:
8174
8275
8376
test_windows:
84-
runs-on: ${{ matrix.runner }}
77+
# disable scheduled workflow to be run in forks
78+
if: github.event.repository.fork == false
79+
80+
runs-on: ${{ matrix.runner }}
8581
timeout-minutes: 60
8682
defaults:
8783
run:
8884
shell: cmd /C CALL {0}
8985
strategy:
9086
matrix:
91-
python: ['3.10', '3.11', '3.12', '3.13']
92-
python_spec: ['']
93-
include:
94-
- python: '3.14'
95-
python_spec: '3.14.* *_cp314'
96-
- python: '3.14'
97-
python_spec: '3.14.* *_cp314t'
98-
experimental: [false]
87+
# see the comment on the dependencies of test_linux
88+
dependencies: [conda-forge, intel]
89+
python_spec: ['3.10', '3.11', '3.12', '3.13', '3.14.* *_cp314', '3.14.* *_cp314t']
9990
runner: [windows-latest]
100-
101-
continue-on-error: ${{ matrix.experimental }}
10291
env:
10392
workdir: '${{ github.workspace }}'
10493

10594
steps:
10695
- name: Construct channels line
10796
shell: pwsh
10897
run: |
109-
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV
110-
111-
- name: Display channels line
112-
run: |
113-
echo "${{ env.CHANNELS }}"
98+
if ("${{ matrix.dependencies }}" -eq "intel") {
99+
echo "CHANNELS=-c dppy/label/dev -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV
100+
} else {
101+
echo "CHANNELS=-c dppy/label/dev -c conda-forge --override-channels" >> $env:GITHUB_ENV
102+
}
114103
115104
- uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
116105
with:
117106
miniforge-version: latest
118107
channels: conda-forge
119108
conda-remove-defaults: true
120109
activate-environment: ${{ env.TEST_ENV_NAME }}
121-
python-version: ${{ matrix.python }}
122110

123111
- name: Install dpctl
124112
run: |
125-
SET "PYTHON_SPEC=${{ matrix.python_spec }}"
126-
IF "%PYTHON_SPEC%"=="" SET "PYTHON_SPEC=${{ matrix.python }}"
127-
conda install -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest cython setuptools c-compiler cxx-compiler python="%PYTHON_SPEC%"
113+
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.CHANNELS }} dpctl pytest cython setuptools c-compiler cxx-compiler python="${{ matrix.python_spec }}"
128114
129-
# intel-opencl-rt is not being installed when running conda install dpctl, so do it manually
130-
- name: Install intel-opencl-rt
115+
- name: Report content of test environment
131116
run: |
132-
conda install -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} intel-opencl-rt
117+
conda list -n ${{ env.TEST_ENV_NAME }}
133118
134-
- name: Configure Intel OpenCL CPU RT
119+
- name: Register the OpenCL CPU driver with the ICD loader
135120
shell: pwsh
136121
run: |
137-
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
138-
if (Test-Path $script_path) {
139-
&$script_path
122+
$vendors = "HKLM:\SOFTWARE\Khronos\OpenCL\Vendors"
123+
$script = "$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
124+
if (Test-Path $script) {
125+
& $script
140126
} else {
141-
Write-Warning "File $script_path was NOT found!"
127+
$drivers = @(Get-ChildItem -Recurse -ErrorAction SilentlyContinue -Filter intelocl64.dll -Path "$env:CONDA_PREFIX\Library\bin")
128+
if ($drivers.Count -eq 0) { throw "intel-opencl-rt installed no OpenCL CPU driver under $env:CONDA_PREFIX" }
129+
if (-not (Test-Path $vendors)) { New-Item -Path $vendors -Force | Out-Null }
130+
foreach ($driver in $drivers) {
131+
New-ItemProperty -Path $vendors -Name $driver.FullName -Value 0 -PropertyType DWord -Force | Out-Null
132+
}
142133
}
143-
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
144-
$cl_cfg="$env:CONDA_PREFIX\Library\bin\cl.cfg"
145-
Get-Content -Tail 5 -Path $cl_cfg
134+
Get-ItemProperty -Path $vendors
146135
147136
- name: Smoke test
148137
shell: cmd /C CALL {0}
149138
run: >-
150139
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
151140
152-
- name: Create empty temporary directory to run tests from
153-
shell: cmd /C CALL {0}
141+
- name: Create test temp dir
154142
# create temporary empty folder to runs tests from
155143
# https://github.com/pytest-dev/pytest/issues/11904
156-
run: >-
157-
mkdir "${{ env.workdir }}\test_tmp"
144+
run: mkdir "${{ github.workspace }}\test_tmp"
158145

159146
- name: Run tests
160147
shell: cmd /C CALL {0}
161148
env:
162149
SYCL_CACHE_PERSISTENT: 1
163-
working-directory: ${{ env.workdir }}\test_tmp
164-
run: >-
150+
working-directory: ${{ github.workspace }}\test_tmp
151+
run: |
165152
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ repos:
5959
- id: black
6060
exclude: "versioneer.py|dpctl/_version.py"
6161
- repo: https://github.com/pycqa/isort
62-
rev: 9.0.0b1
62+
rev: 9.0.0b2
6363
hooks:
6464
- id: isort
6565
name: isort (python)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
* Registered `DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN` enumerator when `DPCTLDevice_GetPartitionAffinityDomains` receives an unrecognized value from the SYCL runtime [gh-2324](https://github.com/IntelPython/dpctl/pull/2324)
2121

2222
### Fixed
23+
* Fixed incorrect paths in `GetLevelZeroHeaders.cmake` [gh-2366](https://github.com/IntelPython/dpctl/pull/2366)
2324

2425
### Maintenance
2526
* Updated pybind11 version used by `dpctl` and examples [gh-2357](https://github.com/IntelPython/dpctl/pull/2357)

libsyclinterface/cmake/modules/GetLevelZeroHeaders.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515
# The module uses git to clone the Level Zero source repository into the
16-
# CMAKE_CURRENT_BINARY_DIR. The path to the Level Zero headers is then returned
16+
# CMAKE_BINARY_DIR. The path to the Level Zero headers is then returned
1717
# to the caller in the LEVEL_ZERO_INCLUDE_DIR variable.
1818
#
1919
# Example usage:
@@ -26,13 +26,13 @@
2626

2727
function(get_level_zero_headers)
2828

29-
if(EXISTS level-zero)
29+
if(EXISTS "${CMAKE_BINARY_DIR}/level-zero/.git")
3030
# Update the checkout
3131
execute_process(
3232
COMMAND ${GIT_EXECUTABLE} fetch
3333
RESULT_VARIABLE result
3434
ERROR_VARIABLE error
35-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
35+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
3636
OUTPUT_STRIP_TRAILING_WHITESPACE
3737
ERROR_STRIP_TRAILING_WHITESPACE
3838
)
@@ -43,11 +43,15 @@ function(get_level_zero_headers)
4343
)
4444
endif()
4545
else()
46+
# remove level-zero directory if it exists
47+
file(REMOVE_RECURSE "${CMAKE_BINARY_DIR}/level-zero")
48+
4649
# Clone the Level Zero git repo
4750
execute_process(
4851
COMMAND ${GIT_EXECUTABLE} clone https://github.com/oneapi-src/level-zero.git
4952
RESULT_VARIABLE result
5053
ERROR_VARIABLE error
54+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
5155
OUTPUT_STRIP_TRAILING_WHITESPACE
5256
ERROR_STRIP_TRAILING_WHITESPACE
5357
)
@@ -65,7 +69,7 @@ function(get_level_zero_headers)
6569
RESULT_VARIABLE result
6670
OUTPUT_VARIABLE latest_tag
6771
ERROR_VARIABLE error
68-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
72+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
6973
OUTPUT_STRIP_TRAILING_WHITESPACE
7074
ERROR_STRIP_TRAILING_WHITESPACE
7175
)
@@ -81,7 +85,7 @@ function(get_level_zero_headers)
8185
COMMAND ${GIT_EXECUTABLE} checkout ${latest_tag}
8286
RESULT_VARIABLE result
8387
ERROR_VARIABLE error
84-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
88+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
8589
OUTPUT_STRIP_TRAILING_WHITESPACE
8690
ERROR_STRIP_TRAILING_WHITESPACE
8791
)
@@ -95,7 +99,7 @@ function(get_level_zero_headers)
9599
# Populate the path to the headers
96100
find_path(LEVEL_ZERO_INCLUDE_DIR
97101
NAMES zet_api.h
98-
PATHS ${CMAKE_BINARY_DIR}/level-zero/include
102+
PATHS "${CMAKE_BINARY_DIR}/level-zero/include"
99103
NO_DEFAULT_PATH
100104
NO_CMAKE_ENVIRONMENT_PATH
101105
NO_CMAKE_PATH

0 commit comments

Comments
 (0)