wiki:ParallelDeletion

Version 2 (modified by cameron, 3 years ago) (diff)

--

Parallel Deletion

Basic Problem

Given a stream of data elements and a corresponding deletion mask bit stream, the deletion problem is to compute a compressed bit stream consisting of only the nondeleted elements.

For example, consider the following bit stream and deletion mask:

abcdefghijklmnopqrstuvwxyz
...1....11..1.1111.1......

The compressed bit stream resulting from deletion of positions marked by 1 bits is the following:

abcefghklnsuvwxyz

Problem Variations

  1. Apply a single deletion mask to a single bit stream.
  2. Apply a single deletion mask to each individual bit stream in a set of N bit streams.
  3. Apply a deletion mask to a byte stream.

Parallel Deletion Methods

Intra-Block Deletion vs. Block-by-Block Processing

When implementing parallel deletion operations on a data stream, we first perform deletions within each block (intra-block parallel deletion) and then arrange to join together the results of adjacent blocks.

For example, working with 128-bit SSE registers, we may delete 7 positions in block A, and 23 positions in block B. Given these results, we typically then want to join the partial blocks together to form a continuous data stream.

One method is to always maintain a partial block of pending results. When a new partial block is produced, we transfer as many positions as possible into the pending block. If we fill it, then we emit the full block and move the remaining bits from the new block to become the new pending block.

Intra-Block Parallel Deletion

There are several different methods that can be used to implement parallel deletion within SIMD registers.

  1. Parallel prefix deletion
  2. SIMD deletion by left-result induction
  3. SIMD deletion by central result induction
  4. Deletion using PEXT bit manipulation instructions.