   
   /* Allocate GPU arrays */   
   cudaMalloc((void**)&dvalues, sizeof(int) * LARGE_SIZE ); 
-  cudaMalloc((void**)&dresult, 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,dvalues); // dresult);
+  sort(dvalues); 
   cudaMemcpy(result, dvalues, sizeof(int) * LARGE_SIZE , cudaMemcpyDeviceToHost);
   cudaFree(dvalues);
-  cudaFree(dresult);
+ 
  
 
 

    

    
  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);
    

  }

  int *result; 

  int *dvalues;

  values = (int*)malloc(LARGE_SIZE*sizeof(int));
  result = (int*)malloc(LARGE_SIZE*sizeof(int));
