Giter Site home page Giter Site logo

mandelbrot's Introduction

Mandelbrot

This project renders the Mandelbrot fractal to experiment with parallelism.

Compile

Compile for CPU using standard library threads.

g++ -std=c++11 -fPIC -o libmandelbrot.so --shared mandelbrot-threads.cpp

Compile for GPU using CUDA.

nvcc --compiler-options '-fPIC' -o libmandelbrot.so --shared mandelbrot.cu

Compile for CPU using OpenACC.

pgc++ -std=c++11 -fPIC -o libmandelbrot.so -shared -ta=multicore mandelbrot-openacc.cpp

Compile for GPU using OpenACC.

pgc++ -std=c++11 -fPIC -o libmandelbrot.so -shared -ta=nvidia mandelbrot-openacc.cpp

Run

Benchmark rendering and save the image to JPEG.

python3 benchmark.py

Explore the fractal interactively.

python3 explore.py

Benchmarks

Best render time of 5 attempts at different resolutions. CPU: Intel i7-8700, GPU: NVIDIA GTX 1060.

CPU (threads) GPU (CUDA) CPU (OpenACC) GPU (OpenACC)
1080p 25.7 ms 6.2 ms 24.5 ms 5.8 ms
4k 103.4 ms 22.0 ms 96.6 ms 22.6 ms
16k 1.614 s 269.7 ms 1.519 s 287.9 ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.