MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Anyone get OpenCL working?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115127] Re: Anyone get OpenCL working?
  • From: Eric Gonzalez <eric.phys at gmail.com>
  • Date: Sat, 1 Jan 2011 04:25:05 -0500 (EST)

Mark,
I get this:

In[29]:== Needs["OpenCLLink`"];
In[30]:== OpenCLQ[]
Out[30]== True
In[31]:== OpenCLMersenneTwister[50]
Out[31]== {0.574857, 0.00872427, 0.847775, 0.322584, 0.324538, 0.602261, 0.136137, \
0.135025, 0.133819, 0.252149, 0.422101, 0.00828344, 0.136579, 0.0235735, \
0.78134, 0.511106, 0.287183, 0.517914, 0.013302, 0.498977, 0.914854, \
0.261335, 0.776273, 0.171692, 0.0321176, 0.888518, 0.662899, 0.0367858, \
0.13409, 0.386488, 0.283782, 0.585996, 0.115737, 0.510435, 0.750485, \
0.0551573, 0.635832, 0.0718225, 0.945798, 0.904204, 0.136578, 0.232421, \
0.421508, 0.767758, 0.0100673, 0.0925598, 0.792236, 0.47702, 0.290785, \
0.0448592}

however when trying this form this from the help: OpenCLLink/ref/OpenCLFunctionLoad
In[39]:== fun == OpenCLFunctionLoad[
  "__kernel void vecAdd( __global int * A, __global int * B, int length) {
      int index == get_global_id(0);
 
  	if (index < length)
  	   B[index] +== A[index];
    }", "vecAdd", {{_Integer, _, "Input"}, {_Integer}, _Integer}, {10}]

Out[39]== OpenCLFunction["<>", "vecAdd", {{_Integer, _, "Input"}, {_Integer}, _Integer}]

In[42]:== fun == OpenCLFunctionLoad[src,
  "myKernel", {{_Integer}, {_Integer}, _Integer, _Integer}, {16, 16}]

Out[42]== OpenCLFunction["<>", "myKernel", {{_Integer}, {_Integer}, _Integer, _Integer}]

doesn't work as other stuff I execute from the help...


On Nov 24, 2010, at 3:57 AM, Mark McClure wrote:

> OpenCLMersenneTwister[50]


  • Prev by Date: Re: Manually culling a list
  • Next by Date: Re: New to Mathematica, need help for Image Processing.
  • Previous by thread: Re: Default Lighting for Graphics3D
  • Next by thread: Re: New to Mathematica, need help for Image Processing.