Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

morphogen

A CUDA/C++ simulation engine for GPU-accelerated mathematical pattern generation and biological morphogenesis modeling.

Overview

  • 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.

Features

  • 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.

Architecture

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

Build and Run

Prerequisites

  • CMake 3.20+
  • C++20 compliant compiler (g++, clang++, or MSVC)
  • NVIDIA CUDA Toolkit (nvcc) for GPU acceleration (optional, CPU mode is enabled automatically when CUDA is not present)

Building with CMake

cmake -B build
cmake --build build

Running the Engine

./build/morphogen

Generated images will be exported to mandelbrot_cpu.ppm and mandelbrot_gpu.ppm.

About

simulating biological patterns found in the natural world

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages