[fpc-devel] Parallel Computing

Michael Schnell mschnell at lumino.de
Tue Dec 11 13:08:56 CET 2007


> For me the whole OpenMP approach is really artifical, I don't see a real
> use in real world code for it honestly
IMHO, it _would_ be nice to do a matrix multiplication like this (or 
according to proposal 2 with "parallel for"):

procedure MultMatrix(const mr, m1, m2: TMatrix;);
var 
  ll: integer;

  procedure MultLine (l: integer); parallel;
  var 
    i, j: Integer;
    sum: TMatrixElement;
  begin
    for i := 0 to length(m1)-1 do begin
      sum := 0;
      for j := 0 to length(m2)-1 do begin
        sum := sum + m1[l, j] * m2[j, i];
      end;
      mr[l, i] := sum;
    end;
  end;

begin
    for l = 0 to length(m1)-1 do begin    
      MultLine(l);
    end;
end;


But as said, I suppose implementation of a compiler that can handle this 
might be too much work for anybody to start with that project.

-Michael




More information about the fpc-devel mailing list