Thank you all. I copied the lipopenblas.dll and other required dlls, and it compiles. I set up a small example for a quadratic matrix multiply but it throws an access violation. Probably an error in passing the parameters in C style. I tried constref an other variations but does not help. Can someone give me a hint how it should be done ?
{$mode objfpc}
Uses SysUtils;
Const Dim=1000;
Type
Matrix=Array[0..Dim-1, 0..Dim-1] of double;
int = longint;
Var
T0: TDateTime;
A0, B0, C0: Matrix;
A, B, C: pdouble;
procedure DGEMM (TRANSA,TRANSB: char;
m,n,k: int;
alpha: double;
A : pdouble;
LDA : int;
B : pdouble;
LDB : int;
beta : double;
C : pdouble;
LDC : int); cdecl; external 'libopenblas';
procedure Init (var M: Matrix);
Var i,j: dword;
Begin
For i:=0 to Dim-1 do for j:=0 to Dim-1 do M[i,j] := 1.0* (i+j);
End;
begin
Init (A0); B0:=A0; C0 := B0;
A := @A0; B := @B0; C := @C0;
T0 := Now;;
DGEMM ('n','n', 1000, 1000, 1000, 1.0, A, 1000, B, 1000, 0.0, C, 1000);
Writeln('Time elapsed: ',(Now-T0)*3600*24*1000:0:0,'ms.');
end.
EDIT: Wait. It works with the constref prefix for ALL parameters including the chars but except the pfloats.
Performance: Single core AMD Athlon, 32 bit BLAS: 7 times faster than the best pascal code in this thread (excluding engkins assembler version).