<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic baffling leaf count in Intel® Embree Ray Tracing Kernels</title>
    <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791188#M85</link>
    <description>The instruction you cited removes overallocated memory. However, each thread grabs a block of nodes from the node array atomically. The thread then fills this block until it is full and then takes a new block and so on. At the end of the build the threads will however very likely not have filled up their current block completely.</description>
    <pubDate>Tue, 03 Jul 2012 16:47:44 GMT</pubDate>
    <dc:creator>SvenW_Intel</dc:creator>
    <dc:date>2012-07-03T16:47:44Z</dc:date>
    <item>
      <title>baffling leaf count</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791185#M82</link>
      <description>If I traverse the bvh2 tree and count the number of leaves, I come up with the correct number of leaf nodes but if I linearly go through the nodes array using the following code, I come up short:&lt;BR /&gt;int leaves = 0;&lt;BR /&gt;size_t numnodes = getNumNodes();&lt;BR /&gt;for (size_t i = 0; i &amp;lt; numnodes ; i++) {&lt;BR /&gt; const int nodeID = id2offset(i);&lt;BR /&gt; const Node&amp;amp; n = node(nodes, nodeID);&lt;BR /&gt; if (n.child[0] &amp;lt; 0)&lt;BR /&gt; ++leaves;&lt;BR /&gt; if (n.child[1] &amp;lt; 0)&lt;BR /&gt; ++leaves;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The actual numbers computed by getNumNodes and getNumLeaves are:&lt;BR /&gt;nodes = 18935 &lt;BR /&gt;leaves = 18936 &lt;BR /&gt;The numbers I come up by going through the nodes array:&lt;BR /&gt;nodes=18935&lt;BR /&gt;leaves=15121&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong here?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;vf&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jul 2012 18:33:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791185#M82</guid>
      <dc:creator>vectorfarmer</dc:creator>
      <dc:date>2012-07-02T18:33:44Z</dc:date>
    </item>
    <item>
      <title>baffling leaf count</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791186#M83</link>
      <description>You have to iterate over the number of nodes allocated in the node array (numAllocatedNodes). However, even then you have to make sure that not used nodes are initialized to some value for this iteration to make sense.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Some nodes in these arrays are not used as multiple threads take blocks of nodes out of this array. Some blocks at the end might end up partly filled.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Jul 2012 05:19:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791186#M83</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2012-07-03T05:19:34Z</dc:date>
    </item>
    <item>
      <title>baffling leaf count</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791187#M84</link>
      <description>Hi Sven,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. I realized that last night when I started printing the nodes and seeing all these empty ones. I thought the following piece of code is getting rid of the unused space:&lt;BR /&gt;/*! free temporary memory again */&lt;BR /&gt; bvh-&amp;gt;nodes&lt;BR /&gt; = (BVH2&lt;TRIANGLE4&gt;::Node*) alignedRealloc(bvh-&amp;gt;nodes, atomicNextNode&lt;BR /&gt; * sizeof(BVH2&lt;TRIANGLE4&gt;::Node));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So the above instruction removes the unused blocks, but there are still unused space withing the currently used blocks? Could you please clarify this?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;vf&lt;/TRIANGLE4&gt;&lt;/TRIANGLE4&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:02:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791187#M84</guid>
      <dc:creator>vectorfarmer</dc:creator>
      <dc:date>2012-07-03T15:02:56Z</dc:date>
    </item>
    <item>
      <title>baffling leaf count</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791188#M85</link>
      <description>The instruction you cited removes overallocated memory. However, each thread grabs a block of nodes from the node array atomically. The thread then fills this block until it is full and then takes a new block and so on. At the end of the build the threads will however very likely not have filled up their current block completely.</description>
      <pubDate>Tue, 03 Jul 2012 16:47:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791188#M85</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2012-07-03T16:47:44Z</dc:date>
    </item>
    <item>
      <title>baffling leaf count</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791189#M86</link>
      <description>Got it.&lt;BR /&gt;&lt;BR /&gt;Thanks again for your help.&lt;BR /&gt;&lt;BR /&gt;best,&lt;BR /&gt;vf</description>
      <pubDate>Tue, 03 Jul 2012 17:19:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/baffling-leaf-count/m-p/791189#M86</guid>
      <dc:creator>vectorfarmer</dc:creator>
      <dc:date>2012-07-03T17:19:34Z</dc:date>
    </item>
  </channel>
</rss>

