Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

MKL license

Sergey_F_1
Beginner
1,310 Views

I've got academic license for MKL, but we produce also commercial software in witch I would like to use MKL (only Redistributions). Can I use it free or must pay for additional license? If the last, can I buy only Redistributions​, cause I don't need your compilers (I use Delphi)?

0 Kudos
9 Replies
Gennady_F_Intel
Moderator
1,310 Views

Sergey, in this case you have to purchase the commercial license. I will joint you with our business development manager via separate email to give your some steps you need to do.

0 Kudos
Gerardo_G_
Beginner
1,310 Views

Hi

I know this is out of the post’s scope but I noticed you (the original poster) are using Delphi. I’ve been trying to link a simple console application to the MKL SDL but I haven’t managed to succeed yet (I’m not an expert on Delphi). Anyway, I’m trying to use MKL PARDISO but I don’t get any results, the output vector is not modified after calling the function. In my limited experience, I believe there must be a problem in the way I’m loading the function from the SDL. Below I have included the code I’m using to declare the function and also part of the console application code (I’ve left a lot of stuff out just to save space). In this example if I don’t initialize “x”, I get all zeros but if I do, the vector is not changed. Any help will be much appreciated (sorry to post this here but other delphi related posts are over 5 years old and I don't know if it's worth to create a new post just for this).

unit IntelMKL;

interface

uses
  Windows,
  Wintypes,
  WinProcs,
  SysUtils,
  Classes;


function PARDISO(var pt:array of Pointer; var maxfct, mnum, mtype, phase, n:Integer; var a:array of Double; var ia,ja:array of Integer; var perm, nrhs:Integer; var iparm:array of Integer; var msglvl:Integer; var b: Array of Double; var x: Array of Double; var error:Integer): Pointer; stdcall; external 'mkl_rt.dll' name 'PARDISO';
function MKL_Set_Num_Threads_Local(nt: Integer): Integer; stdcall; external 'mkl_rt.dll' name 'MKL_Set_Num_Threads_Local';
function MKL_Set_Num_Threads(nt: Integer): Pointer; stdcall; external 'mkl_rt.dll' name 'MKL_Set_Num_Threads';
function MKL_Set_Dynamic(nt: Integer): Pointer; stdcall; external 'mkl_rt.dll' name 'MKL_Set_Dynamic';

implementation


end.

 

var
 a,b,x,ddum: array of Double;
 ia,ja,iparm: array of Integer;
 pt : array of Pointer;
 n, mtype, nrhs, maxfct, mnum, phase, error, msglvl, idum, i, nthreads, dynthreads: Integer;
 
begin

  setLength(a,18);
  setLength(ja,18);
  setLength(ia,9);
  setLength(b,8);
  setLength(x,8);
  setLength(ddum,1);
  setLength(pt,64);
  setLength(iparm,64);
 
  phase := 13;
  PARDISO(pt, maxfct, mnum, mtype, phase, n, a, ia, ja, idum, nrhs, iparm, msglvl, b, x, error);
  
  for i := 1 to n do
      Writeln('x['+IntToStr(i-1)+'] ='+FloatToStr(x[i-1])); 
 
end

Regards

Gerardo

0 Kudos
Sergey_F_1
Beginner
1,310 Views

Hello!
I have used only simple LAPACK functions of 1-3 level. All of them work fine exclude ones with wml extension (now I try to solve the problem). If you are interested in this point I can send you some examples.

 

0 Kudos
Gerardo_G_
Beginner
1,310 Views

It would be nice if you could send me your examples. I've been trying other stuff, like defining all function parameters as pointers (I saw someone do it in an example) but haven't made any progress. Thanks in advance for your help!

Regards

0 Kudos
Sergey_F_1
Beginner
1,310 Views

Not earlier then on Tuesday (little vacation).

0 Kudos
Gerardo_G_
Beginner
1,310 Views

Sure, no problem! Enjoy your vacation.

0 Kudos
Sergey_F_1
Beginner
1,310 Views
//If You need more examples, please let me now.

unit MKL1;

interface

const IntelDLL = 'mkl_intel_thread.DLL' ;

procedure saxpy(var n:int64; var alpha:single; var x:single; var incx:int64; var y:single; var incy:int64); CDecl ;

implementation

procedure saxpy ; CDecl ; external IntelDLL name 'mkl_blas_saxpy' ;


//Test: multiplication of array by 10.
// Tested for 64-bit applications;
// for 32-bit's you should somewhere use "integer" type instead of "int64" (change if doesn't work).
// For both it's possible to use conditional compilation with symbol "win64"

  var
      i,N,incx:int64;
      X:single;
      A,Y:array[1..100] of single;
  begin
  N:=100; incx:=1;
  for i:=1 to N do A:=i; X:=10;

  saxpy(N,X,A[1],incx,Y[1],incx);

  end.

 

0 Kudos
Gerardo_G_
Beginner
1,310 Views

Thanks for the example! I managed to make mine work based on yours. Thanks again, you are a real lifesaver.

Regards

 

0 Kudos
Sergey_F_1
Beginner
1,310 Views

I'm very glad to help you :)

0 Kudos
Reply