CWEB is a software which lets
you write documentation for your C-code. The difference to other kinds of documentation systems like
doxygen is that you do not document your written C-code but combine explaining your ideas, structuring
your ideas and coding your ideas into one process. This is called a
web and is processed through the two different tools from CWEB namely ctangle and
cweave. The first one extracts the C-code from the web-file, the latter one extracts
your documentation as TeX-file. I prefer writing LaTeX in my web-files. For this you need the
cweb-latex
package. The rest is straight forward, compile your code and (la)tex your documentation. A few good
reasons for using CWEB and a comprehensive source for the software can be found at
www.literateprogramming.com.
CUDA is a technique for very fast parallel computations on the graphics card. It's developed
by NVIDIA and what you need is an
appropriate graphics card
and the latest drivers and software which can be found at the
CUDA Zone. With these tools you
are ready to implement your parallel algorithms in a language which is more or less C. This
code is compiled with the nvcc which comes with the software package. Your
parallel method will consist of two parts, where the first one runs on the cpu of your machine
and initializes all
stuff like memory. This is called the host-code. From this host-code section
you start the computation which will run in parallel on the gpu (graphics processing unit)
of your graphics card. This parallel part for your gpu is called the device-code.
The goal is to have a filter which can be called in a Mathematica session with the built-in
Mathematica image type (to be clear: Mathematica Version 7). Since this is only a sampel I will
keep this as simple as possible. The first step is to implement the gaussian filter which
will work on an array of numbers. This array represents the pixel-values for the image.
The rest is explained in the documentation. So here is the
cudaRecursiveGaussianFilter.w, the
documentation as pdf-file and the
Mathematica notebook. Below you'll find the code as
pretty printed html/images.