Affiliation:
1. Computer science, University of Cape Town, Rondebosch, South Africa
Abstract
Stream compaction, the parallel removal of selected items from a list, is a fundamental building block in parallel algorithms. It is extensively used, both in computer graphics, for shading, collision detection, and ray tracing, as well as in general computing, such as for tree traversal and database selection.
In this article, we present Redzone stream compaction, the first parallel stream compaction algorithm to remove
k
items from a list with
n ≥ k
elements in
O(k)
rather than
O(n)
time. Based on our benchmark experiments on both GPU and CPU, if
k
is proportionally small (
k ≪ n
), Redzone outperforms existing parallel stream compaction by orders of magnitude, while if
k
is close to
n
, it underperforms by a constant factor. Redzone removes items in-place and needs only
O(1)
auxiliary space. However, unlike current
O(n)
algorithms, it is unstable (i.e., the order of elements is not preserved) and it needs a list of the items to be removed.
Publisher
Association for Computing Machinery (ACM)