             // Push all circle in block region forward
             circleInBlock[circleInBlockIdx] = linearThreadIndex;
         }
+        // Sync circleInBlock
         __syncthreads();
 
         for (int i=0; i < num_circle_in_block; i++){               

            index3_circ = 3 * circleIndex;
            p_circ = *(float3*)(&cuConstRendererParams.position[index3_circ]);
            rad = cuConstRendererParams.radius[circleIndex];
            scanInput[linearThreadIndex] = circleInBoxConservative(p_circ.x, p_circ.y, rad, boxL,boxR,boxT,boxB);
        }

        // Exclusive scan
        sharedMemExclusiveScan(linearThreadIndex, scanInput, scanOutput, scanScratch, THREADS_PER_BLK);
        __syncthreads();
        // See if last circle in thread block is in block region
        num_circle_in_block = scanOutput[THREADS_PER_BLK-1]+scanInput[THREADS_PER_BLK-1];

                p = *(float3*)(&cuConstRendererParams.position[index3]);
                pixelCenterNorm = make_float2(invWidth * (static_cast<float>(imageX) + 0.5f),
                                                     invHeight * (static_cast<float>(imageY) + 0.5f));
                shadePixel(circleInBlock[i]+thread_iter,pixelCenterNorm, p, &imgPtr,radiusShared[circleInBlock[i]]);
        }
        // Sync radiusShared to prevent the data to be modified in a new iteration
        __syncthreads();
    }
    *(float4*)(&cuConstRendererParams.imageData[offset]) = imgPtr;
}
