[REQUEST] NanoVDB 32.3 Deprecated getNode methods
Is your feature request related to a problem? Please describe.
Hi, I was using the NodeT* Tree<RootT>::getNode(uint32_t i) method to get the leaf nodes and set the value in a CUDA kernel but NanoVDB 32.3 has deprecated the methods. As far as I can see they are replaced by getFirstNode.
My volume build kernel does something like LeafT* leaf = const_cast<LeafT*>(grid->tree().getNode<0>(idx >> 9)); to get the leaf node. I was wondering if there is an alternative way now using the firstNode in the tree level. I want to move to 32.3 to be able to use the inline __hostdev__ bool firstActive(RayT& ray, AccT& acc, Coord &ijk, float& t) method in HDDA.
Describe the solution you'd like
A convenience function similar to getNode that takes an index would solve my issue
Describe alternatives you've considered
I've tried to reach the leaf nodes by getting the first node and incrementing the pointer. This is working to some extent but leaving some leaf nodes unchanged.
Additional context
Currently, I'm at NanoVDB version 29.3.
Tree::getNode was deprecated to add support for compression (e.g. Fp4,8,16,N). The replacement was NodeManager or LeafManager found in util/NodeManager.h, however it has not yet been ported to the GPU. So long story short, your observation is correct in that there is currently no elegant replacement for Tree::getNode on the GPU. I see three options: 1) continue doing exactly what you describe (using const_cast) but note that it doesn't NOT work for compressed grids to it's potentially dangerous, 2) wait for me to port the NodeManager to the device, 3) I could add back Tree::getNode but only for none-compressed types (i.e. it would not compile with compressed grids). Which one do you prefer?
Hi Ken, thanks for the information. I can wait for the NodeManager to be ported to the device code as the kernel is working correctly right now and firstActive() will only be used for optimization.
Thank you for the great library.