cancel
Showing results for 
Search instead for 
Did you mean: 

Intel Math Kernel Library

Kamil_Jaskiewic
New Contributor
Received: by 10.204.9.23 with SMTP id j23mr5572299bkj.162.1252962617248; Mon,
14 Sep 2009 14:10:17 -0700 (PDT)
From: =?ISO-8859-2?Q?Kamil_Ja=B6kiewicz?=
Date: Mon, 14 Sep 2009 23:09:57 +0200
Message-ID: <9eb295310909141409q34fb7b40k75941f75ca09745f@mail.gmail.com>
Subject: Intel Math Kernel Library
To: personal-kdbplus@googlegroups.com
X-Google-Approved: charlie@kx.com via web at 2009-09-14 21:21:28

Hi,

I was wondering if extending kdb+ with external libraries can be
effective. To check it I've written simple extension based on trial
version of Intel Math Kernel Library which provides vector random
number generators (brief overview of the library:
http://software.intel.com/sites/products/documentation/hpc/mkl/vsl/vslnotes.pdf).

The results are quite good, it shows that it runs faster when we
generate vectors of random numbers, MKL is faster for 500 integers and
100 doubles generated with uniform distribution. Of course it might
depend on used basic generator (see overview).

Some results for normal distribution:
gen:{[n] sqrt[-2*log n?1.0]*cos[2*3.14159265358979*n?1.0]}

q)\t do[10000;.rnd.Gauss[100;0;1]] //mean=0; sigma=1
46
q)\t do[10000;gen[100]]
234
q)\t do[1000;Gauss[10000;0;1]]
312
q)\t do[1000;gen[10000]]
2171

Unfortunatelly the resulting q extension linked statically has quite
big size: 4.1MB (w32 version).

More results can be found here (Excel spreadsheet):
http://www.sendspace.com/file/960bdi

Kamil.

0 REPLIES 0