Previous | Next --- Slide 16 of 63
Back to Lecture Thumbnails
joel

Summarising: http://15418.courses.cs.cmu.edu/spring2016/lecture/progabstractions/slide_016

Static Interleaved assignment: Assignment determined at compile time and program instance i operates on array such that arrayIndex % programCount = i

bmperez's thoughts On the difference between launch and foreach:

foreach expresses SIMD parallelism, and so it will (almost always) be mapped to vectorized instructions. Launch, on the other hand, specifies multi-core parallelism, and so it will be mapped using some thread-based implementation; it could either be by launching N pthreads, or by launching 1 pthread per processor, and then performing work stealing.

At a more abstract level, foreach is very declarative; it only specifies that this piece of data is fully paralellizable, and does not tell the compiler how to partition the data. Launch on the other hand is more imperative; the function that is launched tells the compiler how to partition the data, and the compiler must follow that exactly. Thus, foreach gives the freedom to the compiler to partition the data, while the function that launch runs tells the compiler how to partition the data.