19 VERSION
=@GIT_HEAD_VERSION@
22 HAVE_OPENCL
=@HAVE_OPENCL@
23 HAVE_OPENMP
=@HAVE_OPENMP@
25 if [ $keep = "yes" ]; then
27 mkdir
"$OUTDIR" ||
exit 1
29 if test "x$TMPDIR" = "x"; then
32 OUTDIR
=`mktemp -d $TMPDIR/ppcg.XXXXXXXXXX` ||
exit 1
34 CPPFLAGS
="-DPOLYBENCH_USE_C99_PROTO -DPOLYBENCH_DUMP_ARRAYS"
35 CPPFLAGS
="$CPPFLAGS $SIZE -I $DIR/utilities"
36 CFLAGS
="-lm --std=gnu99"
38 echo "Running tests in folder ${OUTDIR}"
46 if [ "x$ppcg_options" = "x" ]; then
47 ppcg_option_str
="none"
49 ppcg_option_str
=$ppcg_options
52 if [ "x$cc_options" = "x" ]; then
55 cc_option_str
=$cc_options
58 echo Test
: $ext, ppcg options
: $ppcg_option_str, CC options
: $cc_option_str
59 for i
in `cat $DIR/utilities/benchmark_list`; do
63 source_opt
="${OUTDIR}/$name.$ext.c"
64 prog_orig
=${OUTDIR}/$name.orig
${EXEEXT}
65 prog_opt
=${OUTDIR}/$name.
$ext${EXEEXT}
66 output_orig
=${OUTDIR}/$name.orig.out
67 output_opt
=${OUTDIR}/$name.
$ext.out
69 if [ $verbose = "yes" ]; then
70 echo .
/ppcg
$EXEEXT -I $DIR/$dir $DIR/$i \
71 $CPPFLAGS -o $source_opt $ppcg_options
73 .
/ppcg
$EXEEXT -I $DIR/$dir $DIR/$i $CPPFLAGS \
74 -o $source_opt $ppcg_options ||
exit
75 $CC -I $DIR/$dir $CPPFLAGS $DIR/$i -o $prog_orig \
76 $DIR/utilities
/polybench.c
$CFLAGS
77 $prog_orig 2> $output_orig
78 if [ $verbose = "yes" ]; then
79 echo $CC -I $DIR/$dir $CPPFLAGS $source_opt \
80 -o $prog_opt $DIR/utilities
/polybench.c \
83 $CC -I $DIR/$dir $CPPFLAGS $source_opt -o $prog_opt \
84 $DIR/utilities
/polybench.c
$CFLAGS $cc_options ||
exit
86 $prog_opt 2> $output_opt
87 cmp $output_orig $output_opt ||
exit
91 run_tests ppcg
"--target=c --tile"
92 run_tests ppcg_live
"--target=c --no-live-range-reordering --tile"
94 # Test OpenMP code, if compiler supports openmp
95 if [ $HAVE_OPENMP = "yes" ]; then
96 run_tests ppcg_omp
"--target=c --openmp" -fopenmp
97 echo Introduced
`grep -R 'omp parallel' "${OUTDIR}" | wc -l` '"pragma omp parallel for"'
99 echo Compiler does not support OpenMP. Skipping OpenMP tests.
102 if [ $HAVE_OPENCL = "yes" ]; then
103 run_tests ppcg_opencl
"--target=opencl --opencl-no-use-gpu" \
104 "-I $srcdir $srcdir/ocl_utilities.c -lOpenCL"
107 if [ $keep = "no" ]; then