CUDA Wrapper Functions

Description

Collaboration diagram for CUDA Wrapper Functions:

Functions

void chrono::sensor::cuda_camera_noise_const_normal (unsigned char *bufPtr, int width, int height, float mean, float stdev, curandState_t *rng, CUstream &stream)
 Kernel for applying uniform Gaussian noise to an image. More...
 
void chrono::sensor::cuda_camera_noise_pixel_dependent (unsigned char *bufPtr, int width, int height, float variance_slope, float variance_intercept, curandState_t *rng, CUstream &stream)
 Kernel for applying pixel dependent Gaussian noise to an image. More...
 
__global__ void chrono::sensor::init_random_states (unsigned int seed, curandState_t *rng_states, int n_generators)
 Device function for initialing random values for cuRAND. More...
 
void chrono::sensor::init_cuda_rng (unsigned int seed, curandState_t *rng_states, int n_generators)
 Host function for initialing random values for cuRAND. More...
 
void chrono::sensor::cuda_grayscale (void *bufRGBA, void *bufOut, int width, int height, CUstream &stream)
 RGB 8 bpp image of uchar to greyscale image conversion. More...
 
void chrono::sensor::cuda_image_alias (void *bufIn, void *bufOut, int w_out, int h_out, int factor, int pix_size, CUstream &stream)
 An antialiasing helper function that reduces image quality by performing mean reduction of image. More...
 
void chrono::sensor::cuda_image_alias_float (void *bufIn, void *bufOut, int w_out, int h_out, int factor, int pix_size, CUstream &stream)
 An antialiasing helper function that reduces image quality by performing mean reduction of image. More...
 
void chrono::sensor::cuda_image_gauss_blur_char (void *buf, int w, int h, int c, int factor, CUstream &stream)
 An image blurring function that reduces performs Gaussian blur. More...
 
void chrono::sensor::cuda_image_half4_to_uchar4 (void *bufIn, void *bufOut, int w, int h, CUstream &stream)
 Conversion from half4 to uchar4. More...
 
void chrono::sensor::cuda_depth_to_uchar4 (void *bufIn, void *bufOut, int w, int h, CUstream &stream)
 Conversion from float depth value to uchar4. More...
 
void chrono::sensor::cuda_lidar_clip (float *buf, int width, int height, float threshold, float default_dist, CUstream &stream)
 Function for reduction of data when multiple samples are used per beam. More...
 
void chrono::sensor::cuda_lidar_noise_normal (float *bufPtr, int width, int height, float stdev_range, float stdev_v_angle, float stdev_h_angle, float stdev_intensity, curandState_t *rng, CUstream &stream)
 Function for applying Gaussian noise to raw ground truth lidar data. More...
 
void chrono::sensor::cuda_lidar_mean_reduce (void *bufIn, void *bufOut, int width, int height, int radius, CUstream &stream)
 Function for reduction of data when multiple samples are used per beam. More...
 
void chrono::sensor::cuda_lidar_strong_reduce (void *bufIn, void *bufOut, int width, int height, int radius, CUstream &stream)
 Function for reduction of data when multiple samples are used per beam. More...
 
void chrono::sensor::cuda_lidar_first_reduce (void *bufIn, void *bufOut, int width, int height, int radius, CUstream &stream)
 Function for reduction of data when multiple samples are used per beam. More...
 
void chrono::sensor::cuda_lidar_dual_reduce (void *bufIn, void *bufOut, int width, int height, int radius, CUstream &stream)
 Function for reduction of data when multiple samples are used per beam. More...
 
void chrono::sensor::preprocess_RGBA8_to_FLOAT3 (void *bufIn, void *bufOut, int h, int w)
 Function that converts uchar RGBA8 image to float3 image. More...
 
void chrono::sensor::preprocess_RGBA8_to_FLOAT4 (void *bufIn, void *bufOut, int num_entries)
 Function that converts uchar RGBA8 image to float4 image. More...
 
void chrono::sensor::postprocess_FLOAT4_to_RGBA8 (void *bufIn, void *bufOut, int num_entries)
 Function that converts float4 image to uchar RGBA8 image. More...
 
void chrono::sensor::preprocess_RGBA8_to_FLOAT4_CHW (void *bufIn, void *bufOut, int c, int h, int w)
 Function that converts uchar RGBA8 image to float4 image with channels first. More...
 
void chrono::sensor::preprocess_normalize_float (void *bufIn, float add, float mult, int c, int h, int w)
 Function that normalized input data in float format. More...
 
