Parallel loop iterations: gfor. More...

Modules

 local
 Create local copy of variable for iteration.
 
 gfor
 Do not use this function directly; see GFOR: Parallel For-Loops.
 

Detailed Description

Parallel loop iterations: gfor.

See tutorial for usage and examples.

Run an FFT on every 2D slice of a volume sequentially with a for-loop or in parallel (faster) with a gfor-loop:

for (int i = 0; i < N; ++i)
A(span,span,i) = fft2(A(span,span,i)); // runs each FFT in sequence
gfor (array i, N)
A(span,span,i) = fft2(A(span,span,i)); // runs N FFTs in parallel

Use local() to declare a variable or expression local for each iteration (see more).

See Also
local()
Tutorial on GFOR