1212permissions : read-all
1313
1414env :
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 }}
0 commit comments