|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > |
void | bolt::cl::sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="") |
| This version of sort_by_key returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements key elements and corresponding values. The routine arranges the elements in an ascending order.
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > |
void | bolt::cl::sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, const std::string &cl_code="") |
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering > |
void | bolt::cl::sort_by_key (bolt::cl::control &ctl, RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="") |
| This version of sort_by_key returns the sorted result of all the elements in the RandomAccessIterator between the the first and last elements key elements and corresponding values. The routine arranges the elements in an ascending order.
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering > |
void | bolt::cl::sort_by_key (RandomAccessIterator1 keys_first, RandomAccessIterator1 keys_last, RandomAccessIterator2 values_first, StrictWeakOrdering comp, const std::string &cl_code="") |
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename StrictWeakOrdering >
void bolt::cl::sort_by_key |
( |
bolt::cl::control & |
ctl, |
|
|
RandomAccessIterator1 |
keys_first, |
|
|
RandomAccessIterator1 |
keys_last, |
|
|
RandomAccessIterator2 |
values_first, |
|
|
StrictWeakOrdering |
comp, |
|
|
const std::string & |
cl_code = "" |
|
) |
| |
This version of sort_by_key
returns the sorted result of all the elements in the RandomAccessIterator
between the the first and last elements key elements and corresponding values. The routine arranges the elements in an ascending order.
This routine uses function object comp to compare the key objects.
- Parameters
-
ctl | Optional Control structure to control command-queue, debug, tuning, etc. See bolt::cl::control. |
keys_first | The first position in the sequence to be sorted. |
keys_last | The last position in the sequence to be sorted. |
values_first | The first position in the value sequence. |
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. |
- Returns
- The sorted key,value pair that is available in place.
- Template Parameters
-
The following code example shows the use of sort_by_key
to sort the key,value pair in the ascending order.
int keys[8] = {2, 9, 3, 7, 5, 6, 3, 8};
int values[8] = {100, 200, 16, 50, 15, 8, 3, 5};