#include <stdio.h>
#include<iostream>
using namespace std;
#define CHECK(res) if(res!=cudaSuccess){exit(-1);}
__global__ void helloCUDA(unsigned *indata, unsigned int len)
{
unsigned int offset = 0;
__shared__ unsigned sortbuf[8]; // Max of 1024 elements - TODO: make this dynamic
// First copy data into shared memory.
unsigned int inside = (threadIdx.x < len);
sortbuf[threadIdx.x] = inside ? indata[threadIdx.x + offset] : 0xffffffffu;
__syncthreads();
// Now the sort loops
// Here, "k" is the sort level (remember bitonic does a multi-level butterfly style sort)
// and "j" is the partner element in the butterfly.
// Two threads each work on one butterfly, because the read/write needs to happen
// simultaneously
for (unsigned int k=2; k<=16; k*=2) // Butterfly stride increments in powers of 2
{
printf("AAAAAAAAAAAAAAAAAAAAAA\n");
for (unsigned int j=k>>1; j>0; j>>=1) // Strides also in powers of to, up to <k
{
unsigned int swap_idx = threadIdx.x ^ j; // Index of element we're compare-and-swapping with
unsigned my_elem = sortbuf[threadIdx.x];
unsigned swap_elem = sortbuf[swap_idx];
__syncthreads();
// The k'th bit of my threadid (and hence my sort item ID)
// determines if we sort ascending or descending.
// However, since threads are reading from the top AND the bottom of
// the butterfly, if my ID is > swap_idx, then ascending means mine<swap.
// Finally, if either my_elem or swap_elem is out of range, then it
// ALWAYS acts like it's the largest number.
// Confusing? It saves us two writes though.
unsigned int ascend = k * (swap_idx < threadIdx.x);
unsigned int descend = k * (swap_idx > threadIdx.x);
bool swap = false;
if ((threadIdx.x & k) == ascend)
{
if (my_elem > swap_elem)
swap = true;
}
if ((threadIdx.x & k) == descend)
{
if (my_elem < swap_elem)
swap = true;
}
// If we had to swap, then write my data to the other element's position.
// Don't forget to track out-of-range status too!
if (swap)
{
sortbuf[swap_idx] = my_elem;
}
printf("BBBBBBBBBBBBBBBBBBBBBBBBB\n");
printf("sortbuf addr= %p sortbuf= %d my_elem addr= %p threadIdx.x= %d \n",
&sortbuf, sortbuf[threadIdx.x], &my_elem, threadIdx.x);
if(k>=0&&k<=16 && j>=0&&j<=8 && threadIdx.x>=0&&threadIdx.x<=7)
{
printf("k= %d j= %d threadIdx.x= %d swap_idx= %d my_elem= %d swap_elem= %d ascend= %d descend= %d swap= %d\n",
k, j, threadIdx.x, swap_idx, my_elem, swap_elem, ascend, descend, swap );
}
__syncthreads();
}//for()
}//for()
}
///
int main()
{
printf("Hello main()\n");
cudaError_t res;
///
unsigned int len = 16;
unsigned *data_test = new unsigned[len];
unsigned data_test1[] = {6,7,16,3, 14,1,2,15, 10,9,12,13, 4,5,8,11};
//data_test1[0]=10;
data_test=data_test1;
cout<<"data_test[i]: ";
for(int i=0; i<len; i++)
{
if(1)
{
cout<<data_test[i]<<" ";
}
}
cout<<endl;
///
unsigned *indata =NULL;
res = cudaMalloc((void**)(&indata), len*sizeof(unsigned));CHECK(res)
res = cudaMemcpy((void*)(indata), (void*)(data_test), len*sizeof(unsigned), cudaMemcpyHostToDevice);CHECK(res)
helloCUDA<<<1, len>>>(indata, len);
cudaDeviceSynchronize();
printf("Goodbye main()\n");
return 0;
}
Hello main()
data_test[i]: 6 7 16 3 14 1 2 15 10 9 12 13 4 5 8 11
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 2 j= 1 threadIdx.x= 0 swap_idx= 1 my_elem= 6 swap_elem= 7 ascend= 0 descend= 2 swap= 0
k= 2 j= 1 threadIdx.x= 1 swap_idx= 0 my_elem= 7 swap_elem= 6 ascend= 2 descend= 0 swap= 0
k= 2 j= 1 threadIdx.x= 2 swap_idx= 3 my_elem= 16 swap_elem= 3 ascend= 0 descend= 2 swap= 0
k= 2 j= 1 threadIdx.x= 3 swap_idx= 2 my_elem= 3 swap_elem= 16 ascend= 2 descend= 0 swap= 0
k= 2 j= 1 threadIdx.x= 4 swap_idx= 5 my_elem= 14 swap_elem= 1 ascend= 0 descend= 2 swap= 1
k= 2 j= 1 threadIdx.x= 5 swap_idx= 4 my_elem= 1 swap_elem= 14 ascend= 2 descend= 0 swap= 1
k= 2 j= 1 threadIdx.x= 6 swap_idx= 7 my_elem= 2 swap_elem= 15 ascend= 0 descend= 2 swap= 1
k= 2 j= 1 threadIdx.x= 7 swap_idx= 6 my_elem= 15 swap_elem= 2 ascend= 2 descend= 0 swap= 1
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 4 j= 2 threadIdx.x= 0 swap_idx= 2 my_elem= 6 swap_elem= 16 ascend= 0 descend= 4 swap= 0
k= 4 j= 2 threadIdx.x= 1 swap_idx= 3 my_elem= 7 swap_elem= 3 ascend= 0 descend= 4 swap= 1
k= 4 j= 2 threadIdx.x= 2 swap_idx= 0 my_elem= 16 swap_elem= 6 ascend= 4 descend= 0 swap= 0
k= 4 j= 2 threadIdx.x= 3 swap_idx= 1 my_elem= 3 swap_elem= 7 ascend= 4 descend= 0 swap= 1
k= 4 j= 2 threadIdx.x= 4 swap_idx= 6 my_elem= 1 swap_elem= 15 ascend= 0 descend= 4 swap= 1
k= 4 j= 2 threadIdx.x= 5 swap_idx= 7 my_elem= 14 swap_elem= 2 ascend= 0 descend= 4 swap= 0
k= 4 j= 2 threadIdx.x= 6 swap_idx= 4 my_elem= 15 swap_elem= 1 ascend= 4 descend= 0 swap= 1
k= 4 j= 2 threadIdx.x= 7 swap_idx= 5 my_elem= 2 swap_elem= 14 ascend= 4 descend= 0 swap= 0
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 4 j= 1 threadIdx.x= 0 swap_idx= 1 my_elem= 6 swap_elem= 3 ascend= 0 descend= 4 swap= 1
k= 4 j= 1 threadIdx.x= 1 swap_idx= 0 my_elem= 3 swap_elem= 6 ascend= 4 descend= 0 swap= 1
k= 4 j= 1 threadIdx.x= 2 swap_idx= 3 my_elem= 16 swap_elem= 7 ascend= 0 descend= 4 swap= 1
k= 4 j= 1 threadIdx.x= 3 swap_idx= 2 my_elem= 7 swap_elem= 16 ascend= 4 descend= 0 swap= 1
k= 4 j= 1 threadIdx.x= 4 swap_idx= 5 my_elem= 15 swap_elem= 14 ascend= 0 descend= 4 swap= 0
k= 4 j= 1 threadIdx.x= 5 swap_idx= 4 my_elem= 14 swap_elem= 15 ascend= 4 descend= 0 swap= 0
k= 4 j= 1 threadIdx.x= 6 swap_idx= 7 my_elem= 1 swap_elem= 2 ascend= 0 descend= 4 swap= 1
k= 4 j= 1 threadIdx.x= 7 swap_idx= 6 my_elem= 2 swap_elem= 1 ascend= 4 descend= 0 swap= 1
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 8 j= 4 threadIdx.x= 0 swap_idx= 4 my_elem= 3 swap_elem= 15 ascend= 0 descend= 8 swap= 0
k= 8 j= 4 threadIdx.x= 1 swap_idx= 5 my_elem= 6 swap_elem= 14 ascend= 0 descend= 8 swap= 0
k= 8 j= 4 threadIdx.x= 2 swap_idx= 6 my_elem= 7 swap_elem= 2 ascend= 0 descend= 8 swap= 1
k= 8 j= 4 threadIdx.x= 3 swap_idx= 7 my_elem= 16 swap_elem= 1 ascend= 0 descend= 8 swap= 1
k= 8 j= 4 threadIdx.x= 4 swap_idx= 0 my_elem= 15 swap_elem= 3 ascend= 8 descend= 0 swap= 0
k= 8 j= 4 threadIdx.x= 5 swap_idx= 1 my_elem= 14 swap_elem= 6 ascend= 8 descend= 0 swap= 0
k= 8 j= 4 threadIdx.x= 6 swap_idx= 2 my_elem= 2 swap_elem= 7 ascend= 8 descend= 0 swap= 1
k= 8 j= 4 threadIdx.x= 7 swap_idx= 3 my_elem= 1 swap_elem= 16 ascend= 8 descend= 0 swap= 1
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 8 j= 2 threadIdx.x= 0 swap_idx= 2 my_elem= 3 swap_elem= 2 ascend= 0 descend= 8 swap= 1
k= 8 j= 2 threadIdx.x= 1 swap_idx= 3 my_elem= 6 swap_elem= 1 ascend= 0 descend= 8 swap= 1
k= 8 j= 2 threadIdx.x= 2 swap_idx= 0 my_elem= 2 swap_elem= 3 ascend= 8 descend= 0 swap= 1
k= 8 j= 2 threadIdx.x= 3 swap_idx= 1 my_elem= 1 swap_elem= 6 ascend= 8 descend= 0 swap= 1
k= 8 j= 2 threadIdx.x= 4 swap_idx= 6 my_elem= 15 swap_elem= 7 ascend= 0 descend= 8 swap= 1
k= 8 j= 2 threadIdx.x= 5 swap_idx= 7 my_elem= 14 swap_elem= 16 ascend= 0 descend= 8 swap= 0
k= 8 j= 2 threadIdx.x= 6 swap_idx= 4 my_elem= 7 swap_elem= 15 ascend= 8 descend= 0 swap= 1
k= 8 j= 2 threadIdx.x= 7 swap_idx= 5 my_elem= 16 swap_elem= 14 ascend= 8 descend= 0 swap= 0
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 8 j= 1 threadIdx.x= 0 swap_idx= 1 my_elem= 2 swap_elem= 1 ascend= 0 descend= 8 swap= 1
k= 8 j= 1 threadIdx.x= 1 swap_idx= 0 my_elem= 1 swap_elem= 2 ascend= 8 descend= 0 swap= 1
k= 8 j= 1 threadIdx.x= 2 swap_idx= 3 my_elem= 3 swap_elem= 6 ascend= 0 descend= 8 swap= 0
k= 8 j= 1 threadIdx.x= 3 swap_idx= 2 my_elem= 6 swap_elem= 3 ascend= 8 descend= 0 swap= 0
k= 8 j= 1 threadIdx.x= 4 swap_idx= 5 my_elem= 7 swap_elem= 14 ascend= 0 descend= 8 swap= 0
k= 8 j= 1 threadIdx.x= 5 swap_idx= 4 my_elem= 14 swap_elem= 7 ascend= 8 descend= 0 swap= 0
k= 8 j= 1 threadIdx.x= 6 swap_idx= 7 my_elem= 15 swap_elem= 16 ascend= 0 descend= 8 swap= 0
k= 8 j= 1 threadIdx.x= 7 swap_idx= 6 my_elem= 16 swap_elem= 15 ascend= 8 descend= 0 swap= 0
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 16 j= 8 threadIdx.x= 0 swap_idx= 8 my_elem= 1 swap_elem= 13 ascend= 0 descend= 16 swap= 0
k= 16 j= 8 threadIdx.x= 1 swap_idx= 9 my_elem= 2 swap_elem= 12 ascend= 0 descend= 16 swap= 0
k= 16 j= 8 threadIdx.x= 2 swap_idx= 10 my_elem= 3 swap_elem= 11 ascend= 0 descend= 16 swap= 0
k= 16 j= 8 threadIdx.x= 3 swap_idx= 11 my_elem= 6 swap_elem= 10 ascend= 0 descend= 16 swap= 0
k= 16 j= 8 threadIdx.x= 4 swap_idx= 12 my_elem= 7 swap_elem= 9 ascend= 0 descend= 16 swap= 0
k= 16 j= 8 threadIdx.x= 5 swap_idx= 13 my_elem= 14 swap_elem= 8 ascend= 0 descend= 16 swap= 1
k= 16 j= 8 threadIdx.x= 6 swap_idx= 14 my_elem= 15 swap_elem= 5 ascend= 0 descend= 16 swap= 1
k= 16 j= 8 threadIdx.x= 7 swap_idx= 15 my_elem= 16 swap_elem= 4 ascend= 0 descend= 16 swap= 1
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 16 j= 4 threadIdx.x= 0 swap_idx= 4 my_elem= 1 swap_elem= 7 ascend= 0 descend= 16 swap= 0
k= 16 j= 4 threadIdx.x= 1 swap_idx= 5 my_elem= 2 swap_elem= 8 ascend= 0 descend= 16 swap= 0
k= 16 j= 4 threadIdx.x= 2 swap_idx= 6 my_elem= 3 swap_elem= 5 ascend= 0 descend= 16 swap= 0
k= 16 j= 4 threadIdx.x= 3 swap_idx= 7 my_elem= 6 swap_elem= 4 ascend= 0 descend= 16 swap= 1
k= 16 j= 4 threadIdx.x= 4 swap_idx= 0 my_elem= 7 swap_elem= 1 ascend= 16 descend= 0 swap= 0
k= 16 j= 4 threadIdx.x= 5 swap_idx= 1 my_elem= 8 swap_elem= 2 ascend= 16 descend= 0 swap= 0
k= 16 j= 4 threadIdx.x= 6 swap_idx= 2 my_elem= 5 swap_elem= 3 ascend= 16 descend= 0 swap= 0
k= 16 j= 4 threadIdx.x= 7 swap_idx= 3 my_elem= 4 swap_elem= 6 ascend= 16 descend= 0 swap= 1
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 16 j= 2 threadIdx.x= 0 swap_idx= 2 my_elem= 1 swap_elem= 3 ascend= 0 descend= 16 swap= 0
k= 16 j= 2 threadIdx.x= 1 swap_idx= 3 my_elem= 2 swap_elem= 4 ascend= 0 descend= 16 swap= 0
k= 16 j= 2 threadIdx.x= 2 swap_idx= 0 my_elem= 3 swap_elem= 1 ascend= 16 descend= 0 swap= 0
k= 16 j= 2 threadIdx.x= 3 swap_idx= 1 my_elem= 4 swap_elem= 2 ascend= 16 descend= 0 swap= 0
k= 16 j= 2 threadIdx.x= 4 swap_idx= 6 my_elem= 7 swap_elem= 5 ascend= 0 descend= 16 swap= 1
k= 16 j= 2 threadIdx.x= 5 swap_idx= 7 my_elem= 8 swap_elem= 6 ascend= 0 descend= 16 swap= 1
k= 16 j= 2 threadIdx.x= 6 swap_idx= 4 my_elem= 5 swap_elem= 7 ascend= 16 descend= 0 swap= 1
k= 16 j= 2 threadIdx.x= 7 swap_idx= 5 my_elem= 6 swap_elem= 8 ascend= 16 descend= 0 swap= 1
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
sortbuf addr= 0x7fdc7f000000 sortbuf= 1 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 0
sortbuf addr= 0x7fdc7f000000 sortbuf= 2 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 1
sortbuf addr= 0x7fdc7f000000 sortbuf= 3 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 2
sortbuf addr= 0x7fdc7f000000 sortbuf= 4 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 3
sortbuf addr= 0x7fdc7f000000 sortbuf= 5 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 4
sortbuf addr= 0x7fdc7f000000 sortbuf= 6 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 5
sortbuf addr= 0x7fdc7f000000 sortbuf= 7 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 6
sortbuf addr= 0x7fdc7f000000 sortbuf= 8 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 7
sortbuf addr= 0x7fdc7f000000 sortbuf= 9 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 8
sortbuf addr= 0x7fdc7f000000 sortbuf= 10 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 9
sortbuf addr= 0x7fdc7f000000 sortbuf= 11 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 10
sortbuf addr= 0x7fdc7f000000 sortbuf= 12 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 11
sortbuf addr= 0x7fdc7f000000 sortbuf= 13 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 12
sortbuf addr= 0x7fdc7f000000 sortbuf= 14 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 13
sortbuf addr= 0x7fdc7f000000 sortbuf= 15 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 14
sortbuf addr= 0x7fdc7f000000 sortbuf= 16 my_elem addr= 0x7fdc81fffc50 threadIdx.x= 15
k= 16 j= 1 threadIdx.x= 0 swap_idx= 1 my_elem= 1 swap_elem= 2 ascend= 0 descend= 16 swap= 0
k= 16 j= 1 threadIdx.x= 1 swap_idx= 0 my_elem= 2 swap_elem= 1 ascend= 16 descend= 0 swap= 0
k= 16 j= 1 threadIdx.x= 2 swap_idx= 3 my_elem= 3 swap_elem= 4 ascend= 0 descend= 16 swap= 0
k= 16 j= 1 threadIdx.x= 3 swap_idx= 2 my_elem= 4 swap_elem= 3 ascend= 16 descend= 0 swap= 0
k= 16 j= 1 threadIdx.x= 4 swap_idx= 5 my_elem= 5 swap_elem= 6 ascend= 0 descend= 16 swap= 0
k= 16 j= 1 threadIdx.x= 5 swap_idx= 4 my_elem= 6 swap_elem= 5 ascend= 16 descend= 0 swap= 0
k= 16 j= 1 threadIdx.x= 6 swap_idx= 7 my_elem= 7 swap_elem= 8 ascend= 0 descend= 16 swap= 0
k= 16 j= 1 threadIdx.x= 7 swap_idx= 6 my_elem= 8 swap_elem= 7 ascend= 16 descend= 0 swap= 0
Goodbye main()