 
 
 #include <assert.h>
-// #include <cutil_inline.h>
-// #include "sortingNetworks_common.h"
-// #include "sortingNetworks_common.cuh"
-
 
 #define BLOCKS 2048 
 #define LARGE_SIZE BLOCKS*SMALL_SIZE

    

    
  tsortSmall<<<blocks, threads,4096>>>(d_input, d_output);

  for(int i = 0 ; i < diff ; i += 1){
  
    for(int j = i; j >= 0; j -= 1){ //Always true for uint
      cSwap<<<blocks,threads/2,0>>>(d_input, d_output,(1<<j)*SMALL_SIZE);
      //* put correct synchronisation ? cudasynchronize();
    }
                
    tmergeSmall<<<blocks,threads,4096>>>(d_input, d_output);
    

  }

  
  /* Allocate GPU arrays */   
  cudaMalloc((void**)&dvalues, sizeof(int) * LARGE_SIZE ); 
  cudaMemcpy(dvalues, values, sizeof(int) * LARGE_SIZE, cudaMemcpyHostToDevice);
  //cSwap<<<BLOCKS/2, SMALL_SIZE,0>>>((int*)dvalues,(int*)dresult,1);
  sort(dvalues); 
  cudaMemcpy(result, dvalues, sizeof(int) * LARGE_SIZE , cudaMemcpyDeviceToHost);
  cudaFree(dvalues);
 
 


