Previous | Next --- Slide 34 of 83
Back to Lecture Thumbnails
cassiez

The code segment in left bottom corner demonstrated that while library functions that supports data parallelism (eg. map) are easy to write, there is less flexibilities for programmers to use them. Here, the ISPC code is doing something simple: calculates the absolute value of every element in x and store in 2 indices in y. But because map functions only supports mapping 1 input element to 1 output element, there is no good way to write the same function with only "map".

tommynation

I wonder if you can foreach loop every two elements so that say x[i] + x[i+1] are stored in y[i] and what that syntax would look like.

Please log in to leave a comment.