diff --git a/day4/examples/mandelbrot1.cc b/day4/examples/mandelbrot1.cc index 03e5e1883387499aaab5eca657c1e4c85ebbc491..81e9087cc84cfeba615590a682b1d82f49cac285 100644 --- a/day4/examples/mandelbrot1.cc +++ b/day4/examples/mandelbrot1.cc @@ -1,4 +1,4 @@ -#include "CountingIterator.hh" +#include <thrust/iterator/counting_iterator.h> #include <algorithm> #include <chrono> #include <complex> @@ -8,6 +8,9 @@ #include <string> #include <vector> +template <class T> +using CountingIterator = thrust::counting_iterator<T>; + void save_pgm(std::string filename, size_t width, size_t height, std::vector<unsigned char> data) { @@ -29,7 +32,7 @@ auto mandel(size_t width, size_t height) -> std::vector<unsigned char> double aspect = static_cast<double>(width) / height; std::vector<unsigned char> ans(width * height, 0); CountingIterator<size_t> beg { 0 }, end { width * height }; - std::transform(std::execution::par, beg, end, + std::transform(std::execution::par_unseq, beg, end, ans.begin(), [=](size_t index) { double myrow = index / width; double mycol = index % width;