Skip to content

Fixed child offset computation in nanovdb::tools::cuda::indexToGrid #2013

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heandreas
Copy link

I ran into a problem when using nanovdb::tools::cuda::indexToGrid<nanovdb::Vec3f> to build a grid of Vec3fs from an index grid. After debugging for a while I managed to find a fix that works for me. I believe the computation for dstTile.child in processRootTilesKernel is not correct for all types. It seems to work for float and double grids, but not for Vec3f and probably many (or all?) other types that do not align with the size of the index type. My fix is inspired by the code in processNodesKernel that also computes similar byte offsets.

I extended the unit test CudaIndexGridToGrid_ValueOnIndex to show the problem. It only passes with my fix and not the original code. Feedback is highly appreciated!

… building a grid with internal nodes that differed in size from the size of internal nodes of the index grid.
@heandreas heandreas requested a review from kmuseth as a code owner March 14, 2025 15:11
Copy link

CLA Missing ID CLA Not Signed

@kmuseth
Copy link
Contributor

kmuseth commented Mar 31, 2025

thanks @heandreas ! Looking at your changes now :)

@kmuseth
Copy link
Contributor

kmuseth commented Mar 31, 2025

yes this does indeed look like a valid fix - great catch!

since you didn't sign the EasyCLA I'm taking the liberty to re-write your PR slightly with more documentation explaining how this fix works

@heandreas
Copy link
Author

Sounds great, thanks for looking into it!

@kmuseth
Copy link
Contributor

kmuseth commented Mar 31, 2025

@heandreas - see PR #2021 - I added a credit to you - let me know if you prefer to be anonymous.

@heandreas
Copy link
Author

@kmuseth Thanks, I'd be delighted to show up in the nanovdb changelog :-)

@kmuseth
Copy link
Contributor

kmuseth commented Apr 1, 2025

@heandreas - take a look here

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.

2 participants