code/Cpp-Framework-4_0/libnop_gbench/include/test.h
/*It recursively sorts a bitonic sequence in ascending order,
  if dir = 1, and in descending order otherwise (means dir=0).
  The sequence to be sorted starts at index position low,
  the parameter cnt is the number of elements to be sorted.*/
It recursively sorts a bitonic sequence in ascending order,
if dir = 1, and in descending order otherwise (means dir=0).
The sequence to be sorted starts at index position low,
the parameter cnt is the number of elements to be sorted.
It recursively sorts a bitonic sequence in ascending order if dir = 1 and in descending order otherwise ( means dir = 0 ) . The sequence to be sorted starts at index position low the parameter cnt is the number of elements to be sorted .
void bitonicMerge(int a[], int low, int cnt, int dir)
{
    if (cnt > 1)
    {
        int k = cnt / 2;
        for (int i = low; i < low + k; i++) compAndSwap(a, i, i + k, dir);
        bitonicMerge(a, low, k, dir);
        bitonicMerge(a, low + k, k, dir);
    }
}
void bitonicMerge ( int a [ ] , int low , int cnt , int dir ) { if ( cnt > 1 ) { int k = cnt / 2 ; for ( int i = low ; i < low + k ; i ++ ) compAndSwap ( a , i , i + k , dir ) ; bitonicMerge ( a , low , k , dir ) ; bitonicMerge ( a , low + k , k , dir ) ; } }
It recursively sorts a bitonic sequence in ascending order,
if dir = 1, and in descending order otherwise (means dir=0).
It recursively sorts a bitonic sequence in ascending order if dir = 1 and in descending order otherwise ( means dir = 0 ) .