Previous | Next --- Slide 11 of 60
Back to Lecture Thumbnails
bharadwaj

What would happen if you asked the SIMD implementation to run the program with 6 instance instead of 4 or 8? I ask this because it was mentioned that the compiler would treat the sin function call as an ordinary C function, but run with vector instructions. But maybe your instance count doesn't actually have instructions that correspond to it. What happens in that case?

EDIT: This was answered in class. ISPC restricts you to multiples of instruction widths that it actually possesses. Then, it just duplicates the op $k$ times.

bochet

SIMD and SPMD are actually different concepts. In wiki, stackoverflow and this link, some differences are discussed.

pdp

@bharadwaj: What does it mean by "It just duplicated the op k times"?

bharadwaj

Suppose you want to run a SIMD program with 32 program instances. Suppose that there are vector instructions that are 8-wide, and that's the highest instruction width. In that case, SIMD would just run the 8-wide op 4 times.

On the slide, this is referenced in the line "Number of instances in a gang is the SIMD width or the hardware (** or a small multiple of SIMD width **).

kayvonf

From the ISPC User's Guide, see the section called Selecting The Compilation Target