CUDALink`
CUDALink`

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.

Details and Options

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDASort works on general vector types such as "Float", "Double", .
  • CUDASort does not work on symbolic input.
  • CUDASort is equivalent to Sort.
  • The value for op can be either Less or Greater.

Examples

open allclose all

Basic Examples  (4)

First, load the CUDALink application:

This sorts an input list:

This sorts using the Greater ordering function:

If input is CUDAMemory, then memory is returned as output:

This sorts the input CUDAMemory:

Note that the input and output memories are the samethat is, CUDASort sorts memory in place. Memory is retrieved using CUDAMemoryGet:

CUDASort works on vector types by sorting the data lexicographically. This generates random integer tuples:

This loads the memory as "Integer2":

This sorts the memory in place:

This gets the memory into the Wolfram Language:

The result agrees with the Wolfram Language:

Possible Issues  (1)

CUDASort only works on vectors:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2023_cudasort, organization={Wolfram Research}, title={CUDASort}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDASort.html}, note=[Accessed: 19-March-2024 ]}