CUDASort[vec]
sorts the input vector.
CUDASort[mem]
sorts CUDAMemory in place.
CUDASort[vec,op]
sorts input with respect to the ordering function op.
CUDASort
CUDASort[vec]
sorts the input vector.
CUDASort[mem]
sorts CUDAMemory in place.
CUDASort[vec,op]
sorts input with respect to the ordering function op.
范例
打开所有单元 关闭所有单元基本范例 (4)
First, load the CUDALink application:
Needs["CUDALink`"]CUDASort[Reverse@Range[100]]This sorts using the Greater ordering function:
CUDASort[Range[100], Greater]If input is CUDAMemory, then memory is returned as output:
mem = CUDAMemoryLoad[RandomReal[1, 10]]This sorts the input CUDAMemory:
res = CUDASort[mem]Note that the input and output memories are the same—that is, CUDASort sorts memory in place. Memory is retrieved using CUDAMemoryGet:
Row[{
CUDAMemoryGet[mem],
CUDAMemoryGet[res]
}]CUDASort works on vector types by sorting the data lexicographically. This generates random integer tuples:
lst = RandomInteger[10, {10, 2}]This loads the memory as "Integer2":
mem = CUDAMemoryLoad[lst, "Integer32[2]"]This sorts the memory in place:
CUDASort[mem]This gets the memory into the Wolfram Language:
CUDAMemoryGet[mem]The result agrees with the Wolfram Language:
Sort[lst]相关指南
-
▪
- CUDALink
文本
Wolfram Research (2010),CUDASort,Wolfram 语言函数,https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html.
CMS
Wolfram 语言. 2010. "CUDASort." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html.
APA
Wolfram 语言. (2010). CUDASort. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html 年
BibTeX
@misc{reference.wolfram_2026_cudasort, author="Wolfram Research", title="{CUDASort}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html}", note=[Accessed: 09-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_cudasort, organization={Wolfram Research}, title={CUDASort}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html}, note=[Accessed: 09-September-2026]}