Windows CPU OpenCL Benchmark #22
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: Windows CPU OpenCL Benchmark | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| windows-build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Cache vcpkg | |
| uses: actions/cache@v3 | |
| with: | |
| path: C:/vcpkg/installed | |
| key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| vcpkg-${{ runner.os }}- | |
| - name: Cache CMake build | |
| uses: actions/cache@v3 | |
| with: | |
| path: build | |
| key: cmake-build-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| cmake-build-${{ runner.os }}- | |
| - name: Cache Python packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| ~/.virtualenvs | |
| key: python-packages-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| python-packages-${{ runner.os }}- | |
| - name: Install CMake | |
| run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y | |
| - name: Install vcpkg | |
| if: steps.cache-vcpkg.outputs.cache-hit != 'true' | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg.git C:\vcpkg | |
| C:\vcpkg\bootstrap-vcpkg.bat | |
| - name: Install OpenCL via vcpkg | |
| run: C:\vcpkg\vcpkg.exe install opencl:x64-windows | |
| - name: Configure CMake with vcpkg toolchain | |
| run: cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build Project | |
| run: cmake --build build --config Release | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyopencl numpy pandas matplotlib | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-cpu-opencl-build | |
| path: build/Release/ | |
| linux-benchmark: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt-get install -y cmake build-essential ocl-icd-opencl-dev pocl-opencl-icd python3-pip | |
| python3 -m pip install --upgrade pip | |
| pip install pyopencl numpy pandas matplotlib | |
| - name: Cache CMake build | |
| uses: actions/cache@v3 | |
| with: | |
| path: build | |
| key: linux-cmake-${{ github.sha }} | |
| restore-keys: | | |
| linux-cmake- | |
| - name: Configure project | |
| run: cmake -S . -B build | |
| - name: Build project | |
| run: cmake --build build --config Release | |
| - name: Run Benchmark | |
| run: python3 automation/run_benchmarks.py 0 | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-benchmark-results | |
| path: automation/ |