Looking for writing parallel foreach kind of statement for nested for-loops

Sparsh Mittal sparsh0mittal at gmail.com
Sat Feb 9 17:22:21 PST 2013


> for(int i=1; i< N; i++)    <==>    foreach(i; iota(1, N))
> so you can use:  foreach(i; parallel(iota(1, N))) { ... }
Thanks a lot. This one divides the x-cross-y region by rows. 
Suppose dimension is 8*12 and 4 parallel threads are there, so 
current method is dividing by 2*12 to each of 4 threads.

The current reply answers my question, but I was just curious. 
Can we have a method which divides the 2d region as follows: 8*12 
divided into 4*6 to each of 4 threads.







More information about the Digitalmars-d-learn mailing list