A CUDA/C++ simulation engine for GPU-accelerated mathematical pattern generation and biological morphogenesis modeling.
- Developing a CUDA/C++ simulation engine for GPU-accelerated mathematical pattern generation, currently supporting Mandelbrot fractal generation.
- Implemented a CUDA kernel mapping individual pixels to GPU threads to parallelize fractal computation across 2D thread blocks and grids.
- Built-in CPU verification engine and Netpbm PPM image export pipeline for comparing and validating numerical outputs between host and device.
- GPU-Accelerated Fractal Computation: High-performance 2D CUDA kernel computing escape-time iterations per pixel concurrently.
- Dual CPU & GPU Execution: Includes both a host CPU reference implementation and an NVIDIA CUDA GPU implementation for verification.
- Mathematical Modeling: Supports ODE integration and modular mathematical pattern generation engines.
- PPM Image Export: Direct binary PPM image rendering for visualizing generated patterns without heavy external dependencies.
morphogen/
├── CMakeLists.txt # CMake build configuration with CUDA detection
├── main.cpp # Driver program & benchmarks
├── include/
│ └── models/
│ ├── mandelbrot.hpp # Mandelbrot engine interface & configuration
│ └── ode.hpp # ODE model interface
└── src/
└── models/
├── mandelbrot.cpp # Mandelbrot CPU implementation, PPM exporter & host wrapper
├── mandelbrot_cuda.cu # CUDA kernel mapping pixels to GPU threads
└── ode.cpp # ODE model numerical solver
- CMake 3.20+
- C++20 compliant compiler (
g++,clang++, orMSVC) - NVIDIA CUDA Toolkit (
nvcc) for GPU acceleration (optional, CPU mode is enabled automatically when CUDA is not present)
cmake -B build
cmake --build build./build/morphogenGenerated images will be exported to mandelbrot_cpu.ppm and mandelbrot_gpu.ppm.