3 ms·
> They are very good at doing the exact same instructions in parallel (apply this formula to 4 million pixels) In numerical fluid mechanics, you rather want to
by sampo 5y ago
> They are very good at doing the exact same instructions in parallel (apply this formula to 4 million pixels)
In numerical fluid mechanics, you rather want to apply the same formula to the nearest 27 (3x3x3) or 125 (5x5x5) pixels in the 3-dimensional array. And then store the result to another 3-dimensional array.
Or maybe for calculating a value in a 3d array A, you need to apply a formula that looks at the nearest 27 values in both array A itself and also in another 3d array B. Maybe also C.
- dahart 5y agoThis is true for pixels too; think about a median or blur operation, or a 2d fluid sim, you might gather and combine the nearest NxN pixels. 2d and 3d are nearly identical, the main difference is just indexing. Parent comment was talking about the single formula that produces the output value written to the cell, which as you say might well involve reading inputs from many nearby cells. Fluid mechanics can also be thought of as a single formula per output cell. (And normally it’s most natural to organize GPU threads so that they are 1:1 with output cells.)