19 VERSION
=@GIT_HEAD_VERSION@
22 HAVE_OPENCL
=@HAVE_OPENCL@
24 if [ $keep = "yes" ]; then
26 mkdir
"$OUTDIR" ||
exit 1
28 if test "x$TMPDIR" = "x"; then
31 OUTDIR
=`mktemp -d $TMPDIR/ppcg.XXXXXXXXXX` ||
exit 1
33 CPPFLAGS
="-DPOLYBENCH_USE_C99_PROTO -DPOLYBENCH_DUMP_ARRAYS"
34 CPPFLAGS
="$CPPFLAGS $SIZE -I $DIR/utilities"
35 CFLAGS
="-lm --std=gnu99"
37 echo "Running tests in folder ${OUTDIR}"
45 if [ "x$ppcg_options" = "x" ]; then
46 ppcg_option_str
="none"
48 ppcg_option_str
=$ppcg_options
51 if [ "x$cc_options" = "x" ]; then
54 cc_option_str
=$cc_options
57 echo Test
: $ext, ppcg options
: $ppcg_option_str, CC options
: $cc_option_str
58 for i
in `cat $DIR/utilities/benchmark_list`; do
62 source_opt
="${OUTDIR}/$name.$ext.c"
63 prog_orig
=${OUTDIR}/$name.orig
${EXEEXT}
64 prog_opt
=${OUTDIR}/$name.
$ext${EXEEXT}
65 output_orig
=${OUTDIR}/$name.orig.out
66 output_opt
=${OUTDIR}/$name.
$ext.out
68 if [ $verbose = "yes" ]; then
69 echo .
/ppcg
$EXEEXT -I $DIR/$dir $DIR/$i \
70 $CPPFLAGS -o $source_opt $ppcg_options
72 .
/ppcg
$EXEEXT -I $DIR/$dir $DIR/$i $CPPFLAGS \
73 -o $source_opt $ppcg_options ||
exit
74 $CC -I $DIR/$dir $CPPFLAGS $DIR/$i -o $prog_orig \
75 $DIR/utilities
/polybench.c
$CFLAGS
76 $prog_orig 2> $output_orig
77 if [ $verbose = "yes" ]; then
78 echo $CC -I $DIR/$dir $CPPFLAGS $source_opt \
79 -o $prog_opt $DIR/utilities
/polybench.c \
82 $CC -I $DIR/$dir $CPPFLAGS $source_opt -o $prog_opt \
83 $DIR/utilities
/polybench.c
$CFLAGS $cc_options ||
exit
85 $prog_opt 2> $output_opt
86 cmp $output_orig $output_opt ||
exit
90 run_tests ppcg
--target=c
91 run_tests ppcg_live
"--target=c --no-live-range-reordering"
93 # Test OpenMP code, if compiler supports openmp
94 echo |
$CC -x c
- -fsyntax-only -fopenmp -Werror 1> /dev
/null
2> /dev
/null
96 if [ $OUT -eq 0 ]; then
97 run_tests ppcg_omp
"--target=c --openmp" -fopenmp
98 echo Introduced
`grep -R 'omp parallel' "${OUTDIR}" | wc -l` '"pragma omp parallel for"'
100 echo Compiler does not support OpenMP. Skipping OpenMP tests.
103 if [ $HAVE_OPENCL = "yes" ]; then
104 run_tests ppcg_opencl
"--target=opencl --opencl-no-use-gpu" \
105 "$srcdir/ocl_utilities.c -lOpenCL"
108 if [ $keep = "no" ]; then