Skip to content

Commit ec7bafa

Browse files
authored
Merge branch 'master' into sycl_to_cython_fft_random_linalg
2 parents c0e3a4a + 63ff524 commit ec7bafa

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

.github/workflows/conda-package.yml

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
conda-pkgs: '/home/runner/conda_pkgs_dir/'
31-
conda-bld: '/usr/share/miniconda3/envs/build/conda-bld/linux-64/'
3231

3332
steps:
3433
- name: Checkout DPNP repo
@@ -52,6 +51,9 @@ jobs:
5251
activate-environment: 'build'
5352
use-only-tar-bz2: true
5453

54+
- name: Store conda paths as envs
55+
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV
56+
5557
- name: Install conda-build
5658
run: conda install conda-build
5759

@@ -76,7 +78,7 @@ jobs:
7678
uses: actions/upload-artifact@v2
7779
with:
7880
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
79-
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
81+
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
8082

8183
build_windows:
8284
runs-on: windows-latest
@@ -91,7 +93,6 @@ jobs:
9193

9294
env:
9395
conda-pkgs: 'C:\Users\runneradmin\conda_pkgs_dir\'
94-
conda-bld: 'C:\Miniconda3\envs\build\conda-bld\win-64\'
9596

9697
steps:
9798
- name: Checkout DPNP repo
@@ -115,6 +116,11 @@ jobs:
115116
activate-environment: 'build'
116117
use-only-tar-bz2: true
117118

119+
- name: Store conda paths as envs
120+
run: |
121+
@echo on
122+
(echo CONDA_BLD=%CONDA_PREFIX%\conda-bld\win-64\) >> %GITHUB_ENV%
123+
118124
- name: Cache conda packages
119125
uses: actions/cache@v3
120126
env:
@@ -139,7 +145,7 @@ jobs:
139145
uses: actions/upload-artifact@v2
140146
with:
141147
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
142-
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
148+
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
143149

144150
test_linux:
145151
needs: build_linux
@@ -163,7 +169,7 @@ jobs:
163169
channel-path: '${{ github.workspace }}/channel/'
164170
pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/'
165171
extracted-pkg-path: '${{ github.workspace }}/pkg/'
166-
tests-path: '${{ github.workspace }}/pkg/info/test/'
172+
tests-path: '${{ github.workspace }}/pkg/info/test/tests/'
167173
ver-json-path: '${{ github.workspace }}/version.json'
168174

169175
steps:
@@ -201,7 +207,9 @@ jobs:
201207
- name: Collect dependencies
202208
run: |
203209
export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
210+
204211
echo PACKAGE_VERSION=${PACKAGE_VERSION}
212+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
205213
206214
conda install ${{ env.PACKAGE_NAME }}=${PACKAGE_VERSION} python=${{ matrix.python }} ${{ env.TEST_CHANNELS }} --only-deps --dry-run > lockfile
207215
cat lockfile
@@ -221,11 +229,7 @@ jobs:
221229
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
222230
223231
- name: Install dpnp
224-
run: |
225-
export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
226-
echo PACKAGE_VERSION=${PACKAGE_VERSION}
227-
228-
conda install ${{ env.PACKAGE_NAME }}=${PACKAGE_VERSION} dpctl=${{ matrix.dpctl }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
232+
run: conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} dpctl=${{ matrix.dpctl }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
229233
env:
230234
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
231235

@@ -237,7 +241,7 @@ jobs:
237241

238242
# TODO: run the whole scope once the issues on CPU are resolved
239243
- name: Run tests
240-
run: python -m pytest -q -ra --disable-warnings -vv tests/test_arraycreation.py tests/test_dparray.py tests/test_mathematical.py
244+
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_mathematical.py test_special.py
241245
env:
242246
SYCL_ENABLE_HOST_DEVICE: '1'
243247
working-directory: ${{ env.tests-path }}
@@ -264,11 +268,9 @@ jobs:
264268
channel-path: '${{ github.workspace }}\channel\'
265269
pkg-path-in-channel: '${{ github.workspace }}\channel\win-64\'
266270
extracted-pkg-path: '${{ github.workspace }}\pkg'
267-
tests-path: '${{ github.workspace }}\pkg\info\test\'
271+
tests-path: '${{ github.workspace }}\pkg\info\test\tests\'
268272
ver-json-path: '${{ github.workspace }}\version.json'
269273
active-env-name: 'test'
270-
miniconda-lib-path: 'C:\Miniconda3\envs\test\Library\lib\'
271-
miniconda-bin-path: 'C:\Miniconda3\envs\test\Library\bin\'
272274

273275
steps:
274276
- name: Download artifact
@@ -299,6 +301,12 @@ jobs:
299301
miniconda-version: 'latest'
300302
activate-environment: ${{ env.active-env-name }}
301303

304+
- name: Store conda paths as envs
305+
run: |
306+
@echo on
307+
(echo CONDA_LIB_PATH=%CONDA_PREFIX%\Library\lib\) >> %GITHUB_ENV%
308+
(echo CONDA_LIB_BIN_PATH=%CONDA_PREFIX%\Library\bin\) >> %GITHUB_ENV%
309+
302310
# Needed to be able to run conda index
303311
- name: Install conda-build
304312
run: conda install conda-build
@@ -322,6 +330,7 @@ jobs:
322330
SET PACKAGE_VERSION=%%F
323331
)
324332
echo PACKAGE_VERSION: %PACKAGE_VERSION%
333+
(echo PACKAGE_VERSION=%PACKAGE_VERSION%) >> %GITHUB_ENV%
325334
326335
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% dpctl=${{ matrix.dpctl }} python=${{ matrix.python }} ${{ env.TEST_CHANNELS }} --only-deps --dry-run > lockfile
327336
env:
@@ -348,13 +357,7 @@ jobs:
348357
- name: Install dpnp
349358
run: |
350359
@echo on
351-
set "SCRIPT=${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}"
352-
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
353-
SET PACKAGE_VERSION=%%F
354-
)
355-
echo PACKAGE_VERSION: %PACKAGE_VERSION%
356-
357-
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% dpctl=${{ matrix.dpctl }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
360+
conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} dpctl=${{ matrix.dpctl }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
358361
env:
359362
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
360363

@@ -365,10 +368,10 @@ jobs:
365368
shell: pwsh
366369
run: |
367370
# Make sure the below libraries exist
368-
Get-Item -Path ${{ env.miniconda-bin-path }}\OpenCL.dll
369-
Get-Item -Path ${{ env.miniconda-lib-path }}\intelocl64.dll
371+
Get-Item -Path "$env:CONDA_LIB_BIN_PATH\OpenCL.dll"
372+
Get-Item -Path "$env:CONDA_LIB_PATH\intelocl64.dll"
370373
371-
echo "OCL_ICD_FILENAMES=${{ env.miniconda-lib-path }}\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
374+
echo "OCL_ICD_FILENAMES = $env:CONDA_LIB_PATH\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
372375
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
373376
374377
if ($list.count -eq 0) {
@@ -384,13 +387,13 @@ jobs:
384387
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
385388
}
386389
387-
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name ${{ env.miniconda-lib-path }}\intelocl64.dll -Value 0
390+
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name "$env:CONDA_LIB_PATH\intelocl64.dll" -Value 0
388391
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
389392
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
390393
391394
# Now copy OpenCL.dll into system folder
392395
$system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
393-
$python_ocl_icd_loader="${{ env.miniconda-bin-path }}\OpenCL.dll"
396+
$python_ocl_icd_loader="$env:CONDA_LIB_BIN_PATH\OpenCL.dll"
394397
Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
395398
396399
if (Test-Path -Path $system_ocl_icd_loader) {
@@ -401,16 +404,19 @@ jobs:
401404
Write-Output "OCL-ICD-Loader was not copied"
402405
}
403406
404-
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
405-
echo "TBB_DLL_PATH=${{ env.miniconda-bin-path }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
407+
# Configuration variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
408+
$cl_cfg="$env:CONDA_LIB_PATH\cl.cfg"
409+
Write-Output "`n>>> Dump content of $cl_cfg`n" (Get-Content $cl_cfg) "`n<<< end of dump`n"
410+
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =.*', "CL_CONFIG_TBB_DLL_PATH = $env:CONDA_LIB_BIN_PATH" | Set-Content $cl_cfg
411+
Write-Output "`n>>> Dump content of modified $cl_cfg`n" (Get-Content $cl_cfg) "`n<<< end of dump`n"
406412
}
407413
408414
- name: Smoke test
409415
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
410416

411417
# TODO: run the whole scope once the issues on CPU are resolved
412418
- name: Run tests
413-
run: python -m pytest -q -ra --disable-warnings -vv tests\test_arraycreation.py tests\test_dparray.py tests\test_mathematical.py
419+
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_mathematical.py test_special.py
414420
working-directory: ${{ env.tests-path }}
415421

416422
upload_linux:

dpnp/dpnp_iface_libmath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# distutils: language = c++
33
# -*- coding: utf-8 -*-
44
# *****************************************************************************
5-
# Copyright (c) 2016-2020, Intel Corporation
5+
# Copyright (c) 2016-2022, Intel Corporation
66
# All rights reserved.
77
#
88
# Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@ def erf(in_array1):
7777
7878
"""
7979

80-
x1_desc = dpnp.get_dpnp_descriptor(in_array1, copy_when_strides=False)
80+
x1_desc = dpnp.get_dpnp_descriptor(in_array1, copy_when_strides=False, copy_when_nondefault_queue=False)
8181
if x1_desc:
8282
return dpnp_erf(x1_desc).get_pyobj()
8383

0 commit comments

Comments
 (0)