Skip to content

Commit c6f05a8

Browse files
committed
adds a CI job: test_opencl
1 parent 905c09f commit c6f05a8

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

0 commit comments

Comments
 (0)