Public Attributes | |
integer * | count |
accumulated nodes/leaves beneath More... | |
integer * | start |
TODO: describe start. More... | |
integer * | child |
children/child nodes or leaves (beneath) More... | |
integer * | sorted |
sorted (indices) for better cache performance More... | |
integer * | index |
index used for counting nodes More... | |
integer * | toDeleteLeaf |
buffer for remembering old indices for rebuilding tree More... | |
integer * | toDeleteNode |
buffer for remembering old indices for rebuilding tree More... | |
real * | minX |
bounding box minimal x More... | |
real * | maxX |
bounding box maximal x More... | |
real * | minY |
bounding box minimal y More... | |
real * | maxY |
bounding box maximal y More... | |
real * | minZ |
bounding box minimal z More... | |
real * | maxZ |
bounding box maximal z More... | |
Tree class.
Class to build and store hierarchical tree structure.
Since dynamic memory allocation and access to heap objects in GPUs are usually suboptimal, an array-based data structure is used to store the (pseudo-)particle information as well as the tree and allows for efficient cache alignment. Consequently, array indices are used instead of pointers to constitute the tree out of the tree nodes, whereas "-1" represents a null pointer and "-2" is used for locking nodes. For this purpose an array with the minimum length \( 2^{d} \cdot (M - N) \) with dimensionality \( d \) and number of cells \( (M -N) \) is needed to store the children. The \( i \)-th child of node \( c \) can therefore be accessed via index \( 2^d \cdot c + i \).
CUDA_CALLABLE_MEMBER Tree::Tree | ( | ) |
CUDA_CALLABLE_MEMBER Tree::Tree | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX | ||
) |
Constructor, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
CUDA_CALLABLE_MEMBER Tree::Tree | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX, | ||
real * | minY, | ||
real * | maxY | ||
) |
Constructor, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
minY | allocated value for bounding box minimal y |
maxY | allocated value for bounding box maximal y |
CUDA_CALLABLE_MEMBER Tree::Tree | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX, | ||
real * | minY, | ||
real * | maxY, | ||
real * | minZ, | ||
real * | maxZ | ||
) |
Constructor, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
minY | allocated value for bounding box minimal y |
maxY | allocated value for bounding box maximal y |
minZ | allocated value for bounding box minimal z |
maxZ | allocated value for bounding box maximal z |
CUDA_CALLABLE_MEMBER Tree::~Tree | ( | ) |
CUDA_CALLABLE_MEMBER keyType Tree::getParticleKey | ( | Particles * | particles, |
integer | index, | ||
integer | maxLevel, | ||
Curve::Type | curveType = Curve::lebesgue |
||
) |
Get SFC key of a particle.
The particle key computation can be accomplished by using the particle's location within the simulation domain, thus regarding the bounding boxes, which is equivalent to a tree traversing.
The Lebesgue keys can be converted via tables.
particles | instance of particles (array) |
index | desired index in particles to get tree of desired particle |
maxLevel | max tree level |
curveType | space-filling curve type to be assumed (Lebesgue/Hilbert) |
Definition at line 157 of file tree.cu.
CUDA_CALLABLE_MEMBER integer Tree::getTreeLevel | ( | Particles * | particles, |
integer | index, | ||
integer | maxLevel, | ||
Curve::Type | curveType = Curve::lebesgue |
||
) |
Get tree level for a (specific) particle.
Calculates the particle key and uses key to construct path within tree, returning when path lead to the desired particle/index of the particle.
particles | particles instance of particles (array) |
index | desired index in particles to get tree of desired particle |
maxLevel | max tree level |
curveType | space-filling curve type to be assumed (Lebesgue/Hilbert) |
Definition at line 242 of file tree.cu.
CUDA_CALLABLE_MEMBER void Tree::reset | ( | integer | index, |
integer | n | ||
) |
CUDA_CALLABLE_MEMBER void Tree::set | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX | ||
) |
Setter, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
CUDA_CALLABLE_MEMBER void Tree::set | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX, | ||
real * | minY, | ||
real * | maxY | ||
) |
Setter, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
minY | allocated value for bounding box minimal y |
maxY | allocated value for bounding box maximal y |
CUDA_CALLABLE_MEMBER void Tree::set | ( | integer * | count, |
integer * | start, | ||
integer * | child, | ||
integer * | sorted, | ||
integer * | index, | ||
integer * | toDeleteLeaf, | ||
integer * | toDeleteNode, | ||
real * | minX, | ||
real * | maxX, | ||
real * | minY, | ||
real * | maxY, | ||
real * | minZ, | ||
real * | maxZ | ||
) |
Constructor, passing pointer to member variables.
count | allocated array for accumulated nodes/leaves beneath |
start | allocated array for |
child | allocated array for children |
sorted | allocated array for sorted (indices) for better cache performance |
index | allocated value for index used for counting nodes |
toDeleteLeaf | allocated array for remembering old indices for rebuilding tree |
toDeleteNode | allocated array for remembering old indices for rebuilding tree |
minX | allocated value for bounding box minimal x |
maxX | allocated value for bounding box maximal x |
minY | allocated value for bounding box minimal y |
maxY | allocated value for bounding box maximal y |
minZ | allocated value for bounding box minimal z |
maxZ | allocated value for bounding box maximal z |
CUDA_CALLABLE_MEMBER integer Tree::sumParticles | ( | ) |
integer* Tree::child |
integer* Tree::count |
integer* Tree::sorted |
integer* Tree::toDeleteLeaf |
integer* Tree::toDeleteNode |