Skip to content

Commit 7d926cb

Browse files
committed
adds a CI job: test_opencl
1 parent 87f9142 commit 7d926cb

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,69 @@ jobs:
9494
jekyll: false
9595
env:
9696
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
98+
test_opencl:
99+
runs-on: ubuntu-latest
100+
env:
101+
CC: mpicc
102+
PETSC_DIR: ${{ github.workspace }}/petsc
103+
PETSC_ARCH: default
104+
PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 --with-c2html=0 --with-fortran-bindings=0 --with-opencl=1 --download-viennacl --with-viennacl=1
105+
106+
steps:
107+
- name: Install system dependencies
108+
shell: bash
109+
run: |
110+
sudo apt update
111+
sudo apt install build-essential mpich libmpich-dev \
112+
libblas-dev liblapack-dev gfortran
113+
sudo apt install ocl-icd-opencl-dev pocl-opencl-icd
114+
115+
- name: Set correct Python version
116+
uses: actions/setup-python@v2
117+
with:
118+
python-version: '3.6'
119+
120+
- name: Clone PETSc
121+
uses: actions/checkout@v2
122+
with:
123+
repository: firedrakeproject/petsc
124+
path: ${{ env.PETSC_DIR }}
125+
126+
- name: Build and install PETSc
127+
shell: bash
128+
working-directory: ${{ env.PETSC_DIR }}
129+
run: |
130+
./configure ${PETSC_CONFIGURE_OPTIONS}
131+
make
132+
133+
- name: Build and install petsc4py
134+
shell: bash
135+
working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py
136+
run: |
137+
python -m pip install --upgrade cython numpy
138+
python -m pip install --no-deps .
139+
140+
- name: Checkout PyOP2
141+
uses: actions/checkout@v2
142+
with:
143+
path: PyOP2
144+
145+
- name: Install PyOP2
146+
shell: bash
147+
working-directory: PyOP2
148+
run: |
149+
python -m pip install pip==20.2 # pip 20.2 needed for loopy install to work.
150+
151+
# xargs is used to force installation of requirements in the order we specified.
152+
xargs -l1 python -m pip install < requirements-ext.txt
153+
xargs -l1 python -m pip install < requirements-git.txt
154+
python -m pip install pulp
155+
python -m pip install -U flake8
156+
python -m pip install pyopencl
157+
python -m pip install .
158+
159+
- name: Run tests
160+
shell: bash
161+
working-directory: PyOP2
162+
run: pytest test -v --tb=native

0 commit comments

Comments
 (0)