Optimized Belief Propagation (CPU and GPU)
BpLevel< T > Class Template Reference

Class to store and retrieve properties of a bp processing level including a data type specified as a class template parameter. More...

#include <BpLevel.h>

Public Member Functions

 BpLevel (const std::array< unsigned int, 2 > &width_height, std::size_t offset_into_arrays, unsigned int level_num, run_environment::AccSetting acc_setting)
 Construct a new BpLevel object with specified height/wdith, offset into data/message arrays, level number, and acceleration setting. More...
 
 BpLevel (const std::array< unsigned int, 2 > &width_height, std::size_t offset_into_arrays, unsigned int level_num, unsigned int bytes_align_memory)
 Construct a new BpLevel object with specified height/wdith, offset into data/message arrays, level number, and byte alignment for memory. More...
 
BpLevel NextBpLevel (unsigned int num_disparity_values) const
 Get bp level properties for next (higher) level in hierarchy that processes data with half width/height of current level. More...
 
std::size_t NumDataInBpArrays (unsigned int num_disparity_values) const
 Get the amount of data in each BP array (data cost/messages for each checkerboard) at the current level with the specified number of possible disparity values. More...
 
unsigned int CheckerboardWidth (unsigned int width_level) const
 Get width of checkerboard to use in bp processing at level.
Checkerboard width is half of the width of the level. More...
 
unsigned int PaddedCheckerboardWidth (unsigned int checkerboard_width) const
 Get width of padded checkerboard to use in bp processing at level.
Padding can add additional width to checkerboard so that reading/writing data starting at x=0 in the checkerboard is aligned for processing using target acceleration (SIMD, CUDA, etc.). More...
 
std::size_t NumDataForAlignedMemoryAtLevel (const std::array< unsigned int, 2 > &width_height_level, unsigned int num_possible_disparities) const
 Get count of total data needed for bp processing at level. More...
 
const beliefprop::BpLevelPropertiesLevelProperties () const
 Return level properties as const reference to avoid copying and not allow it to be modified. More...
 

Static Public Member Functions

static std::size_t TotalDataForAlignedMemoryAllLevels (const std::array< unsigned int, 2 > &width_height_bottom_level, unsigned int num_possible_disparities, unsigned int num_levels, run_environment::AccSetting acceleration)
 Static function to get count of total data needed for bp processing at all levels. More...
 

Detailed Description

template<RunData_t T>
class BpLevel< T >

Class to store and retrieve properties of a bp processing level including a data type specified as a class template parameter.

Definition at line 59 of file BpLevel.h.

Constructor & Destructor Documentation

◆ BpLevel() [1/2]

template<RunData_t T>
BpLevel< T >::BpLevel ( const std::array< unsigned int, 2 > &  width_height,
std::size_t  offset_into_arrays,
unsigned int  level_num,
run_environment::AccSetting  acc_setting 
)
explicit

Construct a new BpLevel object with specified height/wdith, offset into data/message arrays, level number, and acceleration setting.

Parameters
width_height
offset_into_arrays
level_num
acc_setting

Definition at line 174 of file BpLevel.h.

Here is the call graph for this function:

◆ BpLevel() [2/2]

template<RunData_t T>
BpLevel< T >::BpLevel ( const std::array< unsigned int, 2 > &  width_height,
std::size_t  offset_into_arrays,
unsigned int  level_num,
unsigned int  bytes_align_memory 
)
explicit

Construct a new BpLevel object with specified height/wdith, offset into data/message arrays, level number, and byte alignment for memory.

Parameters
width_height
offset_into_arrays
level_num
bytes_align_memory

Definition at line 194 of file BpLevel.h.

Member Function Documentation

◆ CheckerboardWidth()

template<RunData_t T>
unsigned int BpLevel< T >::CheckerboardWidth ( unsigned int  width_level) const

Get width of checkerboard to use in bp processing at level.
Checkerboard width is half of the width of the level.

Parameters
width_level
Returns
Width of checkerboard used in bp processing at level

Definition at line 262 of file BpLevel.h.

◆ LevelProperties()

template<RunData_t T>
const beliefprop::BpLevelProperties& BpLevel< T >::LevelProperties ( ) const
inline

Return level properties as const reference to avoid copying and not allow it to be modified.

Returns
BpLevelProperties "POD" struct with level properties

Definition at line 165 of file BpLevel.h.

Here is the caller graph for this function:

◆ NextBpLevel()

template<RunData_t T>
BpLevel< T > BpLevel< T >::NextBpLevel ( unsigned int  num_disparity_values) const

Get bp level properties for next (higher) level in hierarchy that processes data with half width/height of current level.

Parameters
num_disparity_values
Returns
BpLevel object for next level in hierarchy

Definition at line 214 of file BpLevel.h.

Here is the caller graph for this function:

◆ NumDataForAlignedMemoryAtLevel()

template<RunData_t T>
std::size_t BpLevel< T >::NumDataForAlignedMemoryAtLevel ( const std::array< unsigned int, 2 > &  width_height_level,
unsigned int  num_possible_disparities 
) const

Get count of total data needed for bp processing at level.

Parameters
width_height_level
num_possible_disparities
Returns
Count of total data needed for bp processing at level

Definition at line 240 of file BpLevel.h.

◆ NumDataInBpArrays()

template<RunData_t T>
std::size_t BpLevel< T >::NumDataInBpArrays ( unsigned int  num_disparity_values) const

Get the amount of data in each BP array (data cost/messages for each checkerboard) at the current level with the specified number of possible disparity values.

Parameters
num_disparity_values
Returns
Num data needed in each "belief propagation" array at level

Definition at line 231 of file BpLevel.h.

Here is the caller graph for this function:

◆ PaddedCheckerboardWidth()

template<RunData_t T>
unsigned int BpLevel< T >::PaddedCheckerboardWidth ( unsigned int  checkerboard_width) const

Get width of padded checkerboard to use in bp processing at level.
Padding can add additional width to checkerboard so that reading/writing data starting at x=0 in the checkerboard is aligned for processing using target acceleration (SIMD, CUDA, etc.).

Parameters
width_level
Returns
Width of checkerboard used in bp processing at level

Definition at line 269 of file BpLevel.h.

◆ TotalDataForAlignedMemoryAllLevels()

template<RunData_t T>
std::size_t BpLevel< T >::TotalDataForAlignedMemoryAllLevels ( const std::array< unsigned int, 2 > &  width_height_bottom_level,
unsigned int  num_possible_disparities,
unsigned int  num_levels,
run_environment::AccSetting  acceleration 
)
static

Static function to get count of total data needed for bp processing at all levels.

Parameters
width_height_bottom_level
num_possible_disparities
num_levels
acceleration
Returns
Count of total data needed for bp processing

Definition at line 282 of file BpLevel.h.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: