
420 Designing Scientific Applications on GPUs
cache memory. Data used by the work-items can be stored as N-dimensions
matrices in local or global GPU memory. Since the size of this memory is
often limited to a few hundred kilobytes, choosing this number often implies
a compromise between the model synchronization or data requirements and
the available resources.
In the case of agent-based simulations, each agent can be naturally mapped
to a work-item. Work-groups can then be used to represent groups of agents
or simulations sharing common data (such as the environment) or algorithms
(such as the background evolution process).
In the following examples ...