14 VERSION
=@GIT_HEAD_VERSION@
19 if [ $keep = "yes" ]; then
20 OUTDIR
="opencl_test.$VERSION"
21 mkdir
"$OUTDIR" ||
exit 1
23 if test "x$TMPDIR" = "x"; then
26 OUTDIR
=`mktemp -d $TMPDIR/ppcg.XXXXXXXXXX` ||
exit 1
33 echo Test with PPCG options
\'$ppcg_options\'
34 mkdir
${OUTDIR}/${subdir} ||
exit 1
35 for i
in $srcdir/tests
/*.c
; do
39 out_c
="${OUTDIR}/${subdir}/$name.ppcg.c"
40 out
="${OUTDIR}/${subdir}/$name.ppcg$EXEEXT"
41 options
="--target=opencl --opencl-no-use-gpu $ppcg_options"
42 functions
="$srcdir/tests/${name}_opencl_functions.cl"
43 if test -f $functions; then
44 options
="$options --opencl-include-file=$functions"
45 options
="$options --opencl-compiler-options=-I."
47 .
/ppcg
$EXEEXT $options $i -o "$out_c" ||
exit
48 $CC $CFLAGS -I "$srcdir" "$srcdir/ocl_utilities.c" -lOpenCL \
49 -I.
"$out_c" -o "$out" ||
exit
55 run_tests embed
--opencl-embed-kernel-code
57 for i
in $srcdir/examples
/*.c
; do
61 exe_ref
="${OUTDIR}/$name.ref$EXEEXT"
62 gen_ocl
="${OUTDIR}/$name.ppcg.c"
63 exe_ocl
="${OUTDIR}/$name.ppcg$EXEEXT"
64 output_ref
="${OUTDIR}/$name.ref.out"
65 output_ocl
="${OUTDIR}/$name.ppcg.out"
66 $CC $CFLAGS $i -o $exe_ref ||
exit
67 .
/ppcg
$EXEEXT --target=opencl
--opencl-no-use-gpu $i -o "$gen_ocl" || \
69 $CC $CFLAGS -I "$srcdir" "$srcdir/ocl_utilities.c" -lOpenCL \
70 "$gen_ocl" -o "$exe_ocl" ||
exit
71 $exe_ref > $output_ref ||
exit
72 $exe_ocl > $output_ocl ||
exit
73 cmp $output_ref $output_ocl ||
exit
76 if [ $keep = "no" ]; then