void chrono::sensor::postprocess_FLOAT4_to_RGBA8_CHW (void *bufIn, void *bufOut, int c, int h, int w)
 Function that converts float4 image to uchar RGBA8 image with channels first. More...
 
void chrono::sensor::cuda_pointcloud_from_depth (void *bufDI, void *bufOut, int width, int height, float hfov, float max_v_angle, float min_v_angle, CUstream &stream)
 Converts depth data to point cloud data for a lidar. More...
 
void chrono::sensor::cuda_pointcloud_from_depth_dual_return (void *bufDI, void *bufOut, int width, int height, float hfov, float max_v_angle, float min_v_angle, CUstream &stream)
 Converts depth data to point cloud data for a lidar when the mode is dual return. More...
 

Function Documentation

◆ cuda_camera_noise_const_normal()

void chrono::sensor::cuda_camera_noise_const_normal ( unsigned char *  bufPtr,
int  width,
int  height,
float  mean,
float  stdev,
curandState_t *  rng,
CUstream &  stream 
)

Kernel for applying uniform Gaussian noise to an image.

Parameters
bufPtrA uchar (values 0-255) pointer to device memory where the image is stored. Memory assumed to be row major and contiguous. (Flat array representing image).
widthThe width of the image in pixels.
heightThe height of the image in pixels.
meanThe mean of the Gaussian distribution to be sampled.
stdevThe standard deviation of the distribution to be sampled.
rngThe states to be randomly generated
streamThe cuda stream for the kernel launch

◆ cuda_camera_noise_pixel_dependent()

void chrono::sensor::cuda_camera_noise_pixel_dependent ( unsigned char *  bufPtr,
int  width,
int  height,
float  variance_slope,
float  variance_intercept,
curandState_t *  rng,
CUstream &  stream 
)

Kernel for applying pixel dependent Gaussian noise to an image.

Parameters
bufPtrA uchar (values 0-255) pointer to device memory where the image is stored. Memory assumed to be row major and contiguous. (Flat array representing image).
widthThe width of the image in pixels.
heightThe height of the image in pixels.
variance_slopeThe variance of multiplicative noise to be sampled.
variance_interceptThe variance of additive noise to be sampled.
rngThe states to be randomly generated
streamThe cuda stream for the kernel launch

◆ cuda_depth_to_uchar4()

void chrono::sensor::cuda_depth_to_uchar4 ( void *  bufIn,
void *  bufOut,
int  w,
int  h,
CUstream &  stream 
)

Conversion from float depth value to uchar4.

Parameters
bufInA device pointer to the image image.
bufOutA device pointer to the ouput image.
wThe output image width.
hThe output image height.
streamcuda stream for computation

◆ cuda_grayscale()

void chrono::sensor::cuda_grayscale ( void *  bufRGBA,
void *  bufOut,
int  width,
int  height,
CUstream &  stream 
)

RGB 8 bpp image of uchar to greyscale image conversion.

Parameters
bufRGBAThe input buffer of RGBA data in uchar format (8 bpp)
bufOutA pointer to the output buffer where greyscale data will be held (8 bpp)
widthThe width of the image
heightThe height of the image
streamThe cuda stream for the kernel

◆ cuda_image_alias()

void chrono::sensor::cuda_image_alias ( void *  bufIn,
void *  bufOut,
int  w_out,
int  h_out,
int  factor,
int  pix_size,
CUstream &  stream 
)

An antialiasing helper function that reduces image quality by performing mean reduction of image.

Parameters
bufInA device pointer to the image image.
bufOutA device pointer to the ouput image.
w_outThe output image width.
h_outThe output image height.
factorThe reduction factor per dimension.
pix_sizeSize of a pixel (number of channels).
streamcuda stream for computation

◆ cuda_image_alias_float()

void chrono::sensor::cuda_image_alias_float ( void *  bufIn,
void *  bufOut,
int  w_out,
int  h_out,
int  factor,
int  pix_size,
CUstream &  stream 
)

An antialiasing helper function that reduces image quality by performing mean reduction of image.

Parameters
bufInA device pointer to the image image.
bufOutA device pointer to the ouput image.
w_outThe output image width.
h_outThe output image height.
factorThe reduction factor per dimension.
pix_sizeSize of a pixel (number of channels).
streamcuda stream for computation

◆ cuda_image_gauss_blur_char()

void chrono::sensor::cuda_image_gauss_blur_char ( void *  buf,
int  w,
int  h,
int  c,
int  factor,
CUstream &  stream 
)

An image blurring function that reduces performs Gaussian blur.

