diff options
| author | silvanshade <[email protected]> | 2025-02-08 05:28:20 -0700 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2025-03-13 12:16:50 -0700 |
| commit | 4a885fcaeeb4c79414f9b0433ab417faaacf3066 (patch) | |
| tree | bbe89de41475e9fb7e4d70bf10aece3585db2b3f /.github/workflows/ci.yml | |
| parent | a31e519869d5751370f50c39a99340660ee95bf7 (diff) | |
Implement TBB-based parallelism for C lib
Diffstat (limited to '.github/workflows/ci.yml')
| -rw-r--r-- | .github/workflows/ci.yml | 141 |
1 files changed, 83 insertions, 58 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ce575e..2fc5e94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,54 +225,48 @@ jobs: # Currently only on x86. c_tests: - name: C Makefile tests + name: C tests SIMD=${{ matrix.simd }} TBB=${{ matrix.use_tbb }} runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + use_tbb: ["OFF", "ON"] + simd: ["x86-intrinsics", "amd64-asm"] steps: - uses: actions/checkout@v4 - # Test the intrinsics-based implementations. - - run: make -f Makefile.testing test - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_sse2.c - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 make -f Makefile.testing test - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_sse41.c - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 make -f Makefile.testing test - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_avx2.c - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make -f Makefile.testing test - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_avx512.c - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make -f Makefile.testing test - working-directory: ./c - # Test the assembly implementations. - - run: make -f Makefile.testing test_asm - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_sse2_x86-64_unix.S - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 make -f Makefile.testing test_asm - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_sse41_x86-64_unix.S - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 make -f Makefile.testing test_asm - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_avx2_x86-64_unix.S - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make -f Makefile.testing test_asm - working-directory: ./c - - run: make -f Makefile.testing clean && rm blake3_avx512_x86-64_unix.S - working-directory: ./c - - run: BLAKE3_NO_SSE2=1 BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make -f Makefile.testing test_asm - working-directory: ./c - # Restore the files we deleted above. - - run: git checkout . - # Build the example. - - run: make -f Makefile.testing example - working-directory: ./c + - run: | + sudo apt-get update + sudo apt-get install ninja-build libtbb-dev libtbb12 + # Test the intrinsics-based and assembly-based implementations. + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_SIMD_TYPE=${{ matrix.simd }}" + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_SIMD_TYPE=${{ matrix.simd }}" -DBLAKE3_NO_SSE2=1 + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_SIMD_TYPE=${{ matrix.simd }}" -DBLAKE3_NO_SSE2=1 -DBLAKE3_NO_SSE41=1 + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_SIMD_TYPE=${{ matrix.simd }}" "-DBLAKE3_NO_SSE2=1" "-DBLAKE3_NO_SSE41=1" "-DBLAKE3_NO_AVX2=1" + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_SIMD_TYPE=${{ matrix.simd }}" "-DBLAKE3_NO_SSE2=1" "-DBLAKE3_NO_SSE41=1" "-DBLAKE3_NO_AVX2=1" "-DBLAKE3_NO_AVX512=1" + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + # Test with TBB disabled/enabled. + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON "-DBLAKE3_USE_TBB=${{ matrix.use_tbb }}" + cmake --build c/build --target test + cat c/build/Testing/Temporary/LastTest.log + # Build the example with TBB disabled/enabled. + - run: | + cmake --fresh -S c -B c/build -G Ninja -DBLAKE3_TESTING=ON -DBLAKE3_TESTING_CI=ON -DBLAKE3_EXAMPLES=ON + cmake --build c/build --target blake3-example # Note that this jobs builds AArch64 binaries from an x86_64 host. build_apple_silicon: @@ -323,28 +317,59 @@ jobs: cd /work ~/.cargo/bin/cargo test --features prefer_intrinsics - # CMake build test (Library only), current macOS/Linux only. + # CMake build test (Library only). cmake_current_build: - name: CMake ${{ matrix.os }} ${{ matrix.compiler }} + name: CMake ${{ matrix.os }} CC=${{ matrix.toolchain.cc }} CXX=${{ matrix.toolchain.cxx }} TBB=${{ matrix.use_tbb }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macOS-latest", "windows-latest"] - compiler: [gcc, clang, cl] + cmakeVersion: [latest] + ninjaVersion: [latest] + os: [ubuntu-latest, macOS-latest, windows-latest] + toolchain: [ + { cc: cl, cxx: cl }, + { cc: clang, cxx: clang++ }, + { cc: clang-cl, cxx: clang-cl }, + { cc: gcc, cxx: g++ }, + ] + use_tbb: [OFF, ON] exclude: - - os: windows-latest - compiler: gcc - - os: ubuntu-latest - compiler: msvc - os: macOS-latest - compiler: msvc + toolchain: { cc: cl, cxx: cl } + - os: macOS-latest + toolchain: { cc: clang-cl, cxx: clang-cl } + - os: ubuntu-latest + toolchain: { cc: cl, cxx: cl } + - os: ubuntu-latest + toolchain: { cc: clang-cl, cxx: clang-cl } + - os: windows-latest + toolchain: { cc: clang, cxx: clang++ } + use_tbb: ON + - os: windows-latest + toolchain: { cc: gcc, cxx: g++ } + use_tbb: ON steps: - uses: actions/checkout@v4 - - name: CMake generation - run: cmake -S c -B c/build -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/target - - name: CMake build / install - run: cmake --build c/build --target install + - uses: lukka/get-cmake@5f6e04f5267c8133f1273bf2103583fc72c46b17 + with: + cmakeVersion: ${{ matrix.cmakeVersion }} + ninjaVersion: ${{ matrix.ninjaVersion }} + - if: matrix.os == 'macOS-latest' + name: Install dependencies on macOS + run: | + brew update + brew install tbb + - if: matrix.os == 'ubuntu-latest' + name: Install dependencies on Linux + run: | + sudo apt-get update + sudo apt-get install libtbb-dev libtbb12 + - name: CMake generation, build, install + run: | + ${{ matrix.os != 'windows-latest' || '& "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -SkipAutomaticLocation' }} + cmake -S c -B c/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/target -DCMAKE_C_COMPILER=${{ matrix.toolchain.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.toolchain.cxx }} -DBLAKE3_USE_TBB=${{ matrix.use_tbb }} -DBLAKE3_FETCH_TBB=${{ matrix.os == 'windows-latest' && 'YES' || 'NO' }} -DBLAKE3_EXAMPLES=ON + cmake --build c/build --target install cmake_3-9_build: name: CMake 3.9.6 ubuntu-latest runs-on: ubuntu-latest |
