stream compaction with shared memory