Previous | Next --- Slide 3 of 48
Back to Lecture Thumbnails
danieltc

I understand that there is no explicit parallelism in this code, and that the implementation of the code is executed via 8-wide vector instructions; however, I don't understand why we say this code is not parallelized by ISPC. What do we mean exactly by "parallelized" here? Is it not part of the abstraction of ISPC that we are guaranteed a gang of program instances will execute this code concurrently?

barracuda

You’re correct that this code is run by each gang member. However, from the perspective of a single gang member running this code, it’s just a sequential piece of code and each iteration occurs one after another serially. The parallelism was specified when this ISPC function was called, in which case the underlying ISPC implementation had the flexibility to parallelize the original task by initializing a gang of instances, each running this piece of code, by using vector instructions. Also, it’s worth noting there’s a subtle distinction between "concurrent" pieces of work (can be executed independently and in any order, and potentially in parallel) and "parallel" pieces of work (executed simultaneously).