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)
 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 gain, float sigma_read, float sigma_adc, curandState_t *rng)
 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)
 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)
 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)
 An image blurring function that reduces performs Gaussian blur. More...
 
void chrono::sensor::cuda_lidar_clip (float *buf, int width, int height, float threshold, float default_dist)
 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)
 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)
 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)
 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 *buf, 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)
 Converts depth data to point cloud data for a lidar. 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 
)

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.

◆ cuda_camera_noise_pixel_dependent()

void chrono::sensor::cuda_camera_noise_pixel_dependent ( unsigned char *  bufPtr,
int  width,
int  height,
float  gain,
float  sigma_read,
float  sigma_adc,
curandState_t *  rng 
)

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.
gainThe linear coefficient of correlation between pixel intensity and noise variance
sigma_readThe standard deviation of multiplicative noise to be sampled.
sigma_adcThe standard deviation of additive noise to be sampled.

◆ cuda_grayscale()

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

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

◆ cuda_image_alias()

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

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).

◆ cuda_image_gauss_blur_char()

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

An image blurring function that reduces performs Gaussian blur.

Parameters
buf
w
h
c
factor

◆ cuda_lidar_clip()

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

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

◆ cuda_lidar_mean_reduce()

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

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.

◆ 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 
)

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_h_angleStandard deviation of noise for horizontal angle measurement.
stdev_intensityStandard deviation of noise for vertical angle measurement.

◆ cuda_lidar_strong_reduce()

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

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.

◆ 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 
)

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.
vfovThe vertical field of view of the lidar.

◆ 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 *  buf,
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.
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.