First, load the CUDALink application:
This sorts an input list:
| Out[2]= |  |
This sorts using the Greater ordering function:
| Out[1]= |  |
If input is CUDAMemory, then memory is returned as output:
| Out[1]= |  |
This sorts the input CUDAMemory:
| Out[2]= |  |
Note that the input and output memories are the same—that is, CUDASort sorts memory in place. Memory is retrieved using CUDAMemoryGet:
| Out[3]= |  |
works on vector types by sorting the data lexicographically. This generates random integer tuples:
| Out[1]= |  |
This loads the memory as
:
| Out[2]= |  |
This sorts the memory in place:
| Out[3]= |  |
This gets the memory into Mathematica:
| Out[4]= |  |
The result agrees with Mathematica:
| Out[5]= |  |