CUDALink`
CUDALink`

CUDAFoldList

CUDAFoldList[f,x,{a,b,}]

gives {x,f[x,a],f[f[x,a],b],}.

更多信息和选项更多信息
  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAFoldList works only on general vectors such as "Float", "Double", .
  • CUDAFoldList does not work on fixed vector structure types like "Float[2]", "Integer32[2]", .
  • CUDAFoldList does not work on symbolic input.
  • CUDAFoldList is similar to FoldList.
  • The value for f can be either Max, Min, Plus, Minus, or Times.
  • 范例

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

    基本范例  (3)

    First, load the CUDALink application:

    In[1]:=
    Click for copyable input

    This folds an input list with the Plus operator and initial value 0:

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

    CUDAFoldList operates on input CUDAMemory:

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

    This folds the CUDAMemory as before:

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

    The memory returned can be retrieved using CUDAMemoryGet:

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

    Compared to FoldList, only a few operations are supported by CUDAFold:

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

    Possible Issues  (1)

    参见

    FoldList  CUDAFold  CUDATotal  CUDAMap  CUDAFunctionLoad

    教程