-
Notifications
You must be signed in to change notification settings - Fork 31
Description
cuNSearch/src/cuNSearchKernels.cu
Line 162 in b3b708d
| Real3 diff = particles[reversedSortIndices[neighborIndex]] - particle; |
I might be wrong about this, but I was under the impression that the point of sorting points is to minimize scattered global memory access and thus facilitating memory coalescing. If so, then we need to actually sort and reorder points in the actual global memory, but the referenced code above shows that we don't actually reorder the point layout in the memory; rather, we simply use the indices in reversedSortIndices to index into the original memory layout.
I would think to actually reorder points in the memory, you would have to do something like:
thrust::sort_by_key(pointSetImpl->d_ReversedSortIndices.begin(), pointSetImpl->d_ReversedSortIndices.end(), pointSetImpl->d_Particles.begin())
Am I correct in this understanding?