1stages: 2 - test 3 4noether-rocm: 5 stage: test 6 tags: 7 - rocm 8 image: jedbrown/rocm:latest 9 script: 10# Compilers 11 - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc 12 - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU 13 - echo "-------------- CC ------------------" && $CC --version 14 - echo "-------------- CXX -----------------" && $CXX --version 15 - echo "-------------- FC ------------------" && $FC --version 16 - echo "-------------- HIPCC ---------------" && $HIPCC --version 17 - echo "-------------- GCOV ----------------" && gcov --version 18# Libraries for backends 19# -- MAGMA from dev branch 20 - echo "-------------- MAGMA ---------------" 21 - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR describe 22# -- LIBXSMM v1.16.1 23 - cd .. && export XSMM_VERSION=libxsmm-1.16.1 && { [[ -d $XSMM_VERSION ]] || { git clone --depth 1 --branch 1.16.1 https://github.com/hfp/libxsmm.git $XSMM_VERSION && make -C $XSMM_VERSION -j$(nproc); }; } && export XSMM_DIR=$PWD/$XSMM_VERSION && cd libCEED 24 - echo "-------------- LIBXSMM -------------" && git -C $XSMM_DIR describe --tags 25# -- OCCA v1.1.0 26 - cd .. && export OCCA_VERSION=occa-1.1.0 OCCA_OPENCL_ENABLED=0 && { [[ -d $OCCA_VERSION ]] || { git clone --depth 1 --branch v1.1.0 https://github.com/libocca/occa.git $OCCA_VERSION && make -C $OCCA_VERSION -j$(nproc); }; } && export OCCA_DIR=$PWD/$OCCA_VERSION && cd libCEED 27 - echo "-------------- OCCA ----------------" && make -C $OCCA_DIR info 28# libCEED 29 - make configure HIP_DIR=/opt/rocm OPT='-O -march=native -ffp-contract=fast' 30 - BACKENDS_CPU=$(make info-backends | grep -o '/cpu[^ ]*') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*') 31 - echo "-------------- libCEED -------------" && make info 32 - echo "-------------- BACKENDS_CPU---------" && echo $BACKENDS_CPU 33 - echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU 34 - make -j$NPROC_CPU 35# -- libCEED only tests 36 - echo "-------------- core tests ----------" 37 - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json 38# Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests 39 - export PETSC_DIR= PETSC_ARCH= 40 - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit realsearch=% 41 - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit realsearch=% 42# Libraries for examples 43# -- PETSc with HIP (minimal) 44 - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR describe 45 - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info 46 - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search="petsc fluids solids" 47 - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search="petsc fluids solids" 48# -- MFEM v4.2 49 - cd .. && export MFEM_VERSION=mfem-4.2 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.2 https://github.com/mfem/mfem.git $MFEM_VERSION && make -C $MFEM_VERSION -j$(nproc) serial CXXFLAGS="-O -std=c++11"; }; } && export MFEM_DIR=$PWD/$MFEM_VERSION && cd libCEED 50 - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info 51 - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=mfem 52 - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=mfem 53# -- Nek5000 v19.0 54 - export COVERAGE=0 55 - cd .. && export NEK5K_VERSION=Nek5000-19.0 && { [[ -d $NEK5K_VERSION ]] || { git clone --depth 1 --branch v19.0 https://github.com/Nek5000/Nek5000.git $NEK5K_VERSION && cd $NEK5K_VERSION/tools && ./maketools genbox genmap reatore2 && cd ../..; }; } && export NEK5K_DIR=$PWD/$NEK5K_VERSION && export PATH=$NEK5K_DIR/bin:$PATH MPI=0 && cd libCEED 56 - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags 57 - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=nek 58 - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=nek 59# Clang-tidy 60 - echo "-------------- clang-tidy ----------" && clang-tidy --version 61 - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --exit-code 62# Report status 63 - echo "SUCCESS" > .job_status 64 after_script: 65 - | 66 if [ $(cat .job_status) == "SUCCESS" ]; then 67 lcov --directory . --capture --output-file coverage.info; 68 bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface; 69 bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery; 70 bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends; 71 bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests; 72 bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples; 73 fi 74 artifacts: 75 paths: 76 - build/*.junit 77 reports: 78 junit: build/*.junit 79 performance: performance.json 80