     return calc_prefix1<DIM2>(prefix, tid, value);
   else
   {
-    const int WARP_SIZE2 = 5;
-    const int WARP_SIZE  = 1 << WARP_SIZE2;
     prefix[tid] = inclusive_scan_warp<WARP_SIZE2>(value);
     __syncthreads();
 

PROF_MODULE(dev_approximate_gravity);

#include "node_specs.h"

__forceinline__ __device__ float Wkernel(const float q)
{

        /***********************************/


        flag            = split && leaf && use_node;                                //flag = split + leaf + use_node
        const int jbody = node_data & BODYMASK;                                     //the first body in the leaf
        const int nbody = (((node_data & INVBMASK) >> LEAFBIT)+1) & BTEST(flag);    //number of bodies in the leaf masked with the flag

        body_list[tid] = directM[tid];                                            //copy list of bodies from previous pass to body_list

        // step 1
        calc_prefix<DIM2>(prefix, tid, flag);                                // inclusive scan on flags to construct array
        const int offset1 = prefix[tid];
        
        // step 2
        int n_bodies  = calc_prefix<DIM2>(prefix, tid, nbody);              // inclusive scan to compute memory offset for each body
        offset = prefix[tid];
        __syncthreads();

        if (flag) prefix[offset1 - 1] = tid;                             //with tidś whose leaves have to be opened
        __syncthreads();                                                      //thread barrier, make sure all warps completed the job

        directM[tid]  = offset;                                       //Store a copy of inclusive scan in direct
        offset       -= nbody;                                              //convert inclusive int oexclusive scan
        offset       += 1;                                                  //add unity, since later prefix0[tid] == 0 used to check barrier

        int nl_pre = 0;                                                     //Number of leaves that have already been processed

