Barnes-Hut N-body approach in CUDA: Construction of the bounding box

The relevant __global__ function is BoundingBoxKernel which is appointed to find the bounding box of the bodies. Essentially it performs reduction operations along the bodies position coordinates. To illustrate how it works, let us consider the following simple example. Suppose to launch 4 threads. In this case, inc = 4. Each thread initializes the register variables minx, maxx, miny, maxy, minz, maxz as The first for loop degenerates into a single cycle with j=i, i being the thread inde...
More