Cache MKL plans #1489
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: C++ | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - ".github/workflows/build_cpp.yml" | |
| - "**.cpp" | |
| - "**.h" | |
| - "**.c" | |
| - "**.cu" | |
| - "**.cmake" | |
| - "**CMakeLists.txt" | |
| pull_request: | |
| branches: [ master ] | |
| paths: | |
| - ".github/workflows/build_cpp.yml" | |
| - "**.cpp" | |
| - "**.h" | |
| - "**.c" | |
| - "**.cu" | |
| - "**.cmake" | |
| - "**CMakeLists.txt" | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| linux: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: ubuntu-22.04-default-deps | |
| os : ubuntu-22.04 | |
| build_tests : true | |
| build_examples : true | |
| build_blas_bindings : true | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| extra_apt : libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev libopenblas-dev liblapack-dev | |
| - name: ubuntu-22.04-atlas | |
| os : ubuntu-22.04 | |
| build_tests : true | |
| build_blas_bindings : true | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| extra_apt : libatlas-base-dev | |
| - name: ubuntu-22.04-ffmpeg-513 | |
| os : ubuntu-22.04 | |
| build_tests : true | |
| build_ffmpeg : true | |
| ffmpeg_version : 5.1.3 | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| extra_apt : make yasm | |
| configure_extra : -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation | |
| - name: ubuntu-22.04-ffmpeg-701 | |
| os : ubuntu-22.04 | |
| build_ffmpeg : true | |
| build_ffmpeg_examples : true | |
| ffmpeg_version : 7.0.1 | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| extra_apt : make yasm | |
| configure_extra : -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n7.0.1_installation | |
| - name: ubuntu-22.04-ffmpeg-711 | |
| os : ubuntu-22.04 | |
| build_ffmpeg : true | |
| build_ffmpeg_examples : true | |
| ffmpeg_version : 7.1.1 | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| extra_apt : make yasm | |
| configure_extra : -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n7.1.1_installation | |
| - name: ubuntu-latest-gcc11-default-deps | |
| os : ubuntu-latest | |
| build_tests : true | |
| build_examples : true | |
| build_blas_bindings : true | |
| c_compiler : gcc-11 | |
| cxx_compiler : g++-11 | |
| extra_apt : "libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev libopenblas-dev liblapack-dev gcc-11 g++-11" | |
| - name: ubuntu-latest-clang-default-avx | |
| os : ubuntu-latest | |
| build_tests : true | |
| build_examples : true | |
| c_compiler : clang | |
| cxx_compiler : clang++ | |
| extra_apt : "libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev clang" | |
| configure_extra : -DUSE_AVX_INSTRUCTIONS=1 | |
| - name: ubuntu-latest-mkl-sequential | |
| os : ubuntu-latest | |
| build_tests : true | |
| build_mkl : true | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| configure_extra : -DDLIB_USE_MKL_SEQUENTIAL=ON | |
| - name: ubuntu-latest-mkl-tbb | |
| os : ubuntu-latest | |
| build_tests : true | |
| build_mkl : true | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| configure_extra : -DDLIB_USE_MKL_SEQUENTIAL=OFF -DDLIB_USE_MKL_WITH_TBB=ON | |
| - name: ubuntu-latest-mkl-thread | |
| os : ubuntu-latest | |
| build_tests : true | |
| build_mkl : true | |
| c_compiler : gcc | |
| cxx_compiler : g++ | |
| configure_extra : -DDLIB_USE_MKL_SEQUENTIAL=OFF -DDLIB_USE_MKL_WITH_TBB=OFF -DDLIB_USE_MKL_THREAD=ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| if: ${{ matrix.extra_apt != '' }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ${{ matrix.extra_apt }} | |
| - name: Cache FFmpeg | |
| if: ${{ matrix.build_ffmpeg }} | |
| uses: actions/cache@v3 | |
| id: cache-ffmpeg | |
| with: | |
| path: /home/runner/ffmpeg-n${{ matrix.ffmpeg_version }}_installation | |
| key: ffmpeg-n${{ matrix.ffmpeg_version }} | |
| - name: Build FFmpeg | |
| if: ${{ matrix.build_ffmpeg && (steps.cache-ffmpeg.outputs.cache-hit != 'true') }} | |
| run: | | |
| wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${{ matrix.ffmpeg_version }}.tar.gz | |
| tar -xf n${{ matrix.ffmpeg_version }}.tar.gz | |
| cd FFmpeg-n${{ matrix.ffmpeg_version }} | |
| ./configure --prefix=/home/runner/ffmpeg-n${{ matrix.ffmpeg_version }}_installation --disable-doc --disable-programs | |
| make -j4 | |
| make install | |
| - name: Prepare MKL dir for cache restore | |
| if: ${{ matrix.build_mkl }} | |
| run: sudo mkdir -p /opt/intel | |
| - name: Cache MKL | |
| if: ${{ matrix.build_mkl}} | |
| uses: actions/cache@v3 | |
| id: cache-mkl | |
| with: | |
| path: | | |
| /opt/intel/oneapi/mkl | |
| /opt/intel/oneapi/tbb | |
| /opt/intel/oneapi/compiler | |
| key: mkl_try3 | |
| - name: Download MKL | |
| if: ${{ matrix.build_mkl && (steps.cache-mkl.outputs.cache-hit != 'true') }} | |
| run: | | |
| wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/bd1d0273-a931-4f7e-ab76-6a2a67d646c7/intel-oneapi-base-toolkit-2025.2.0.592_offline.sh | |
| sudo sh ./intel-oneapi-base-toolkit-2025.2.0.592_offline.sh -a --silent --eula accept | |
| - name: Configure | |
| run: | | |
| cmake dlib/test -B build \ | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \ | |
| ${{ matrix.configure_extra }} | |
| - name: Build tests | |
| if: ${{ matrix.build_tests }} | |
| run: cmake --build build --config Release --target dtest --parallel 4 | |
| - name: Test | |
| if: ${{ matrix.build_tests }} | |
| run: ./build/dtest --runall -q | |
| - name: Build examples | |
| if: ${{ matrix.build_examples }} | |
| run: cmake --build build --config Release --parallel 4 | |
| - name: Build FFMPEG examples | |
| if: ${{ matrix.build_ffmpeg_examples }} | |
| run: cmake --build build --config Release --target ffmpeg_video_muxing_ex --parallel 4 | |
| - name: Configure BLAS binding tests | |
| if: ${{ matrix.build_blas_bindings }} | |
| run: cmake dlib/test/blas_bindings -B build_blas_bindings | |
| - name: Build BLAS binding tests | |
| if: ${{ matrix.build_blas_bindings }} | |
| run: cmake --build build_blas_bindings --config Debug --parallel 4 | |
| - name: Test BLAS bindings | |
| if: ${{ matrix.build_blas_bindings }} | |
| run: ./build_blas_bindings/dtest --runall -q | |
| windows: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: windows-latest-openblas | |
| os : windows-latest | |
| extra_packages : openblas:x64-windows | |
| - name: windows-latest-mkl | |
| os : windows-latest | |
| extra_packages : intel-mkl:x64-windows | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: vcpkg install ${{ matrix.extra_packages }} | |
| - name: Configure | |
| run: | | |
| cmake dlib/test -B build \ | |
| -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ | |
| -DVCPKG_TARGET_TRIPLET=x64-windows | |
| - name: Build just tests | |
| run: cmake --build build --config Release --target dtest --parallel 4 | |
| - name: Test | |
| run: build/Release/dtest.exe --runall -q | |
| - name: Build ancillary tools | |
| run: cmake --build build --config Release --target imglab htmlify dtoc --parallel 4 |