Optimized Belief Propagation (CPU and GPU)
KernelBpStereoHalf.cu File Reference

This file defines the template specialization to perform belief propagation using half precision for disparity map estimation from stereo images on CUDA to prevent overflow in val_to_normalize message value computation shouldn't be an issue if using bfloat instead of half so recommend using that instead of using these template specialization functions. More...

Go to the source code of this file.

Functions

template<unsigned int DISP_VALS>
__device__ void MsgStereoHalf (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[DISP_VALS], half messages_neighbor_2[DISP_VALS], half messages_neighbor_3[DISP_VALS], half data_costs[DISP_VALS], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<beliefprop::MessageComp M>
__device__ void MsgStereoHalf (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half *prev_u_messageArray, half *prev_d_messageArray, half *prev_l_messageArray, half *prev_r_messageArray, half *data_message_array, half *dst_message_array, half disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, half *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kUMessage > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half *prev_u_messageArray, half *prev_d_messageArray, half *prev_l_messageArray, half *prev_r_messageArray, half *data_message_array, half *dst_message_array, half disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, half *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kDMessage > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half *prev_u_messageArray, half *prev_d_messageArray, half *prev_l_messageArray, half *prev_r_messageArray, half *data_message_array, half *dst_message_array, half disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, half *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kLMessage > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half *prev_u_messageArray, half *prev_d_messageArray, half *prev_l_messageArray, half *prev_r_messageArray, half *data_message_array, half *dst_message_array, half disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, half *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kRMessage > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half *prev_u_messageArray, half *prev_d_messageArray, half *prev_l_messageArray, half *prev_r_messageArray, half *data_message_array, half *dst_message_array, half disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, half *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<>
__device__ void MsgStereo< half, half, kDispVals0 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals0], half messages_neighbor_2[kDispVals0], half messages_neighbor_3[kDispVals0], half data_costs[kDispVals0], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals1 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals1], half messages_neighbor_2[kDispVals1], half messages_neighbor_3[kDispVals1], half data_costs[kDispVals1], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals2 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals2], half messages_neighbor_2[kDispVals2], half messages_neighbor_3[kDispVals2], half data_costs[kDispVals2], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals3 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals3], half messages_neighbor_2[kDispVals3], half messages_neighbor_3[kDispVals3], half data_costs[kDispVals3], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals4 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals4], half messages_neighbor_2[kDispVals4], half messages_neighbor_3[kDispVals4], half data_costs[kDispVals4], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals5 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals5], half messages_neighbor_2[kDispVals5], half messages_neighbor_3[kDispVals5], half data_costs[kDispVals5], half *dst_message_array, half disc_k_bp, bool data_aligned)
 
template<>
__device__ void MsgStereo< half, half, kDispVals6 > (unsigned int x_val, unsigned int y_val, const BpLevel< T > &current_bp_level, half messages_neighbor_1[kDispVals6], half messages_neighbor_2[kDispVals6], half messages_neighbor_3[kDispVals6], half data_costs[kDispVals6], half *dst_message_array, half disc_k_bp, bool data_aligned)
 

Variables

constexpr unsigned int kDispVals0 {beliefprop::kStereoSetsToProcess[0].num_disp_vals}
 
constexpr unsigned int kDispVals1 {beliefprop::kStereoSetsToProcess[1].num_disp_vals}
 
constexpr unsigned int kDispVals2 {beliefprop::kStereoSetsToProcess[2].num_disp_vals}
 
constexpr unsigned int kDispVals3 {beliefprop::kStereoSetsToProcess[3].num_disp_vals}
 
constexpr unsigned int kDispVals4 {beliefprop::kStereoSetsToProcess[4].num_disp_vals}
 
constexpr unsigned int kDispVals5 {beliefprop::kStereoSetsToProcess[5].num_disp_vals}
 
constexpr unsigned int kDispVals6 {beliefprop::kStereoSetsToProcess[6].num_disp_vals}
 

Detailed Description

This file defines the template specialization to perform belief propagation using half precision for disparity map estimation from stereo images on CUDA to prevent overflow in val_to_normalize message value computation shouldn't be an issue if using bfloat instead of half so recommend using that instead of using these template specialization functions.

Author
Scott Grauer-Gray

Definition in file KernelBpStereoHalf.cu.

Function Documentation

◆ MsgStereo< half, half, beliefprop::MessageComp::kDMessage >()

template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kDMessage > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half *  prev_u_messageArray,
half *  prev_d_messageArray,
half *  prev_l_messageArray,
half *  prev_r_messageArray,
half *  data_message_array,
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
half *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 240 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, beliefprop::MessageComp::kLMessage >()

template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kLMessage > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half *  prev_u_messageArray,
half *  prev_d_messageArray,
half *  prev_l_messageArray,
half *  prev_r_messageArray,
half *  data_message_array,
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
half *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 256 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, beliefprop::MessageComp::kRMessage >()

