Skip to content

Commit 64a7f67

Browse files
committed
Merge branch 'infodev-doc-review' of https://github.com/alexandraepan/dpctl into infodev-doc-review
2 parents 11cc2b6 + dc51a38 commit 64a7f67

File tree

71 files changed

+5694
-2358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+5694
-2358
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ per-file-ignores =
2525
dpctl/program/_program.pyx: E999, E225, E226, E227
2626
dpctl/tensor/_usmarray.pyx: E999, E225, E226, E227
2727
dpctl/tensor/_dlpack.pyx: E999, E225, E226, E227
28+
dpctl/tensor/_flags.pyx: E999, E225, E226, E227
2829
dpctl/tensor/numpy_usm_shared.py: F821
2930
dpctl/tests/_cython_api.pyx: E999, E225, E227, E402
3031
dpctl/utils/_compute_follows_data.pyx: E999, E225, E227

.github/workflows/conda-package.yml

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
python: ['3.8', '3.9', '3.10']
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
with:
2525
fetch-depth: 0
2626

@@ -44,7 +44,7 @@ jobs:
4444
run: conda install conda-build
4545
- name: Build conda package
4646
run: |
47-
CHANNELS="-c defaults -c intel --override-channels"
47+
CHANNELS="-c intel -c main --override-channels"
4848
VERSIONS="--python ${{ matrix.python }}"
4949
TEST="--no-test"
5050
conda build \
@@ -53,7 +53,7 @@ jobs:
5353
$CHANNELS \
5454
conda-recipe
5555
- name: Upload artifact
56-
uses: actions/upload-artifact@v2
56+
uses: actions/upload-artifact@v3
5757
with:
5858
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
5959
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -67,7 +67,7 @@ jobs:
6767
env:
6868
conda-bld: C:\Miniconda\conda-bld\win-64\
6969
steps:
70-
- uses: actions/checkout@v2
70+
- uses: actions/checkout@v3
7171
with:
7272
fetch-depth: 0
7373
- uses: conda-incubator/setup-miniconda@v2
@@ -89,9 +89,9 @@ jobs:
8989
- name: Install conda-build
9090
run: conda install conda-build
9191
- name: Build conda package
92-
run: conda build --no-test --python ${{ matrix.python }} -c defaults -c intel --override-channels conda-recipe
92+
run: conda build --no-test --python ${{ matrix.python }} -c intel -c main --override-channels conda-recipe
9393
- name: Upload artifact
94-
uses: actions/upload-artifact@v2
94+
uses: actions/upload-artifact@v3
9595
with:
9696
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
9797
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -107,11 +107,11 @@ jobs:
107107
runner: [ubuntu-latest]
108108
continue-on-error: ${{ matrix.experimental }}
109109
env:
110-
CHANNELS: -c defaults -c intel --override-channels
110+
CHANNELS: -c intel -c main --override-channels
111111

112112
steps:
113113
- name: Download artifact
114-
uses: actions/download-artifact@v2
114+
uses: actions/download-artifact@v3
115115
with:
116116
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
117117
- name: Add conda to system path
@@ -154,7 +154,7 @@ jobs:
154154
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
155155
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
156156
# Test installed packages
157-
conda list
157+
conda list -n test_dpctl
158158
- name: Smoke test
159159
run: |
160160
. $CONDA/etc/profile.d/conda.sh
@@ -183,39 +183,51 @@ jobs:
183183
runner: [windows-latest]
184184
continue-on-error: ${{ matrix.experimental }}
185185
env:
186-
CHANNELS: -c defaults -c intel --override-channels
186+
workdir: '${{ github.workspace }}'
187+
CHANNELS: -c intel -c main --override-channels
187188

