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

Buggy assert in print() function? #52

Open
histfuture opened this issue Aug 2, 2017 · 2 comments
Open

Buggy assert in print() function? #52

histfuture opened this issue Aug 2, 2017 · 2 comments

Comments

@histfuture
Copy link

histfuture commented Aug 2, 2017

Hi, I found a possible buggy assert in kernel_print function,

assert((level == 0 && node.hasStatus(ns_LAST_LEVEL)) || (level != 0 && hasStatus(ns_LAST_LEVEL))); // line 164

I think the line should be ,

assert((level == 1 && node.hasStatus(ns_LAST_LEVEL)) || (level != 1 && hasStatus(ns_LAST_LEVEL)));

Since nodes in level 0 are all leaf nodes , and in NTree.hpp,

`
// line 607

    if (level == 1)         
    {
      kernel_clearNodes<InnerNode, true> <<<numBlocks, num_threads_per_block>>>(branching_factor * numNodes, (InnerNode*) nodes );
      HANDLE_CUDA_ERROR(cudaDeviceSynchronize());
      kernel_setNodes<InnerNode, LeafNode, branching_factor> <<<numBlocks, num_threads_per_block>>>(
          D_PTR(d_voxels), num_points, level, D_PTR(nodeCount),
          (InnerNode*) nodes, D_PTR(nodeIds), (LeafNode*) childNodes);
  }

`

the above code set ns_LAST_LEVEL flag for nodes in level 1.

@Squelsh
Copy link
Contributor

Squelsh commented Aug 2, 2017

Thanks @nangong !!
From a first look you seem to be right. ns_LAST_LEVEL is not the Leaf-Level, but one level above.
It is used to trigger serial execution of Leaf-Node operations to prevent inefficient full parallelization.
So the assert is buggy.
I will check this again and correct it with an upcoming release (which should come soon).

@histfuture
Copy link
Author

@Squelsh
Moreover , I found both level 0 and level 1 are set ns_LAST_LEVEL flag

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

No branches or pull requests

2 participants