Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Functions
MortonCodeSet.hpp File Reference
#include "shambase/aliases_int.hpp"
#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/DeviceScheduler.hpp"
#include "shambackends/vec.hpp"
#include "shammath/AABB.hpp"
+ Include dependency graph for MortonCodeSet.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  shamtree::MortonCodeSet< Tmorton, Tvec, dim >
 Class representing a set of Morton codes with associated bounding box and position data. More...
 

Functions

template<class Tmorton , class Tvec , u32 dim>
MortonCodeSet< Tmorton, Tvec, dim > shamtree::morton_code_set_from_positions (const sham::DeviceScheduler_ptr &dev_sched, shammath::AABB< Tvec > bounding_box, sham::DeviceBuffer< Tvec > &pos_buf, u32 cnt_obj, u32 morton_count, sham::DeviceBuffer< Tmorton > &&cache_buf_morton_codes)
 Generate a set of Morton codes from a buffer of positions.
 
template<class Tmorton , class Tvec , u32 dim>
MortonCodeSet< Tmorton, Tvec, dim > shamtree::morton_code_set_from_positions (const sham::DeviceScheduler_ptr &dev_sched, shammath::AABB< Tvec > bounding_box, sham::DeviceBuffer< Tvec > &pos_buf, u32 cnt_obj, u32 morton_count)
 Generate a set of Morton codes from a buffer of positions.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file MortonCodeSet.hpp.

Function Documentation

◆ morton_code_set_from_positions() [1/2]

template<class Tmorton , class Tvec , u32 dim>
MortonCodeSet< Tmorton, Tvec, dim > shamtree::morton_code_set_from_positions ( const sham::DeviceScheduler_ptr &  dev_sched,
shammath::AABB< Tvec >  bounding_box,
sham::DeviceBuffer< Tvec > &  pos_buf,
u32  cnt_obj,
u32  morton_count 
)

Generate a set of Morton codes from a buffer of positions.

Parameters
dev_schedThe device scheduler for the computation
bounding_boxThe bounding box containing all positions
pos_bufThe device buffer containing the positions
cnt_objThe count of objects in the buffer
morton_countThe count of Morton codes in the output set (can be different from cnt_obj)

If morton_count > cnt_obj, the extra Morton codes will be set to an error code larger than any valid Morton code.

Returns
The MortonCodeSet, containing the bounding box, the count of objects and the Morton codes. The Morton codes are sorted in ascending order.
Note
morton_count >= cnt_obj

Definition at line 121 of file MortonCodeSet.cpp.

+ Here is the call graph for this function:

◆ morton_code_set_from_positions() [2/2]

template<class Tmorton , class Tvec , u32 dim>
MortonCodeSet< Tmorton, Tvec, dim > shamtree::morton_code_set_from_positions ( const sham::DeviceScheduler_ptr &  dev_sched,
shammath::AABB< Tvec >  bounding_box,
sham::DeviceBuffer< Tvec > &  pos_buf,
u32  cnt_obj,
u32  morton_count,
sham::DeviceBuffer< Tmorton > &&  cache_buf_morton_codes 
)

Generate a set of Morton codes from a buffer of positions.

Parameters
dev_schedThe device scheduler for the computation
bounding_boxThe bounding box containing all positions
pos_bufThe device buffer containing the positions
cnt_objThe count of objects in the buffer
morton_countThe count of Morton codes in the output set (can be different from cnt_obj)
cache_buf_morton_codesA device buffer to be reused for the output Morton codes

If morton_count > cnt_obj, the extra Morton codes will be set to an error code larger than any valid Morton code.

Returns
The MortonCodeSet, containing the bounding box, the count of objects and the Morton codes. The Morton codes are sorted in ascending order.
Note
morton_count >= cnt_obj

Definition at line 63 of file MortonCodeSet.cpp.

+ Here is the call graph for this function: