 static unsigned int
 compact
 (
-    const T             *in,
-    T                   *out,
-    const uint32_t      *flags,
+    const T             *d_in,
+    T                   *d_out,
+    const uint32_t      *d_flags,
     const uint32_t      length
 )
 {

    uint32_t blocks;

    permute_control(length, blocks, threads);
    permute_core< T,backward,compact >
        <<<blocks,threads>>>(in, out, indices, length, valid, num_valid);
}



static void
permute
(
    const T             *d_in,
    T                   *d_out,
    const uint32_t      *indices,
    const uint32_t      length,
    const uint32_t      *valid     = NULL,