Parameters
buf
w
h
c
factor
streamcuda stream for computation

◆ cuda_image_half4_to_uchar4()

void chrono::sensor::cuda_image_half4_to_uchar4 ( void *  bufIn,
void *  bufOut,
int  w,
int  h,
CUstream &  stream 
)

Conversion from half4 to uchar4.

Parameters
bufInA device pointer to the image image.
bufOutA device pointer to the ouput image.
wThe output image width.
hThe output image height.
streamcuda stream for computation

◆ cuda_lidar_clip()

void chrono::sensor::cuda_lidar_clip ( float *  buf,
int  width,
int  height,
float  threshold,
float  default_dist,
CUstream &  stream 
)

Function for reduction of data when multiple samples are used per beam.

The performs a mean average of the data with the sample radius.

Parameters
bufInput/output device pointer to raw lidar data. Computation will be done in-place
widthWidth of the input data
heightHeight of the inpute data
thresholdIntensity threshold for removing points
default_distDefault distance to use when removing points
streamThe cuda stream used for processing the kernel

◆ cuda_lidar_dual_reduce()

void chrono::sensor::cuda_lidar_dual_reduce ( void *  bufIn,
void *  bufOut,
int  width,
int  height,
int  radius,
CUstream &  stream 
)

Function for reduction of data when multiple samples are used per beam.

The calculates the strongest and first return the data structure is [[strongest, first], [strongest, first], [strongest, first]....]

Parameters
bufInInput device pointed to raw lidar data.
bufOutOutout device pointer for processed lidar data.
widthWidth of the input data.
heightHeight of the inpute data.
radiusRadius in samples of the beam to be reduced.
streamCuda stream for launching the kernel

◆ cuda_lidar_first_reduce()

void chrono::sensor::cuda_lidar_first_reduce ( void *  bufIn,
void *  bufOut,
int  width,
int  height,
int  radius,
CUstream &  stream 
)

Function for reduction of data when multiple samples are used per beam.

The calculates the first return within the sample radius of the beam.

Parameters
bufInInput device pointed to raw lidar data.
bufOutOutout device pointer for processed lidar data.
widthWidth of the input data.
heightHeight of the inpute data.
radiusRadius in samples of the beam to be reduced.
streamCuda stream for launching the kernel

◆ cuda_lidar_mean_reduce()

void chrono::sensor::cuda_lidar_mean_reduce ( void *  bufIn,
void *  bufOut,
int  width,
int  height,
int  radius,
CUstream &  stream 
)

Function for reduction of data when multiple samples are used per beam.

The performs a mean average of the data with the sample radius.

Parameters
bufInInput device pointed to raw lidar data.
bufOutOutout device pointer for processed lidar data.
widthWidth of the input data.
heightHeight of the inpute data.
radiusRadius in samples of the beam to be reduced.
streamCuda stream for launching the kernel

◆ cuda_lidar_noise_normal()

void chrono::sensor::cuda_lidar_noise_normal ( float *  bufPtr,
int  width,
int  height,
float  stdev_range,
float  stdev_v_angle,
float  stdev_h_angle,
float  stdev_intensity,
curandState_t *  rng,
CUstream &  stream 
)

Function for applying Gaussian noise to raw ground truth lidar data.

Independent for range, intensity, and angles

Parameters
bufPtrDevice pointer to depth/intensity lidar data.
widthWidth of lidar data buffer.
heightHeight of lidar data buffer.
stdev_rangeStandard deviation for lidar range.
stdev_v_angleStandard deviation of noise for vertical angle measurement
stdev_h_angleStandard deviation of noise for horizontal angle measurement.
stdev_intensityStandard deviation of noise for vertical angle measurement.
rngThe state to be randomly generated
streamThe cuda stream for the kernel launch

◆ cuda_lidar_strong_reduce()

void chrono::sensor::cuda_lidar_strong_reduce ( void *  bufIn,
void *  bufOut,
int  width,
int  height,
int  radius,
CUstream &  stream 
)

Function for reduction of data when multiple samples are used per beam.

The calculates the strongest return within the sample radius of the beam.

Parameters
bufInInput device pointed to raw lidar data.
bufOutOutout device pointer for processed lidar data.
widthWidth of the input data.
heightHeight of the inpute data.
radiusRadius in samples of the beam to be reduced.
streamCuda stream for launching the kernel

◆ cuda_pointcloud_from_depth()

void chrono::sensor::cuda_pointcloud_from_depth ( void *  bufDI,
void *  bufOut,
int  width,
int  height,
float  hfov,
float  max_v_angle,
float  min_v_angle,
CUstream &  stream 
)

