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