summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build_and_test.yml93
-rw-r--r--.github/workflows/release.yml97
2 files changed, 190 insertions, 0 deletions
diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
new file mode 100644
index 00000000..e1f59a0e
--- /dev/null
+++ b/.github/workflows/build_and_test.yml
@@ -0,0 +1,93 @@
+name: CLBlast build
+
+on:
+ pull_request: {}
+ push:
+ branches: ['master']
+
+jobs:
+
+ build_and_test_linux_and_macos:
+ strategy:
+ matrix:
+ config: [
+ {os: ubuntu-latest, c_compiler: gcc, cpp_compiler: g++},
+ {os: ubuntu-latest, c_compiler: clang, cpp_compiler: clang++},
+ {os: macos-latest, c_compiler: clang, cpp_compiler: clang++},
+ ]
+ runs-on: ${{ matrix.config.os }}
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install requirements for Ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install -yq ninja-build ocl-icd-opencl-dev opencl-c-headers libopenblas-dev --no-install-recommends
+ if: ${{ matrix.config.os == 'ubuntu-latest' }}
+
+ - name: Install requirements for macOS
+ run: brew install ninja
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run CMake
+ run: |
+ export CC=${{ matrix.config.c_compiler }}
+ export CXX=${{ matrix.config.cpp_compiler }}
+ cmake -S . -B build -G Ninja -DTESTS=ON -DCLIENTS=ON -DSAMPLES=ON
+
+ - name: Compile the code
+ run: cmake --build build
+
+ - name: Get the diagnostics info
+ run: ./build/clblast_test_diagnostics
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example client
+ run: ./build/clblast_client_xgemm
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example sample program
+ run: ./build/clblast_sample_dgemv_c
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example tuner
+ run: ./build/clblast_tuner_xdot
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run the unittests
+ run: ctest --test-dir build
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ build_windows:
+
+ strategy:
+ matrix:
+ config: [
+ {os: windows-2019, arch: x64},
+ ]
+
+ runs-on: ${{ matrix.config.os }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up MSVC
+ uses: ilammy/msvc-dev-cmd@v1
+
+ - name: Install OpenBLAS
+ run: |
+ mkdir openblas
+ cd openblas
+ C:\msys64\usr\bin\wget.exe https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23-x64.zip
+ 7z x OpenBLAS-0.3.23-x64.zip
+ pwd
+ ls
+
+ - name: Install OpenCL
+ run: vcpkg.exe --triplet=${{ matrix.config.arch }}-windows install opencl
+
+ - name: Run CMake
+ run: cmake -S . -B build -DTESTS=ON -DCLIENTS=ON -DSAMPLES=ON -DOPENCL_ROOT=C:\vcpkg\packages\opencl_x64-windows -DCBLAS_ROOT=${{ github.workspace }}\openblas
+
+ - name: Compile the code
+ run: cmake --build build
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..98c8c536
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,97 @@
+name: CLBlast release
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Version of the form 1.5.3"
+ required: true
+
+
+jobs:
+
+ release_linux_and_macos:
+
+ strategy:
+ matrix:
+ config: [
+ {name: linux, os: ubuntu-20.04, arch: x86_64, c_compiler: gcc-9, cpp_compiler: g++-9},
+ {name: macos, os: macos-11, arch: x86_64, c_compiler: clang, cpp_compiler: clang++},
+ ]
+
+ runs-on: ${{ matrix.config.os }}
+
+ env:
+ RELEASE_NAME: CLBlast-${{ github.event.inputs.version }}-${{ matrix.config.name }}-${{ matrix.config.arch }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install requirements for Ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install -yq ocl-icd-opencl-dev opencl-c-headers --no-install-recommends
+ if: ${{ matrix.config.name == 'linux' }}
+
+ - name: Run CMake
+ run: |
+ mkdir ${{env.RELEASE_NAME}}
+ export CC=${{ matrix.config.c_compiler }}
+ export CXX=${{ matrix.config.cpp_compiler }}
+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DCLIENTS=OFF -DSAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{env.RELEASE_NAME}}
+
+ - name: Compile the code
+ run: cmake --build build
+
+ - name: Package the code
+ run: |
+ cmake --build build --target install
+ tar -cvf ${{env.RELEASE_NAME}}.tar.gz ${{env.RELEASE_NAME}}
+
+ - name: Upload the release
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{env.RELEASE_NAME}}
+ path: ${{env.RELEASE_NAME}}.tar.gz
+
+
+ release_windows:
+
+ strategy:
+ matrix:
+ config: [
+ {name: windows, os: windows-2019, arch: x64},
+ ]
+
+ runs-on: ${{ matrix.config.os }}
+
+ env:
+ RELEASE_NAME: CLBlast-${{ github.event.inputs.version }}-${{ matrix.config.name }}-${{ matrix.config.arch }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up MSVC
+ uses: ilammy/msvc-dev-cmd@v1
+
+ - name: Install OpenCL
+ run: vcpkg.exe --triplet=${{ matrix.config.arch }}-windows install opencl
+
+ - name: Run CMake
+ run: |
+ mkdir ${{env.RELEASE_NAME}}
+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DCLIENTS=OFF -DSAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{env.RELEASE_NAME}} -DOPENCL_ROOT=C:/vcpkg/packages/opencl_x64-windows
+
+ - name: Compile the code
+ run: cmake --build build
+
+ - name: Package the code
+ run: |
+ cmake --build build --target install
+ 7z a -r ${{env.RELEASE_NAME}}.7z ${{env.RELEASE_NAME}}
+
+ - name: Upload the release
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{env.RELEASE_NAME}}
+ path: ${{env.RELEASE_NAME}}.7z