Skip to content

Commit

Permalink
adds a CI job: test_opencl
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Sep 13, 2024
1 parent 170f65a commit 0826b63
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,69 @@ jobs:
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test_opencl:
runs-on: ubuntu-latest
env:
CC: mpicc
PETSC_DIR: ${{ github.workspace }}/petsc
PETSC_ARCH: default
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

steps:
- name: Install system dependencies
shell: bash
run: |
sudo apt update
sudo apt install build-essential mpich libmpich-dev \
libblas-dev liblapack-dev gfortran
sudo apt install ocl-icd-opencl-dev pocl-opencl-icd
- name: Set correct Python version
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Clone PETSc
uses: actions/checkout@v2
with:
repository: firedrakeproject/petsc
path: ${{ env.PETSC_DIR }}

- name: Build and install PETSc
shell: bash
working-directory: ${{ env.PETSC_DIR }}
run: |
./configure ${PETSC_CONFIGURE_OPTIONS}
make
- name: Build and install petsc4py
shell: bash
working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py
run: |
python -m pip install --upgrade cython numpy
python -m pip install --no-deps .
- name: Checkout PyOP2
uses: actions/checkout@v2
with:
path: PyOP2

- name: Install PyOP2
shell: bash
working-directory: PyOP2
run: |
python -m pip install pip==20.2 # pip 20.2 needed for loopy install to work.
# xargs is used to force installation of requirements in the order we specified.
xargs -l1 python -m pip install < requirements-ext.txt
xargs -l1 python -m pip install < requirements-git.txt
python -m pip install pulp
python -m pip install -U flake8
python -m pip install pyopencl
python -m pip install .
- name: Run tests
shell: bash
working-directory: PyOP2
run: pytest test -v --tb=native

0 comments on commit 0826b63

Please sign in to comment.