 
                 }
             }
+            }//end of if output
 
             int j;
                 

                float diffy = y_i - LDG(y,i+j);
                float diffz = z_i - LDG(z,i+j);

                if ((diffct * diffct < diffx * diffx + diffy * diffy + diffz * diffz) && output) {
                    #if write_sums == 1
                    sum++;
                    #endif



#ifndef shared_memory_size
#define shared_memory_size 10*block_size_x
#endif

/*
 * This kernel uses warp-shuffle instructions to re-use many of
