[fpc-devel] Parallel Computing

Florian Klaempfl florian at freepascal.org
Mon Nov 3 15:50:17 CET 2008


Michael Schnell schrieb:
> IMHO any technology that enables FPC to compile a loop like (using
> Oxygen syntax):
> 
> for parallel i := 0 to 10 do begin
>  a[i] := a[i] + b[i];
> end;
> 
> in a way that it on a multicore processor runs as fast as the
> appropriate GNU C construct:
> 
> #pragma ocm_parallel for
> for (i=0; i<=10; i++) {
>  a[i] = a[i] + b[i];
> };
> 
> would be fine.

Great and you really believe this accelerates a program? Starting a
thread takes a lot of time and such loops are usually memory throughput
bound.

Nice toy example without any real use.



More information about the fpc-devel mailing list