   // Make sure we do not go out of bounds
   if (id < n*bsize)
     atomicAdd(trg + idx[id/bsize]*bsize+id%bsize, src[id]);
-
-  __syncthreads();
 }
 
 void dense_to_sparse_block_add(int n, const unsigned *idx, int bsize, float *src, float *trg) {

  // Make sure we do not go out of bounds
  if (id < n)
    trg[id] = val;

  __syncthreads();
}

void const_init(int n, float val, float *trg) {

  // Make sure we do not go out of bounds
  if (id < n)
    trg[idx[id]] = src[id];
}

void dense_to_sparse_assign(int n, const unsigned int *idx, float *src, float *trg) {
