Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k-d tree speedup (nanoflann / CUDA) #5299

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yasamoka
Copy link
Contributor

@yasamoka yasamoka commented Jun 17, 2022

This pull request provides tested kd-tree implementations using Nanoflann (CPU) and FLANN (CUDA) as well as the addition of the ability to set the max leaf size for any kd-tree implementation.

Benchmarks comparing FLANN (CPU), Nanoflann (CPU), and FLANN (CUDA) can be found here: https://yasamoka.github.io/pcl-knn-benchmark/

I am not sure if there is a better way of modifying CMake scripts to satisfy dependencies. If there is, then I would appreciate help with that.

Regarding documentation, I placed the FLANN CUDA implementation with the kdtree module. This has good visibility for users of k-d trees. Shall I move it to its own module (e.g. cuda/kdtree)? Is it possible to have 2 levels like that?

Thank you very much!

@themightyoarfish
Copy link
Contributor

image

This plot seems to show that nanoflann is slower than FLANN, but your bar graphs further down show the opposite 🤔

@yasamoka
Copy link
Contributor Author

image

This plot seems to show that nanoflann is slower than FLANN, but your bar graphs further down show the opposite thinking

The line graph you're seeing is tree build time.

The bar graphs you see below that are NN search time.

Yes, nanoflann is slower than FLANN in tree building for the same leaf size. It is faster than FLANN for NN search the more you head towards less threads / less # search points.

@themightyoarfish
Copy link
Contributor

This seems useful, might a maintainer take a look?

@themightyoarfish
Copy link
Contributor

@mvieth @larshg Could you give some feedback here?

@xiaodong2077
Copy link

xiaodong2077 commented Nov 3, 2023

how about range search? is nanoflann quicker than flann?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants