

Auto-parallelizer: #pragma loop - boas

I just discovered that MSVC++ can automatically run each iteration of a loop in parallel in separate threads.  Add &quot;#pragma loop(hint_parallel(8))&quot; and &quot;#pragma loop(ivdep)&quot; before the loop, and compile with the &#x2F;Qpar option.  This simple change sped up my cryoablation simulation code by 4x.
======
boas
A lot of the radiology software that I write involves iterating over a 3D
grid. The auto-parallelizer lets you easily process each 2D slice on a
different processor core. My laptop has 2 cores x 2 hyperthreads per core = 4
virtual cores, so 4x speedup.

------
dalke
You might also be interested in OpenMP, which does similar things for more
compilers than MSVC++.

~~~
boas
Thanks! I'll look into this. I also use g++ on Linux, so a cross-platform
solution would be nice.

