###################################################################################

This is a set of benchmarks for using PENCIL in the image processing problem domain

###################################################################################

## Building ##

To build the CARP-Benchmarks, you need:
- A working OpenCL driver.
- PPCG compiler
	Refer to PPCG readme how to build.
- The following packages needs to be installed (at least on Ubuntu 13.10):
	libboost-filesystem-dev libboost-serialization-dev libboost-system-dev (or, full Boost: libboost-all-dev)
	libtbb-dev
	build-essential
	p7zip
	cmake
- An OpenCV build:
	Tested with 2.4.9.1
	Download OpenCV
	    git clone https://github.com/Itseez/opencv.git
	Checkout 2.4.9.1 or newer:
	    cd opencv
	    git checkout 2.4.9.1
	    cd ..
	Configure build with CMake:
	    mkdir opencv-build
	    cd opencv-build
	    cmake ../opencv -DWITH_TBB=ON -DENABLE_AVX=ON -DENABLE_SSE41=ON -DENABLE_SSE42=ON  -DENABLE_SSSE3=ON -DENABLE_SSE3=ON
	  (Warning, if your CPU or OS does not support AVX/SSEx instruction sets, do not add the corresponding compile switches)
	    make all -j12
	Make sure the necessary modules are to be built - CMake should print a (long) status with a "To be built:" list, it should contain core, ocl and highgui (plus their dependencies)
	Optionally, install it as a system library:
	    sudo make install
	
	Alternatively, you can try newer versions that might have fixed the issue in the patch, but those versions are not tested.
- Create makefile.in root directory based on makefile.in.base, and add paths to the various libraries
	ocl_utilities.c, pencil-headers and OpenCL SDK paths needs to be added, Boost, OpenCV and TBB paths needs to be changed if not installed to the default dir (or not using Ubuntu)
	You can also add extra compiler and linker flags
- Build benchmark:
	cd repository_root_path
	make all -j12

## Running ##

- Change to the build directory.
- Run ppcg_test_*
	Each executable runs a different operator with all three (C++, OpenCL, PENCIL) implementations.
	Results are cross-checked, and if there is no difference (within a small allowed precision error), total times are reported at the end.
(- the executables test_* run the same code, but using only C compiler; measuring Pencil-as-C compilation performance. Useful to check execution if there is a problem running the PPCG built version.)