c++ - OpenMP vs C++11 threads -
Take approximately 50 seconds to execute C ++ 11 threads in the following example, but OMP threads only 5 seconds no idea Why? (I can assure you that if you are doing actual work instead of doNothing , or if you do it in another order, etc.) I am also on a 16 core machine. I < / P>
#include & lt; Iostream & gt; # Include & lt; Omp.h & gt; # Include & lt; Chrono & gt; #include & lt; Vector & gt; #include & lt; Thread & gt; using namespace std; Zero doNothing () {} int run (int algorithm torran) {auto startTime = std :: chrono :: system_clock :: now (); For (Int j = 1; J & lt; 100000; ++ J) (if (Algorithm TORU == 1) {Vector
Comments
Post a Comment