#include #include "mandel.hpp" // Reference: // https://en.wikipedia.org/wiki/Mandelbrot_set#Generalizations // https://people.sc.fsu.edu/~jburkardt/cpp_src/mandelbrot_openmp/mandelbrot_openmp.html // http://courses.cms.caltech.edu/cs11/material/dgc/lab4/ // https://github.com/gasparian/mandelbrot_cpp/blob/master/mandelbrot.cpp // https://csl.name/post/mandelbrot-rendering/ // http://linas.org/art-gallery/escape/smooth.html int H = 1000; int W = 1000; unsigned char* RGB = nullptr; void mandelbrot( const std::string& model, const unsigned num_threads, const unsigned num_rounds ) { std::cout << std::setw(12) << "size" << std::setw(12) << "runtime" << std::endl; for(int N = 100; N<=1000; N+=100) { W = N; H = N; double runtime {0.0}; RGB = static_cast(malloc (W * H * 3 * sizeof(unsigned char))); for(unsigned j=0; jcheck([] (const std::string& m) { if(m != "tbb" && m != "omp" && m != "tf") { return "model name should be \"tbb\", \"omp\", or \"tf\""; } return ""; }); CLI11_PARSE(app, argc, argv); std::cout << "model=" << model << ' ' << "num_threads=" << num_threads << ' ' << "num_rounds=" << num_rounds << ' ' << std::endl; mandelbrot(model, num_threads, num_rounds); }