17#ifndef EBGEOMETRY_BVHREFIT_HPP
18#define EBGEOMETRY_BVHREFIT_HPP
65 template <
class T,
class P,
size_t K>
77 return m_levelBegin.empty() ? 0 : m_levelBegin.size() - 1;
84 template <
class T,
class P,
size_t K,
class BVConstructor>
89 const BVConstructor& a_bvConstructor);
99 std::vector<uint32_t> m_levelBegin;
105 uint64_t m_rootId = 0;
112 uint64_t m_nodesOffset = 0;
149template <
class T,
class P,
size_t K,
class BVConstructor>
155 const BVConstructor& a_bvConstructor);
157namespace RefitDetail {
164template <
class Bvh,
class BVConstructor>
187 BVConstructor m_bvConstructor;
195 operator()(
const std::size_t a_i)
const
197 void* base = m_bvh.base();
199 m_bvh.refitNode(base, m_nodes.
at(base, m_begin +
static_cast<uint32_t
>(a_i)), m_bvConstructor);
209#include "EBGeometry_BVHRefitImplem.hpp"
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Utility macros for EBGeometry.
Placement-independent POD array views for the GPU memory foundation.
The flattened, device-callable bounding volume hierarchy: PackedBVH, its node layout,...
Growable bump arena for the GPU memory foundation.
Forward declaration of the linearised BVH, defined below.
Definition EBGeometry_PackedBVH.hpp:365
A PackedBVH's nodes grouped by tree depth, deepest level first: the order in which BVH::refit() refit...
Definition EBGeometry_BVHRefit.hpp:53
RefitSchedule(Pool &a_pool, const PackedBVH< T, P, K > &a_bvh)
Group the nodes of a_bvh by depth.
friend void refit(Pool &a_pool, const PackedBVH< T, P, K > &a_bvh, const RefitSchedule &a_schedule, const BVConstructor &a_bvConstructor)
BVH::refit() reads the node list and the levels.
size_t numLevels() const noexcept
Number of tree levels; 0 for an empty BVH.
Definition EBGeometry_BVHRefit.hpp:75
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:188
void refit(Pool &a_pool, const PackedBVH< T, P, K > &a_bvh, const RefitSchedule &a_schedule, const BVConstructor &a_bvConstructor)
Refit the copy of a_bvh that lives in a_pool, after its primitives have moved: every box becomes the ...
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Placement-independent descriptor of a POD array inside a Pool.
Definition EBGeometry_PODVector.hpp:119
T & at(void *a_base, uint32_t a_i) const noexcept
Mutable element access against a_base.
Definition EBGeometry_PODVector.hpp:198