Previous | Next --- Slide 12 of 63
Back to Lecture Thumbnails
mkarra

I am a little unclear on what it means for loop variables to be uniform -- I know this was asked in lecture. The response was that uniform variables are the same across all program instances. Is it not possible to have ISPC program instances executing different iterations of the for loop (if they're independent) ?

Drew

To answer mkarra's question, it seems like each worker will have to execute the "same" iteration of the loop at the "same" time. The first "same" here means that the loop index is equal for all workers at the same time, and the second "same" is in quotes because ISPC isn't required as far as I know to actually run them all in parallel. However, this is still a parallel program because we're using the offset of the programIndex to work on different pieces of data at the same time. So it's true that this code tells ISPC to not execute different iterations of the loop in parallel, but the code still tells ISPC to execute some operations in parallel.

cmchiang

If loop variables are not marked uniform, ISPC compiler might map it to SIMD vectors. If they are marked uniform, ISPC will know that a normal int is sufficient.

Please log in to leave a comment.