[fpc-pascal] Common OpenMP syntax?
Alexandre Leclerc
alexandre.leclerc at gmail.com
Thu Jul 20 14:31:58 CEST 2006
2006/7/20, Steve Williams <stevewilliams at kromestudios.com>:
> Florian Klaempfl wrote:
> > I'am currently thinking about implementing OpenMP support in FPC.
> > However, there is currently (to my knowledge) no pascal syntax defined
> > for OpenMp support. Do you think we can find a common syntax to simplify
> > things for users? I've some ideas how it be done, but I want to hear
> > other ideas first so they are maybe better if they aren't influenced by
> > my ideas :)
> >
> > I started also a wiki page about it
> > http://www.freepascal.org/wiki/index.php/OpenMP_support where ideas can
> > be written down and shared.
> >
>
>
> I would suggest something along the lines of the C/C++ implementation,
> but using the Pascal form of compiler directives.
>
> Using some of the documented examples in the v2.5 spec:
>
> Example A.1.1:
> procedure a1(n: Integer; a: PSingleArray; b: PSingleArray);
> var
> i: Integer;
> begin
> {$omp parallel for}
> for i := 1 to n - 1 do
> b^[i] := (a^[i] + a^[i - 1]) / 2.0;
> end;
I fear this just looks like a terrible stranger-outsider pach to a
superbe language. :) If fpc peoples want to implement new language
syntax... may it be pascal-like and good looking. At least in the
previous example, a closing block would be required... as for myself:
{$omp parallel for}
...
[$omp end}
The same for the other examples. So if the directive is not understood
by the compiler, it becomes standard code without any problems. For
me, the best approach would be an unit to be used; not language
implementation. (In that unit you could have ugly compiler magic if
you want, but at least, when using this technology, it would be much
more like using a standard class or set of procedures.)
Any-way; Reagards.
--
Alexandre Leclerc
More information about the fpc-pascal
mailing list