This chapter studies a particular example of C++ AMP in action in order to show the concepts that were introduced in the previous chapter and to look ahead to some concepts that will be discussed in the following chapters. The NBody example demonstrates one solution to the n-body problem: how to simulate a large number of stars moving under the influence of gravity. In order to calculate the motion of each star, its interaction with every other star must be calculated, so the amount of computation required scales as *n ^{2}*, where

Start Free Trial

No credit card required