OpenCLFunction

OpenCLFunction[args]
represents a function loaded using OpenCLFunctionLoad.

更多信息更多信息

  • The OpenCLLink application must be loaded using Needs["OpenCLLink`"].
  • is returned by OpenCLFunctionLoad.
  • An object can be used the same way as a pure function.
  • The function represented by runs in the same process as the Mathematica kernel.
  • The function represented by is unloaded when the Mathematica kernel exits.
  • On launch, if the number of threads is not specified (as an extra argument to the ), then the dimension of the element with largest rank and dimension is chosen. For images, the rank is set to 2.
  • On launch, if the number of threads is not a multiple of the block dimension, then it is incremented to be a multiple of the block dimension.

范例范例打开所有单元关闭所有单元

基本范例 (1)基本范例 (1)

First, load the OpenCLLink application:

In[1]:=
Click for copyable input

This loads a function from OpenCL source:

In[2]:=
Click for copyable input
Out[2]=

This calls the function:

In[3]:=
Click for copyable input
Out[3]=

This finds information about the function:

In[4]:=
Click for copyable input
Out[4]=
New to Mathematica? Find your learning path »
Have a question? Ask support »