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

  // Make sure we do not go out of bounds
  if (id < n)
    atomicAdd(trg + idx[id], -src[id]);

  __syncthreads();
}

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

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

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