code/Cpp-Framework-4_0/libnop_gbench/include/test.h
/* This function first produces a bitonic sequence by recursively
    sorting its two halves in opposite sorting orders, and then
    calls bitonicMerge to make them in the same order */
This function first produces a bitonic sequence by recursively
sorting its two halves in opposite sorting orders, and then
calls bitonicMerge to make them in the same order
This function first produces a bitonic sequence by recursively sorting its two halves in opposite sorting orders and then calls bitonicMerge to make them in the same order
void bitonicSort(int a[], int low, int cnt, int dir)
{
    if (cnt > 1)
    {
        int k = cnt / 2;
        bitonicSort(a, low, k, 1);
        bitonicSort(a, low + k, k, 0);
        bitonicMerge(a, low, cnt, dir);
    }
}
void bitonicSort ( int a [ ] , int low , int cnt , int dir ) { if ( cnt > 1 ) { int k = cnt / 2 ; bitonicSort ( a , low , k , 1 ) ; bitonicSort ( a , low + k , k , 0 ) ; bitonicMerge ( a , low , cnt , dir ) ; } }
This function first produces a bitonic sequence by recursively
sorting its two halves in opposite sorting orders, and then
calls bitonicMerge to make them in the same order
This function first produces a bitonic sequence by recursively sorting its two halves in opposite sorting orders and then calls bitonicMerge to make them in the same order
// sort in ascending order since dir here is 1
 // sort in descending order since dir here is 0
 // Will merge wole sequence in ascending order
 // since dir=1.
