This project is a CUDA/C implementation of a Mandelbrot Set viewer. If you're not familiar with the Mandelbrot Set: it's a beautiful mathematical object (just look at the samples). A passion project.
I've had a fascination for the Mandelbrot Set for a while now - which is why I created the pybrot project using Python during my 2018 High School summer break; I learned a bunch and was pretty happy with the end result.
Unfortunately, because it was written in Python, pybrot wasn't particularly fast. For that reason, I've wanted to implement a mandelbrot viewer/renderer in C ever since I finished the original Python project.
And so this project was born. I wanted to see how much I could improve on performance if I chose a programming language that was closer to the metal.
Hence why I created this project: a Mandelbrot viewer written in C / CUDA. The results were satisfactory: this implementation is roughly five hundred times faster than my pybrot implementation. Whoo!
This project taught me:
- the basics of GPU computing using CUDA; and
- how to actually use the fantastic C programming language; and
- most importantly: how pointers work.
The classic Mandelbrot Set image.
The crest between two of the Mandelbrot's "Bulbs".
Don't stare at this one too long.
One of the Manelbrot's many self-contained duplicates.
Beautiful, isn't it?
- Basic controls for viewing the mandelbrot set
- Speedy performance thanks to NVIDIA GPU acceleration. Also works on systems without an NVIDIA GPU.
- Performance test to check performance of (future) optimisations.
- Pan image: arrow keys (up, down, right, left)
- Zoom in/out:
+
and-
keys respectively - Increase maximum iterations:
[
- Do a performance test and print results to console:
e
key - Quit:
esc
To build this projects: the following software is required.
- Visual Studio 19
- The CUDA Toolkit
Open the solution in Visual Studio, and build. (Build > Build Solution
)