Skip to content

Commit 8751fe2

Browse files
committed
cross-platform workflows
1 parent c48e883 commit 8751fe2

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ name: Windows CPU OpenCL Benchmark
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches: [ main ]
75

86
jobs:
9-
benchmark:
7+
windows-build:
108
runs-on: windows-latest
119

1210
steps:
@@ -67,3 +65,39 @@ jobs:
6765
with:
6866
name: windows-cpu-opencl-build
6967
path: build/Release/
68+
69+
linux-benchmark:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Checkout Repository
73+
uses: actions/checkout@v4
74+
75+
- name: Install dependencies
76+
run: |
77+
sudo apt update
78+
sudo apt-get install -y cmake build-essential ocl-icd-opencl-dev pocl-opencl-icd python3-pip
79+
python3 -m pip install --upgrade pip
80+
pip install pyopencl numpy pandas matplotlib
81+
82+
- name: Cache CMake build
83+
uses: actions/cache@v3
84+
with:
85+
path: build
86+
key: linux-cmake-${{ github.sha }}
87+
restore-keys: |
88+
linux-cmake-
89+
90+
- name: Configure project
91+
run: cmake -S . -B build
92+
93+
- name: Build project
94+
run: cmake --build build --config Release
95+
96+
- name: Run Benchmark
97+
run: python3 automation/run_benchmarks.py 0
98+
99+
- name: Upload Benchmark Results
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: linux-benchmark-results
103+
path: automation/

src/benchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int main(int argc, char** argv) {
277277
// get number of devices on a platform p, similar to the way we got number of platforms
278278
// CL_DEVICE_TYPE_ALL specifies we want all types of devices (CPU, GPU, etc.)
279279
// CL_DEVICE_TYPE_GPU could be used to select only GPU devices
280-
err = clGetDeviceIDs(p, CL_DEVICE_TYPE_GPU, 0, NULL, &dev_count);
280+
err = clGetDeviceIDs(p, CL_DEVICE_TYPE_ALL, 0, NULL, &dev_count);
281281
if (err == CL_DEVICE_NOT_FOUND) { continue; } // skip platform with no devices
282282
CHECK(err);
283283

0 commit comments

Comments
 (0)