|
| Radixsort () |
| Default constructor. More...
|
|
| Radixsort (const cl::Context &context, const cl::Device &device, const Type &keyType, const Type &valueType=Type()) |
| Constructor. More...
|
|
| Radixsort (const cl::Context &context, const cl::Device &device, const RadixsortProblem &problem) |
| Constructor. More...
|
|
| ~Radixsort () |
| Destructor.
|
|
void | enqueue (const cl::CommandQueue &commandQueue, const cl::Buffer &keys, const cl::Buffer &values,::size_t elements, unsigned int maxBits=0, const VECTOR_CLASS< cl::Event > *events=NULL, cl::Event *event=NULL) |
| Enqueue a sort operation on a command queue. More...
|
|
void | enqueue (cl_command_queue commandQueue, cl_mem keys, cl_mem values,::size_t elements, unsigned int maxBits=0, cl_uint numEvents=0, const cl_event *events=NULL, cl_event *event=NULL) |
|
void | setTemporaryBuffers (const cl::Buffer &keys, const cl::Buffer &values) |
| Set temporary buffers used during sorting. More...
|
|
void | setTemporaryBuffers (cl_mem keys, cl_mem values) |
|
void | setEventCallback (void(*callback)(const cl::Event &, void *), void *userData, void(*free)(void *)=NULL) |
| Set a callback function that will receive a list of all underlying events. More...
|
|
template<typename T > |
void | setEventCallback (const T &callback) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The provided function object will be passed a cl::Event. More...
|
|
void | setEventCallback (void(*callback)(cl_event, void *), void *userData, void(*free)(void *)=NULL) |
|
|
void | enqueue (cl_command_queue command_queue, cl_mem keys, cl_mem values,::size_t elements, unsigned int maxBits, cl_uint numEvents, const cl_event *events, cl_event *event, cl_int &err, const char *&errStr) |
|
void | setTemporaryBuffers (cl_mem keys, cl_mem values, cl_int &err, const char *&errStr) |
|
void | moveConstruct (Algorithm &other) |
| Constructs this by stealing the pointer from other.
|
|
detail::Algorithm * | moveAssign (Algorithm &other) |
| Sets this by stealing the pointer from other, and returning the previous value.
|
|
void | swap (Algorithm &other) |
| Swaps the pointers between this and other.
|
|
detail::Algorithm * | getDetail () const |
| Returns the embedded pointer.
|
|
detail::Algorithm * | getDetailNonNull () const |
| Returns the embedded pointer. More...
|
|
void | setDetail (detail::Algorithm *ptr) |
| Set the value of the embedded pointer. More...
|
|
Radix-sort interface.
One instance of this class can be re-used for multiple sorts, provided that
- calls to enqueue do not overlap; and
- their execution does not overlap.
An instance of the class is specialized to a specific context, device, and types for the keys and values. The keys can be any unsigned integral scalar type, and the values can be any built-in OpenCL type (including void
to indicate that there are no values).
The implementation is loosely based on the reduce-then-scan strategy described at http://code.google.com/p/back40computing/wiki/RadixSorting, but does not appear to be as efficient.
void clogs::Radixsort::setTemporaryBuffers |
( |
const cl::Buffer & |
keys, |
|
|
const cl::Buffer & |
values |
|
) |
| |
|
inline |
Set temporary buffers used during sorting.
These buffers are used if they are big enough (as big as the buffers that are being sorted); otherwise temporary buffers are allocated on the fly. Providing suitably large buffers guarantees that no buffer storage is allocated by enqueue.
It is legal to set either or both values to cl::Buffer()
to clear the temporary buffer, in which case enqueue
will revert to allocating its own temporary buffers as needed.
This object will retain references to the buffers, so it is safe for the caller to release its reference.