Converts depth data to point cloud data for a lidar.

Parameters
bufDIA device pointer to depth/intensity data from a lidar.
bufOutA device pointer to when the point cloud data will be stored.
widthThe width of the lidar data.
heightThe height of the lidar data.
hfovThe horizontal field of view of the lidar.
max_v_angleThe maximun vertical fov angle of the lidar
min_v_angleThe minimum vertical fov angle for the lidar
streamThe cuda stream for the kernel

◆ cuda_pointcloud_from_depth_dual_return()

void chrono::sensor::cuda_pointcloud_from_depth_dual_return ( void *  bufDI,
void *  bufOut,
int  width,
int  height,
float  hfov,
float  max_v_angle,
float  min_v_angle,
CUstream &  stream 
)

Converts depth data to point cloud data for a lidar when the mode is dual return.

Parameters
bufDIA device pointer to depth/intensity data from a lidar.
bufOutA device pointer to when the point cloud data will be stored.
widthThe width of the lidar data.
heightThe height of the lidar data.
hfovThe horizontal field of view of the lidar.
max_v_angleThe maximun vertical fov angle of the lidar
min_v_angleThe minimum vertical fov angle for the lidar
streamThe cuda stream for the kernel

◆ init_cuda_rng()

void chrono::sensor::init_cuda_rng ( unsigned int  seed,
curandState_t *  rng_states,
int  n_generators 
)

Host function for initialing random values for cuRAND.

Parameters
seedRandom number generator seed.
rng_statesThe states to be randomly generated.
n_generatorsThe number of random value generators we need.

◆ init_random_states()

__global__ void chrono::sensor::init_random_states ( unsigned int  seed,
curandState_t *  rng_states,
int  n_generators 
)

Device function for initialing random values for cuRAND.

Parameters
seedRandom number generator seed.
rng_statesThe states to be randomly generated.
n_generatorsThe number of random value generators we need.

◆ postprocess_FLOAT4_to_RGBA8()

void chrono::sensor::postprocess_FLOAT4_to_RGBA8 ( void *  bufIn,
void *  bufOut,
int  num_entries 
)

Function that converts float4 image to uchar RGBA8 image.

Parameters
bufInInput device pointer in float format.
bufOutOutput device pointer in uchar format.
num_entriesThe number of entries in the image (c*h*w).

◆ postprocess_FLOAT4_to_RGBA8_CHW()

void chrono::sensor::postprocess_FLOAT4_to_RGBA8_CHW ( void *  bufIn,
void *  bufOut,
int  c,
int  h,
int  w 
)

Function that converts float4 image to uchar RGBA8 image with channels first.

Parameters
bufInInput device pointer in float format.
bufOutOutput device pointer in uchar format.
cNumber of channels in the image.
hHeight of the image.
wWidth of the image.

◆ preprocess_normalize_float()

void chrono::sensor::preprocess_normalize_float ( void *  bufIn,
float  add,
float  mult,
int  c,
int  h,
int  w 
)

Function that normalized input data in float format.

Parameters
bufInInput device pointer in float format.
add
mult
cNumber of channels in the image.
hHeight of the image.
wWidth of the image.

◆ preprocess_RGBA8_to_FLOAT3()

void chrono::sensor::preprocess_RGBA8_to_FLOAT3 ( void *  bufIn,
void *  bufOut,
int  h,
int  w 
)

Function that converts uchar RGBA8 image to float3 image.

Parameters
bufInInput device pointer in uchar format.
bufOutOutput device pointer in float format.
hThe height of the image.
wThe width of the image.

◆ preprocess_RGBA8_to_FLOAT4()

void chrono::sensor::preprocess_RGBA8_to_FLOAT4 ( void *  bufIn,
void *  bufOut,
int  num_entries 
)

Function that converts uchar RGBA8 image to float4 image.

Parameters
bufInInput device pointer in uchar format.
bufOutOutput device pointer in float format.
num_entriesThe number of entries in the image (c*h*w).

◆ preprocess_RGBA8_to_FLOAT4_CHW()

void chrono::sensor::preprocess_RGBA8_to_FLOAT4_CHW ( void *  bufIn,
void *  bufOut,
int  c,
int  h,
int  w 
)

Function that converts uchar RGBA8 image to float4 image with channels first.

Parameters
bufInInput device pointer in uchar format.
bufOutOutput device pointer in float format.
cNumber of channels in the image.
hHeight of the image.
wWidth of the image.