34 #include <cugar/basic/types.h> 35 #include <cugar/basic/vector.h> 53 CUGAR_HOST_DEVICE
Context(
Kd_node* nodes, uint2* leaves, uint2* ranges) :
57 CUGAR_HOST_DEVICE
void write_node(
const uint32 node,
const uint32 offset,
const uint32 skip_node,
const uint32
begin,
const uint32 end,
const uint32 split_index,
const uint32 split_dim,
const float split_plane)
62 m_ranges[ node ] = make_uint2( begin, end );
65 CUGAR_HOST_DEVICE
void write_node(
const uint32 node,
const uint32 offset,
const uint32 skip_node,
const uint32
begin,
const uint32 end)
70 m_ranges[ node ] = make_uint2( begin, end );
73 CUGAR_HOST_DEVICE
void write_leaf(
const uint32 index,
const uint32
begin,
const uint32 end)
75 m_leaves[ index ] = make_uint2( begin, end );
91 thrust::device_vector<Kd_node>* nodes,
92 thrust::device_vector<uint2>* leaves,
93 thrust::device_vector<uint2>* ranges) :
113 thrust::raw_pointer_cast( &
m_nodes->front() ),
114 thrust::raw_pointer_cast( &
m_leaves->front() ),
118 thrust::device_vector<Kd_node>*
m_nodes;
119 thrust::device_vector<uint2>*
m_leaves;
120 thrust::device_vector<uint2>*
m_ranges;
CUGAR_HOST_DEVICE void write_leaf(const uint32 index, const uint32 begin, const uint32 end)
write a new leaf
Definition: kd_context.h:73
void reserve_leaves(const uint32 n)
Definition: kd_context.h:106
thrust::device_vector< T >::iterator begin(thrust::device_vector< T > &vec)
Definition: thrust_view.h:89
CUGAR_HOST_DEVICE void write_node(const uint32 node, const uint32 offset, const uint32 skip_node, const uint32 begin, const uint32 end)
write a new node
Definition: kd_context.h:65
void reserve_nodes(const uint32 n)
Definition: kd_context.h:98
Definition: kd_node.h:110
Cuda accessor struct.
Definition: kd_context.h:50
Kd_node * m_nodes
node pointer
Definition: kd_context.h:78
Context get_context()
Definition: kd_context.h:110
Kd_context(thrust::device_vector< Kd_node > *nodes, thrust::device_vector< uint2 > *leaves, thrust::device_vector< uint2 > *ranges)
Definition: kd_context.h:90
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
CUGAR_HOST_DEVICE void write_node(const uint32 node, const uint32 offset, const uint32 skip_node, const uint32 begin, const uint32 end, const uint32 split_index, const uint32 split_dim, const float split_plane)
write a new node
Definition: kd_context.h:57
uint2 * m_ranges
range pointer
Definition: kd_context.h:80
uint2 * m_leaves
leaf pointer
Definition: kd_context.h:79