flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.25k stars 648 forks source link

fix bug for knnSearchGpu when knn!=ostride #374

Closed yuyi1005 closed 6 years ago

yuyi1005 commented 6 years ago

knnSearchGpu gives wrong results if knn!=ostride.

For example, when we define the output matrix as flann::Matrix idx(data, rows, 3, 4); which means we need to find 3 nearest neighbor, but we want to save the results to a matrix of stride=4, then the result is wrong.

This bug can be fixed changing only one place in kdtree_cuda_3d_index.cu.