Bolt
1.3
C++ template library with support for OpenCL
|
Functions | |
template<typename RandomAccessIterator > | |
void | bolt::cl::sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="") |
This version of sort returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements. The routine arranges the elements in an ascending order. RandomAccessIterator's value_type must provide operator < overload. | |
template<typename RandomAccessIterator > | |
void | bolt::cl::sort (RandomAccessIterator first, RandomAccessIterator last, const std::string &cl_code="") |
template<typename RandomAccessIterator , typename StrictWeakOrdering > | |
void | bolt::cl::sort (bolt::cl::control &ctl, RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="") |
sort returns the sorted result of all the elements in the inputIterator between the the first and last elements using the specified binary_op. You can arrange the elements in an ascending order, where the binary_op is the less<>() operator. This version of sort takes a bolt::cl::control structure as a first argument and compares objects using functor object defined by StrictWeakOrdering . | |
template<typename RandomAccessIterator , typename StrictWeakOrdering > | |
void | bolt::cl::sort (RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp, const std::string &cl_code="") |
void bolt::cl::sort | ( | bolt::cl::control & | ctl, |
RandomAccessIterator | first, | ||
RandomAccessIterator | last, | ||
const std::string & | cl_code = "" |
||
) |
This version of sort
returns the sorted result of all the elements in the RandomAccessIterator
between the the first and last elements. The routine arranges the elements in an ascending order. RandomAccessIterator's
value_type must provide operator < overload.
The sort
operation is analogus to the std::sort function. See http://www.sgi.com/tech/stl/sort.html
RandomAccessIterator | Is a model of http://www.sgi.com/tech/stl/RandomAccessIterator.html, RandomAccessIterator is mutable, RandomAccessIterator's value_type is convertible to StrictWeakOrdering's RandomAccessIterator's value_type is LessThanComparable http://www.sgi.com/tech/stl/LessThanComparable.html; i.e., the value _type must provide operator < overloaded. |
ctl | Optional Control structure to control command-queue, debug, tuning, etc. See bolt::cl::control. |
first | The first position in the sequence to be sorted. |
last | The last position in the sequence to be sorted. |
cl_code | Optional OpenCL(TM) code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code that is to be passed when compiling the OpenCl Kernel. |
The following code example shows the use of sort
to sort the elements in the ascending order, specifying a specific command-queue.
void bolt::cl::sort | ( | bolt::cl::control & | ctl, |
RandomAccessIterator | first, | ||
RandomAccessIterator | last, | ||
StrictWeakOrdering | comp, | ||
const std::string & | cl_code = "" |
||
) |
sort
returns the sorted result of all the elements in the inputIterator between the the first and last elements using the specified binary_op. You can arrange the elements in an ascending order, where the binary_op is the less<>() operator. This version of sort
takes a bolt::cl::control structure as a first argument and compares objects using functor
object defined by StrictWeakOrdering
.
The sort
operation is analogus to the std::sort function. See http://www.sgi.com/tech/stl/sort.html.
RandomAccessIterator | Is a model of http://www.sgi.com/tech/stl/RandomAccessIterator.html, RandomAccessIterator is mutable, RandomAccessIterator's value_type is convertible to StrictWeakOrdering's RandomAccessIterator's value_type is LessThanComparable http://www.sgi.com/tech/stl/LessThanComparable.html i.e the value _type should provide operator < overloaded. |
StrictWeakOrdering | Is a model of http://www.sgi.com/tech/stl/StrictWeakOrdering.html. |
ctl | Optional Control structure to control command-queue, debug, tuning, etc. See bolt::cl::control. |
first | The first position in the sequence to be sorted. |
last | The last position in the sequence to be sorted. |
comp | The comparison operation used to compare two values. |
cl_code | Optional OpenCL(TM) code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code traits. This can be used for any extra cl code that is to be passed when compiling the OpenCl Kernel. |
The following code example shows the use of sort
to sort the elements in the descending order.