 
 template<const int DIM2>
 __device__ __forceinline__ int inclusive_segscan_block64(
-    int *shmem, const int tid, const int packed_value, int &dist_block, int &nseg)
-{
-#if 0
-  const int laneId = tid & (WARP_SIZE - 1);
-  const int warpId = tid >> WARP_SIZE2;
-#endif
-
+    int *shmem, const int packed_value, int &dist_block, int &nseg)
+{
   const int  flag = packed_value < 0;
   const int  mask = BTEST(flag);
   const int value = (mask & (-1-packed_value)) + (~mask & 1);

          __syncthreads();

          // step 2:
          const int nl = inclusive_segscan_array<DIM2>(&body_list[n_direct], nb, tid);
          nb = directM[prefix[nl_pre + nl - 1]];                       // number of bodies stored in these leaves
          __syncthreads();



/****** KEPLER __shfl prefix sum ******/

#if 1  /* uses inlined assembly */
__device__ __forceinline__ uint shfl_scan_add_step(uint partial, uint up_offset)
{
  uint result;
