CUDAFoldList[f,x,{a,b,…}]
gives {x,f[x,a],f[f[x,a],b],…}.
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:
Needs["CUDALink`"]This folds an input list with the Plus operator and initial value 0:
CUDAFoldList[Plus, 0, Range[10]]CUDAFoldList operates on input CUDAMemory:
mem = CUDAMemoryLoad[RandomReal[1, 10]]This folds the CUDAMemory as before:
res = CUDAFoldList[Plus, 0, mem]The memory returned can be retrieved using CUDAMemoryGet:
CUDAMemoryGet[res]Compared to FoldList, only a few operations are supported by CUDAFold:
CUDAFoldList[#, 0, Range[10]]& /@ {Plus, Minus, Min, Max, Times}Possible Issues (1)
CUDAFoldList output does not contain the last element of FoldList:
CUDAFoldList[Plus, 0, Range[3]]FoldList[Plus, 0, Range[3]]相关指南
-
▪
- CUDALink
文本
Wolfram Research (2010),CUDAFoldList,Wolfram 语言函数,https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html.
CMS
Wolfram 语言. 2010. "CUDAFoldList." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html.
APA
Wolfram 语言. (2010). CUDAFoldList. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html 年
BibTeX
@misc{reference.wolfram_2026_cudafoldlist, author="Wolfram Research", title="{CUDAFoldList}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html}", note=[Accessed: 11-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_cudafoldlist, organization={Wolfram Research}, title={CUDAFoldList}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAFoldList.html}, note=[Accessed: 11-August-2026]}