On 11/25/10 at 5:56 AM, gianluca.gorni@fastwebnet.it (Gianluca Gorni)
wrote:
>I have a 1 year old Apple MacBookPro. I installed the
>cudadriver_3.1.17_macos and then tried the first examples in the
>documentation:
>Needs["CUDALink`"] CUDAQ[]
>True
>randM = RandomReal[1, {3000, 3000}]; AbsoluteTiming[randM.randM;]
>{2.688389,Null}
>AbsoluteTiming[CUDADot[randM, randM];]
>{7.328353,Null}
>Quite a letdown. Did I do something wrong?
>CUDAInformation[] {1 -> {"Name" -> "GeForce 9400M",
No, you didn't do something wrong. The problem is the limited
capability of the GeForce 9400M. In particular, the GeForce
9400M doesn't support double precision. Using RandomReal you
have made a matrix of double precision reals, the default
machine precision number in Mathematica.
Change randM to a smaller matrix of integers. For example, on my
MacBookPro I get
In[6]:= randM = RandomInteger[{1, 10000}, {500, 500}];
In[7]:= AbsoluteTiming[randM.randM;]
Out[7]= {2.030581,Null}
In[8]:= AbsoluteTiming[CUDADot[randM, randM];]
Out[8]= {0.036325,Null}
|
|
0
|
|
|
|
Reply
|
Bill
|
11/26/2010 10:26:51 AM |
|
On Nov 26, 5:26 am, Bill Rowe <readn...@sbcglobal.net> wrote:
> On 11/25/10 at 5:56 AM, gianluca.go...@fastwebnet.it (Gianluca Gorni)
> wrote:
>
> >I have a 1 year old Apple MacBookPro. I installed the
> >cudadriver_3.1.17_macos and then tried the first examples in the
> >documentation:
> >Needs["CUDALink`"] CUDAQ[]
> >True
> >randM = RandomReal[1, {3000, 3000}]; AbsoluteTiming[randM.randM;]
> >{2.688389,Null}
> >AbsoluteTiming[CUDADot[randM, randM];]
> >{7.328353,Null}
> >Quite a letdown. Did I do something wrong?
> >CUDAInformation[] {1 -> {"Name" -> "GeForce 9400M",
>
> No, you didn't do something wrong. The problem is the limited
> capability of the GeForce 9400M. In particular, the GeForce
> 9400M doesn't support double precision. Using RandomReal you
> have made a matrix of double precision reals, the default
> machine precision number in Mathematica.
I'm facing the same type-matching problem in OpenCL on a comparable
(float, no double) GeForce 8600M GT.
There has to be some some set of Mathematica-to-OpenCL-and-back
functions to do the job. The docs for MathLink (guide/
MathLinkCFunctionsForExchangingReals) show a set of functions for
doing the conversion in the C program, but are these functions headed
in the OpenCLFunctionLoad[] form too?
TIA,
Fred Klingener
|
|
0
|
|
|
|
Reply
|
Fred
|
11/27/2010 8:37:55 AM
|
|
|
1 Replies
362 Views
(page loaded in 0.02 seconds)
|