Previous | Next --- Slide 90 of 94
Back to Lecture Thumbnails
tonycai

To summarize what Kayvon said in the lecture: 1. The program on the left doesn't work because "sum += x[i]" is not an atomic operation 2. "partial += x[i]" runs on all program instances of an ISPC gang. "partial" is a per-instance variable, while sum is a per-gang variable (since it has the "uniform" keyword. 3. reduce_add is an ISPC primitive that aggregates per-instance variable into a single per-gang variable.

parthiv

I found it interesting that ISPC also has other similar functions reduce_min and reduce_max for finding the min and max values among all program instances, as well as all, any, and none for boolean values. There's also reduce_equal to see if all program instances have the same value. There are even ways to communicate between program instances, which can allow ISPC to work in situations that may not allow for the purely data-parallel approach we seem to have been taking with ISPC programs. https://ispc.github.io/ispc.html

Please log in to leave a comment.