188189
steps:
189190
- name: Download artifact
190-
uses: actions/download-artifact@v2
191+
uses: actions/download-artifact@v3
191192
with:
192193
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
193194
- uses: conda-incubator/setup-miniconda@v2
194195
with:
195-
auto-activate-base: true
196-
activate-environment: ""
196+
use-only-tar-bz2: true
197+
auto-update-conda: true
198+
miniconda-version: 'latest'
199+
activate-environment: "dpctl_test"
197200
- name: Install conda-build
201+
shell: cmd /C CALL {0}
198202
# Needed to be able to run conda index
199203
run: conda install conda-build
200204
- name: Create conda channel
205+
shell: cmd /C CALL {0}
201206
run: |
202-
mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64
203-
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.GITHUB_WORKSPACE }}\channel\win-64
204-
conda index ${{ env.GITHUB_WORKSPACE }}/channel
207+
echo ${{ env.workdir }}
208+
mkdir ${{ env.workdir }}\channel\win-64
209+
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
210+
conda index ${{ env.workdir }}/channel
205211
# Test channel
206-
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json
207-
more ${{ env.GITHUB_WORKSPACE }}\ver.json
212+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
213+
type ${{ env.workdir }}\ver.json
208214
- name: Collect dependencies
209-
shell: cmd
215+
shell: cmd /C CALL {0}
210216
run: |
211217
@ECHO ON
212-
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
218+
if not exist ver.json (
219+
copy /Y ${{ env.workdir }}\ver.json .
220+
)
213221
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
214222
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
215223
SET PACKAGE_VERSION=%%F
216224
)
217-
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
218-
more lockfile
225+
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
226+
- name: Display lockfile content
227+
shell: cmd /C CALL {0}
228+
run: |
229+
echo "Outputting content of lockfile:"
230+
type lockfile
219231
- name: Cache conda packages
220232
uses: actions/cache@v3
221233
env:
@@ -228,22 +240,28 @@ jobs:
228240
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
229241
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
230242
- name: Install opencl_rt
243+
shell: cmd /C CALL {0}
231244
run: conda install opencl_rt -c intel --override-channels
232245
- name: Install dpctl
233-
shell: cmd
246+
shell: cmd /C CALL {0}
234247
run: |
235248
@ECHO ON
236-
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
249+
copy /Y ${{ env.workdir }}\ver.json .
237250
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
238251
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
239252
SET PACKAGE_VERSION=%%F
240253
)
241-
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
242-
# Test installed packages
254+
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
255+
- name: Report content of test environemtn
256+
shell: cmd /C CALL {0}
257+
run: |
258+
echo "Value of CONDA enviroment variable was: " %CONDA%
243259
conda list
244260
- name: Add library
261+
shell: pwsh
245262
run: |
246-
echo "OCL_ICD_FILENAMES=C:\Miniconda\Library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
263+
$conda_env_library = "$env:CONDA_PREFIX\Library"
264+
echo "OCL_ICD_FILENAMES=$conda_env_library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
247265
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
248266
if ($list.count -eq 0) {
249267
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos)) {
@@ -255,12 +273,12 @@ jobs:
255273
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)) {
256274
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
257275
}
258-
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name C:\Miniconda\Library\lib\intelocl64.dll -Value 0
276+
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
259277
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
260278
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
261279
# Now copy OpenCL.dll into system folder
262280
$system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
263-
$python_ocl_icd_loader="C:\Miniconda\Library\bin\OpenCL.dll"
281+
$python_ocl_icd_loader="$conda_env_library\bin\OpenCL.dll"
264282
Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
265283
if (Test-Path -Path $system_ocl_icd_loader) {
266284
Write-Output "$system_ocl_icd_loader has been copied"
@@ -270,19 +288,24 @@ jobs:
270288
Write-Output "OCL-ICD-Loader was not copied"
271289
}
272290
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
273-
echo "TBB_DLL_PATH=C:\Miniconda\Library\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
291+
$cl_cfg="$conda_env_library\lib\cl.cfg"
292+
Write-Output $cl_cfg
293+
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
294+
Get-Content -Tail 5 -Path $cl_cfg
274295
}
275296
- name: Smoke test
297+
shell: cmd /C CALL {0}
276298
run: |
299+
python -c "import sys; print(sys.executable)"
277300
set SYCL_ENABLE_HOST_DEVICE=1
278-
& { [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Miniconda\Library\bin\", [EnvironmentVariableTarget]::Machine) }
279301
python -c "import dpctl; dpctl.lsplatform()"
280302
python -c "import dpctl; print(dpctl.get_devices(backend='opencl', device_type='gpu'))"
281303
python -c "import dpctl; print(dpctl.get_num_devices(backend='opencl', device_type='gpu'))"
282304
- name: Run tests
305+
shell: cmd /C CALL {0}
283306
run: |
284307
set SYCL_ENABLE_HOST_DEVICE=1
285-
& { [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Miniconda\Library\bin\", [EnvironmentVariableTarget]::Machine) }
308+
python -c "import sys; print(sys.executable)"
286309
python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
287310
288311
upload_linux:
@@ -294,7 +317,7 @@ jobs:
294317
python: ['3.8', '3.9', '3.10']
295318
steps:
296319
- name: Download artifact
297-
uses: actions/download-artifact@v2
320+
uses: actions/download-artifact@v3
298321
with:
299322
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
300323

@@ -319,7 +342,7 @@ jobs:
319342
python: ['3.8', '3.9']
320343
steps:
321344
- name: Download artifact
322-
uses: actions/download-artifact@v2
345+
uses: actions/download-artifact@v3
323346
with:
324347
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
325348
- uses: conda-incubator/setup-miniconda@v2
@@ -346,18 +369,18 @@ jobs:
346369
runner: [ubuntu-latest]
347370
continue-on-error: ${{ matrix.experimental }}
348371
env:
349-
CHANNELS: -c defaults -c intel --override-channels
372+
CHANNELS: -c intel -c main --override-channels
350373

351374
steps:
352375
- name: Install conda-build
353376
# Needed to be able to run conda index
354377
run: conda install conda-build python=${{ matrix.python }}
355378
- name: Checkout dpctl repo
356-
uses: actions/checkout@v2
379+
uses: actions/checkout@v3
357380
with:
358381
fetch-depth: 0
359382
- name: Download artifact
360-
uses: actions/download-artifact@v2
383+
uses: actions/download-artifact@v3
361384
with:
362385
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
363386
- name: Add conda to system path
@@ -404,7 +427,7 @@ jobs:
404427
shell: bash -l {0}
405428
run: |
406429
source $CONDA/etc/profile.d/conda.sh
407-
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c defaults --override-channels"
430+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c main --override-channels"
408431
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
409432
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
410433
- name: Build and run examples with native extensions
@@ -488,7 +511,7 @@ jobs:
488511
runner: [ubuntu-latest]
489512
continue-on-error: ${{ matrix.experimental }}
490513
env:
491-
CHANNELS: -c intel -c defaults --override-channels
514+
CHANNELS: -c intel -c main --override-channels
492515
steps:
493516
- name: Cache array API tests
494517
id: cache-array-api-tests
@@ -511,7 +534,7 @@ jobs:
511534
git clone --recurse-submodules https://github.com/data-apis/array-api-tests array-api-tests
512535
cd array-api-tests
513536
- name: Download artifact
514-
uses: actions/download-artifact@v2
537+
uses: actions/download-artifact@v3
515538
with:
516539
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
517540
- name: Add conda to system path

.github/workflows/cpp_style_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: clang-format
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- name: Run clang-format style check for C/C++ programs.
1919
uses: jidicula/[email protected]
2020
with:

.github/workflows/generate-coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Cancel Previous Runs
18-
uses: styfle/cancel-workflow-action@0.6.0
18+
uses: styfle/cancel-workflow-action@0.11.0
1919
with:
2020
access_token: ${{ github.token }}
2121

@@ -37,7 +37,7 @@ jobs:
3737
sudo apt-get install cmake ninja-build
3838
3939
- name: Setup Python
40-
uses: actions/setup-python@v2
40+
uses: actions/setup-python@v4
4141
with:
4242
python-version: '3.10'
4343
architecture: x64
@@ -68,7 +68,7 @@ jobs:
6868
make && make install
6969
7070
- name: Checkout repo
71-
uses: actions/checkout@v2
71+
uses: actions/checkout@v3
7272
with:
7373
fetch-depth: 0
7474

.github/workflows/generate-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-20.04
1313
steps:
1414
- name: Cancel Previous Runs
15-
uses: styfle/cancel-workflow-action@0.6.0
15+
uses: styfle/cancel-workflow-action@0.11.0
1616
with:
1717
access_token: ${{ github.token }}
1818
- name: Add Intel repository
@@ -41,7 +41,7 @@ jobs:
4141
sudo apt-get install cmake ninja-build
4242
- name: Setup Python
4343
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
44-
uses: actions/setup-python@v2
44+
uses: actions/setup-python@v4
4545
with:
4646
python-version: '3.10'
4747
architecture: x64
@@ -51,7 +51,7 @@ jobs:
5151
run: |
5252
pip install numpy cython setuptools scikit-build sphinx sphinx_rtd_theme pydot graphviz sphinxcontrib-programoutput
5353
- name: Checkout repo
54-
uses: actions/checkout@v2
54+
uses: actions/checkout@v3
5555
with:
5656
fetch-depth: 0
5757
persist-credentials: false

0 commit comments

Comments
 (0)