template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kRMessage > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half *  prev_u_messageArray,
half *  prev_d_messageArray,
half *  prev_l_messageArray,
half *  prev_r_messageArray,
half *  data_message_array,
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
half *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 272 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, beliefprop::MessageComp::kUMessage >()

template<>
__device__ void MsgStereo< half, half, beliefprop::MessageComp::kUMessage > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half *  prev_u_messageArray,
half *  prev_d_messageArray,
half *  prev_l_messageArray,
half *  prev_r_messageArray,
half *  data_message_array,
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
half *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 224 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals0 >()

template<>
__device__ void MsgStereo< half, half, kDispVals0 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals0],
half  messages_neighbor_2[kDispVals0],
half  messages_neighbor_3[kDispVals0],
half  data_costs[kDispVals0],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 288 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals1 >()

template<>
__device__ void MsgStereo< half, half, kDispVals1 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals1],
half  messages_neighbor_2[kDispVals1],
half  messages_neighbor_3[kDispVals1],
half  data_costs[kDispVals1],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 299 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals2 >()

template<>
__device__ void MsgStereo< half, half, kDispVals2 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals2],
half  messages_neighbor_2[kDispVals2],
half  messages_neighbor_3[kDispVals2],
half  data_costs[kDispVals2],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 310 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals3 >()

template<>
__device__ void MsgStereo< half, half, kDispVals3 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals3],
half  messages_neighbor_2[kDispVals3],
half  messages_neighbor_3[kDispVals3],
half  data_costs[kDispVals3],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 321 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals4 >()

template<>
__device__ void MsgStereo< half, half, kDispVals4 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals4],
half  messages_neighbor_2[kDispVals4],
half  messages_neighbor_3[kDispVals4],
half  data_costs[kDispVals4],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 332 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals5 >()

template<>
__device__ void MsgStereo< half, half, kDispVals5 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals5],
half  messages_neighbor_2[kDispVals5],
half  messages_neighbor_3[kDispVals5],
half  data_costs[kDispVals5],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 343 of file KernelBpStereoHalf.cu.

◆ MsgStereo< half, half, kDispVals6 >()

template<>
__device__ void MsgStereo< half, half, kDispVals6 > ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[kDispVals6],
half  messages_neighbor_2[kDispVals6],
half  messages_neighbor_3[kDispVals6],
half  data_costs[kDispVals6],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 354 of file KernelBpStereoHalf.cu.

◆ MsgStereoHalf() [1/2]

template<beliefprop::MessageComp M>
__device__ void MsgStereoHalf ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half *  prev_u_messageArray,
half *  prev_d_messageArray,
half *  prev_l_messageArray,
half *  prev_r_messageArray,
half *  data_message_array,
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
half *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 124 of file KernelBpStereoHalf.cu.

Here is the call graph for this function:

◆ MsgStereoHalf() [2/2]

template<unsigned int DISP_VALS>
__device__ void MsgStereoHalf ( unsigned int  x_val,
unsigned int  y_val,
const BpLevel< T > &  current_bp_level,
half  messages_neighbor_1[DISP_VALS],
half  messages_neighbor_2[DISP_VALS],
half  messages_neighbor_3[DISP_VALS],
half  data_costs[DISP_VALS],
half *  dst_message_array,
half  disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 43 of file KernelBpStereoHalf.cu.

Here is the call graph for this function:

Variable Documentation

◆ kDispVals0

constexpr unsigned int kDispVals0 {beliefprop::kStereoSetsToProcess[0].num_disp_vals}
constexpr

Definition at line 32 of file KernelBpStereoHalf.cu.

◆ kDispVals1

constexpr unsigned int kDispVals1 {beliefprop::kStereoSetsToProcess[1].num_disp_vals}
constexpr

Definition at line 33 of file KernelBpStereoHalf.cu.

◆ kDispVals2

constexpr unsigned int kDispVals2 {beliefprop::kStereoSetsToProcess[2].num_disp_vals}
constexpr

Definition at line 34 of file KernelBpStereoHalf.cu.

◆ kDispVals3

constexpr unsigned int kDispVals3 {beliefprop::kStereoSetsToProcess[3].num_disp_vals}
constexpr

Definition at line 35 of file KernelBpStereoHalf.cu.

◆ kDispVals4

constexpr unsigned int kDispVals4 {beliefprop::kStereoSetsToProcess[4].num_disp_vals}
constexpr

Definition at line 36 of file KernelBpStereoHalf.cu.

◆ kDispVals5

constexpr unsigned int kDispVals5 {beliefprop::kStereoSetsToProcess[5].num_disp_vals}
constexpr

Definition at line 37 of file KernelBpStereoHalf.cu.

◆ kDispVals6

constexpr unsigned int kDispVals6 {beliefprop::kStereoSetsToProcess[6].num_disp_vals}
constexpr

Definition at line 38 of file KernelBpStereoHalf.cu.