Graphics Reference
In-Depth Information
Figure 12.4. The thread group layout of our fluid column grids, depicted as an 8x8 group for visualization.
Threading Scheme
Next, we must determine what type of threading system will be used during the simulation
update phase. If we assume that we will use a single thread for each fluid column to be
updated, we must consider what types of data accesses it will need to make so that we can
choose an appropriate layout scheme. Each fluid column will require data from all of its
immediate neighbors to determine how much fluid will be flowing into and out of it. This
would indicate that a square-shaped thread group would be appropriate, since it would al-
low adjacent fluid columns to use the group shared memory for device memory accesses,
as well as for intermediate calculations. Thus, the rectangular grid of fluid columns would
be split into thread groups as shown in Figure 12.4. We must choose the dispatch size to
ensure that enough thread groups are created to update the entire simulation grid. In our
sample application, we will be processing a 16 x 16 area of the grid with each thread group,
so the total size of the simulation must fit to multiples of this size in each dimension.
Search WWH ::




Custom Search