forked from ProjectPhysX/OpenCL-Benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·13 lines (10 loc) · 900 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 and X11 support on Linux
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