Previous | Next --- Slide 7 of 20
Back to Lecture Thumbnails

The ISPC documentation is quite good. For example, here is a very clear description. ISPC program instances and gangs of program instances.

The creators of ISPC wanted to use the term "program instance" instead of "thread" since although each program instance is a logical instruction sequence (a logical thread of control) the implementation of this logic is not a regular CPU thread. They didn't want to call a program instance a thread and cause confusion with what CPU programmers typically think of a thread.


I have a question from your comment above. Is each program instance a logical instruction sequence (a logical thread of control)? I think all instances have only one logical instruction sequence and they are only muliple data streams controlled by one instruction stream, as what SIMD means.

Thread actually has its own instruction stream independent from other threads.


@xielei. This is a good example of the difference between abstraction and implementation. You could say that ISPC presents the abstraction that each program instance following its own logical sequence of control. For example, an ISPC program and can while loops, if's, etc.

However, you are absolutely correct that the implementation of a gang of program instances, from the processor's perspective, is a single SIMD instruction stream. In other words, all instances in the gang share a single hardware execution context, and a single program counter. As a result of this implementation decision, whenever the code paths of different ISPC program instances diverge (e.g. at an if statement), the masking techniques described here must be used to preserve the abstraction. The result is a loss of performance since not all SIMD execution units (vector lanes) can do useful work in some cycles.