Skip to content

Sorting points doesn't actually sort points #8

@yuhao

Description

@yuhao

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions