CUDALink`
CUDALink`

CUDAFoldList

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

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

Details and Options

  • 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.

Examples

open allclose all

Basic Examples  (3)

First, load the CUDALink application:

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

CUDAFoldList operates on input CUDAMemory:

This folds the CUDAMemory as before:

The memory returned can be retrieved using CUDAMemoryGet:

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

Possible Issues  (1)

CUDAFoldList output does not contain the last element of FoldList:

Wolfram Research (2010), CUDAFoldList, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html.

Text

Wolfram Research (2010), CUDAFoldList, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html.

CMS

Wolfram Language. 2010. "CUDAFoldList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html.

APA

Wolfram Language. (2010). CUDAFoldList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html

BibTeX

@misc{reference.wolfram_2024_cudafoldlist, author="Wolfram Research", title="{CUDAFoldList}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html}", note=[Accessed: 05-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_cudafoldlist, organization={Wolfram Research}, title={CUDAFoldList}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html}, note=[Accessed: 05-October-2024 ]}