diff options
Diffstat (limited to 'tools/cuda-ab/p2/run_guest.sh')
| -rwxr-xr-x | tools/cuda-ab/p2/run_guest.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/cuda-ab/p2/run_guest.sh b/tools/cuda-ab/p2/run_guest.sh index 0290df1..50a2b2f 100755 --- a/tools/cuda-ab/p2/run_guest.sh +++ b/tools/cuda-ab/p2/run_guest.sh @@ -45,10 +45,15 @@ if [ ! -x "$VMEXEC" ] && [ ! -f "$VMEXEC" ]; then exit 2 fi -# Build any missing binaries first (bin/ may be absent in a fresh checkout). +# Build any missing or stale binaries first (bin/ may be absent in a fresh +# checkout; sources may be newer than a previously built binary). need_build=0 for name in "${PROGS[@]}"; do - [ -x "$HERE/bin/$name" ] || need_build=1 + bin="$HERE/bin/$name" + if [ ! -x "$bin" ] || [ "$HERE/src/$name.cu" -nt "$bin" ] || + [ "$HERE/src/common.h" -nt "$bin" ]; then + need_build=1 + fi done if [ "$need_build" -eq 1 ]; then "$HERE/build.sh" || exit 2 |
