     const group_t *d_scratch_g,
     const unsigned int *d_scratch_idx,
     const unsigned int *d_offset,
-    group_t *d_pidx_group_table
+    group_t *d_pidx_group_table,
+    unsigned int pidx_group_table_pitch
     )
     {
     unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;

#include "ParticleData.cuh"
#include "BondedGroupData.cuh"

#include <thrust/scan.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/device_ptr.h>

#include "moderngpu/kernels/mergesort.cuh"

/*! \file BondedGroupData.cu
    \brief Implements the helper functions (GPU version) for updating the GPU bonded group tables

    if (i >= n_scratch) return;

    unsigned int pidx = d_scratch_idx[i];
    unsigned int offset = d_offset[i]*pidx_group_table_pitch + pidx;
    d_pidx_group_table[offset] = d_scratch_g[i];
    }

