-
Notifications
You must be signed in to change notification settings - Fork 22
/
make.sh
executable file
·13 lines (10 loc) · 875 Bytes
/
make.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
# command line argument(s): device ID(s); if empty, it will benchmark all available devices
mkdir -p bin # create directory for executable
rm -f bin/OpenCL-Benchmark # prevent execution of old version if compiling fails
case "$(uname -a)" in # automatically detect operating system
Darwin*) g++ src/*.cpp -o bin/OpenCL-Benchmark -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -framework OpenCL ;; # macOS
*Android) g++ src/*.cpp -o bin/OpenCL-Benchmark -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L/system/vendor/lib64 -lOpenCL ;; # Android
* ) g++ src/*.cpp -o bin/OpenCL-Benchmark -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL ;; # Linux
esac
if [[ $? == 0 ]]; then bin/OpenCL-Benchmark "$@"; fi # run executable only if last compilation was successful