72
72
fetch-depth : 0
73
73
- uses : conda-incubator/setup-miniconda@v2
74
74
with :
75
+ use-only-tar-bz2 : true
75
76
auto-activate-base : true
76
77
conda-build-version : " *"
77
- activate-environment : " "
78
+ activate-environment : true
79
+ python-version : ${{ matrix.python }}
78
80
79
81
- name : Cache conda packages
80
82
uses : actions/cache@v3
@@ -173,7 +175,9 @@ jobs:
173
175
test_windows :
174
176
needs : build_windows
175
177
runs-on : ${{ matrix.runner }}
176
-
178
+ defaults :
179
+ run :
180
+ shell : cmd /C CALL {0}
177
181
strategy :
178
182
matrix :
179
183
python : ['3.8', '3.9', '3.10']
@@ -195,7 +199,8 @@ jobs:
195
199
auto-update-conda : true
196
200
conda-build-version : ' *'
197
201
miniconda-version : ' latest'
198
- activate-environment : " dpctl_test"
202
+ activate-environment : dpctl_test
203
+ python-version : ${{ matrix.python }}
199
204
- name : Create conda channel with the artifact bit
200
205
shell : cmd /C CALL {0}
201
206
run : |
@@ -212,6 +217,7 @@ jobs:
212
217
run : |
213
218
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
214
219
- name : Output content of produced ver.json
220
+ shell : pwsh
215
221
run : Get-Content -Path ${{ env.workdir }}\ver.json
216
222
- name : Collect dependencies
217
223
shell : cmd /C CALL {0}
@@ -223,8 +229,9 @@ jobs:
223
229
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
224
230
SET PACKAGE_VERSION=%%F
225
231
)
226
- conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
232
+ conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
227
233
- name : Display lockfile content
234
+ shell : pwsh
228
235
run : Get-Content -Path .\lockfile
229
236
- name : Cache conda packages
230
237
uses : actions/cache@v3
@@ -239,7 +246,7 @@ jobs:
239
246
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
240
247
- name : Install opencl_rt
241
248
shell : cmd /C CALL {0}
242
- run : conda install opencl_rt -c intel --override-channels
249
+ run : conda install -n dpctl_test opencl_rt -c intel --override-channels
243
250
- name : Install dpctl
244
251
shell : cmd /C CALL {0}
245
252
run : |
@@ -252,14 +259,14 @@ jobs:
252
259
SET PACKAGE_VERSION=%%F
253
260
)
254
261
SET "TEST_DEPENDENCIES=pytest pytest-cov cython"
255
- conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
262
+ conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
256
263
- name : Report content of test environment
257
264
shell : cmd /C CALL {0}
258
265
run : |
259
- pip install --no-cache-dir brotli
260
266
echo "Value of CONDA enviroment variable was: " %CONDA%
261
- conda list
262
- - name : Add library
267
+ echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
268
+ conda info && conda list -n dpctl_test
269
+ - name : Configure Intel OpenCL CPU RT
263
270
shell : pwsh
264
271
run : |
265
272
$conda_env_library = "$env:CONDA_PREFIX\Library"
@@ -278,35 +285,24 @@ jobs:
278
285
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
279
286
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
280
287
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
281
- # Now copy OpenCL.dll into system folder
282
- $system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
283
- $python_ocl_icd_loader="$conda_env_library\bin\OpenCL.dll"
284
- Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
285
- if (Test-Path -Path $system_ocl_icd_loader) {
286
- Write-Output "$system_ocl_icd_loader has been copied"
287
- $acl = Get-Acl $system_ocl_icd_loader
288
- Write-Output $acl
289
- } else {
290
- Write-Output "OCL-ICD-Loader was not copied"
291
- }
292
288
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
293
289
$cl_cfg="$conda_env_library\lib\cl.cfg"
294
290
Write-Output $cl_cfg
295
291
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
296
292
Get-Content -Tail 5 -Path $cl_cfg
297
293
}
298
- - name : Smoke test
294
+ - name : Smoke test, step 1
299
295
shell : cmd /C CALL {0}
300
- run : |
301
- python -c "import sys; print(sys.executable)"
302
- python -c "import dpctl; dpctl.lsplatform()"
303
- python -c "import dpctl; print(dpctl.get_devices(backend='opencl', device_type='gpu'))"
304
- python -c "import dpctl; print(dpctl.get_num_devices(backend='opencl', device_type='gpu'))"
296
+ run : >-
297
+ conda activate dpctl_test && python -c "import sys; print(sys.executable)"
298
+ - name : Smoke test, step 2
299
+ shell : cmd /C CALL {0}
300
+ run : >-
301
+ conda activate dpctl_test && python -c "import dpctl; dpctl.lsplatform()"
305
302
- name : Run tests
306
303
shell : cmd /C CALL {0}
307
- run : |
308
- python -c "import sys; print(sys.executable)"
309
- python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
304
+ run : >-
305
+ conda activate dpctl_test && python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
310
306
311
307
upload_linux :
312
308
needs : test_linux
0 commit comments