@@ -13,34 +13,60 @@ jobs:
1313 - name : Checkout Repository
1414 uses : actions/checkout@v4
1515
16- # ---- Install OpenCL CPU runtime and build tools ----
17- - name : Install OpenCL SDK and CMake
18- run : |
19- choco install opencl-sdk -y
20- choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
16+ - name : Cache vcpkg
17+ uses : actions/cache@v3
18+ with :
19+ path : C:/vcpkg/installed
20+ key : vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
21+ restore-keys : |
22+ vcpkg-${{ runner.os }}-
2123
22- - name : Install Python dependencies
23- run : |
24- pip install --upgrade pip
25- pip install pyopencl numpy pandas matplotlib
24+ - name : Cache CMake build
25+ uses : actions/cache@v3
26+ with :
27+ path : build
28+ key : cmake-build-${{ runner.os }}-${{ github.sha }}
29+ restore-keys : |
30+ cmake-build-${{ runner.os }}-
2631
27- # ---- Configure and build the C++ project ----
28- - name : Configure project (CMake with MSVC)
29- run : |
30- cmake -S . -B build -G "Visual Studio 17 2022" -A x64
32+ - name : Cache Python packages
33+ uses : actions/cache@v3
34+ with :
35+ path : |
36+ ~/.cache/pip
37+ ~/.virtualenvs
38+ key : python-packages-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
39+ restore-keys : |
40+ python-packages-${{ runner.os }}-
3141
32- - name : Build Release
42+ - name : Install CMake
43+ run : choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
44+
45+ - name : Install vcpkg
46+ if : steps.cache-vcpkg.outputs.cache-hit != 'true'
3347 run : |
34- cmake --build build --config Release
48+ git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
49+ C:\vcpkg\bootstrap-vcpkg.bat
50+
51+ - name : Install OpenCL via vcpkg
52+ run : C:\vcpkg\vcpkg.exe install opencl:x64-windows
53+
54+ - name : Configure CMake with vcpkg toolchain
55+ run : cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
56+
57+ - name : Build Project
58+ run : cmake --build build --config Release
3559
36- # ---- Run your Python benchmark automation ----
37- - name : Run Benchmark Script
60+ - name : Install Python dependencies
3861 run : |
39- python automation/benchmark.py 0
62+ python -m pip install --upgrade pip
63+ pip install pyopencl numpy pandas matplotlib
64+
65+ - name : Run Benchmark
66+ run : python automation/run_benchmarks.py 0
4067
41- # ---- Upload benchmark results ----
42- - name : Upload Results
68+ - name : Upload Benchmark Results
4369 uses : actions/upload-artifact@v4
4470 with :
4571 name : windows-cpu-opencl-results
46- path : automation/
72+ path : automation/
0 commit comments