This is a simple demonstration of NVIDIA CUDA for GPU compute. This program generates an image of a
Mandelbrot set, where both axes span the interval [-2,2]. There are configurable constants in the
source.
Run the provided script build.sh. Ensure the latest CUDA toolchain including nvcc is installed. You
will also need to install the Git submodule for libbmp.
On any NVIDIA GPU-equipped system, run the resulting a.out program. It will generate a bitmap file
test.bmp containing the Mandelbrot set image. Note that some glitches may occur at sufficiently high
resolutions, and some programs may be unable to read such large bitmap files.
The following constants are configurable in the main source mand.cu:
NUM_ITERcontrols the number of iterations used for the convergence/divergence check.GRID_REScontrols the grid resolution and increments. For example, if the resolution is0.01, then moving one pixel to the right means moving 0.01 grid units to the right.- Do NOT touch
GRID_DIMas it is simply a re-expression ofGRID_RES.