I presented the HIPAcc framework as an example for an embedded domain specific language (DSL). The source coded defined in the DSL gets compiled by a source-to-source-compiler, to map functions defined in the DSL to OpenCL or CUDA API calls.
A simple image kernel example as an example for the HIPAcc framework, which let you define image processing kernels in a domain specific language. The written code gets compiled into target specific GPGPU code (CUDA or OpenCL).
The kernel()
function of SimpleKernel
implements a simple mean filter, which will blur the input image. The width of the kernel mask can be changed by changing filter_width
- Download the HIPAcc framework, build and install it (github repo of HIPAcc). Additional install instructions can be found on hipacc-lang.org
git clone https://github.com/GuidoSchmidt/hipacc-example.git
cd hipacc-example
make
make run