28 #ifndef BP_RUN_UTILS_H
29 #define BP_RUN_UTILS_H
32 #include <string_view>
53 #if defined(OPTIMIZED_CPU_RUN)
54 #if defined(FLOAT16_VECTORIZATION)
59 const _Float16 kHighValBp<_Float16>(65504);
65 #if defined(OPTIMIZED_CUDA_RUN)
68 #if defined(USE_BFLOAT16_FOR_HALF_PRECISION)
69 #include <cuda_bf16.h>
72 const __nv_bfloat16 kHighValBp<__nv_bfloat16>{CUDART_MAX_NORMAL_BF16};
74 #include <cuda_fp16.h>
77 const half kHighValBp<half>{CUDART_MAX_NORMAL_FP16};
92 #if defined(FEWER_RUNS_PER_CONFIG)
97 if (disparity_vals > 100) {
118 constexpr std::string_view
kMemAllocOptHeader{
"Memory allocation of all BP data run at or before start of run"};
138 return curr_run_data;
151 template <RunData_t T>
153 unsigned int x_val_data_start,
154 unsigned int simd_data_size,
155 unsigned int data_bytes_align_width,
156 unsigned int padded_width_data)
160 return (((x_val_data_start % simd_data_size) == 0) &&
161 (padded_width_data % ((data_bytes_align_width /
sizeof(T))) == 0));
Declares class to store headers with data corresponding to current program run and evaluation.
Contains namespace with constants and enums related to run environment and settings for run.
Define constraints for data type in processing.
Class to store headers with data corresponding to current program run and evaluation.
void AddDataWHeader(const std::string &header, const std::string &data)
Add string data with header describing added data.
Namespace for enums, constants, structures, and functions specific to belief propagation processing.
constexpr bool kOptimizedIndexingSetting
constexpr bool kAllocateFreeBpMemoryOutsideRuns
RunData RunSettings()
Retrieve run settings as a RunData object for output.
constexpr std::string_view kAllocateFreeMemOutsideRunsHeader
constexpr std::string_view kMemoryCoalescedBpDataHeader
constexpr bool kUseOptMemManagement
bool MemoryAlignedAtDataStart(unsigned int x_val_data_start, unsigned int simd_data_size, unsigned int data_bytes_align_width, unsigned int padded_width_data)
Inline function to check if data is aligned at x_val_data_start for SIMD loads/stores that require al...
const T kHighValBp
High value for type to use if initializing to "high" value.
unsigned int NumBpStereoRuns(unsigned int disparity_vals)
Get number of stereo runs when evaluating implementation Perform less stereo runs if greater number o...
constexpr std::string_view kMemAllocOptHeader
constexpr float kHighValBpKernel
High value as used in kernel currently hard-coded to be below maximum short value of 32767.