File: oclgrindrunner.sh

package info (click to toggle)
haskell-futhark 0.25.32-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,236 kB
  • sloc: haskell: 100,484; ansic: 12,100; python: 3,440; yacc: 785; sh: 561; javascript: 558; lisp: 399; makefile: 277
file content (24 lines) | stat: -rwxr-xr-x 642 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# This script can be used as the --runner argument to the 'bench' and
# 'test' subcommands.  It will use oclgrind to run the program, and
# return a non-zero exit code if oclgrind produces any error output.

set -e

log=$(mktemp oclgrindgrunner-XXXXXX)
trap 'rm -f "$log"' EXIT

# We only use one worker thread, because we are probably going to be
# running this as part of the test suite, where parallelism comes from
# the large number of test programs.

oclgrind --max-errors 10 --log "$log" --num-threads 1 "$@"

if [ "$(stat -c%s "$log")" -ne 0 ]; then
    cat "$log" >&2
    rm -f "$log"
    exit 1
else
    rm -f "$log"
fi