Template Function nvcv::cuda::CreateBorderWrapNHW

Function Documentation

template<typename T, NVCVBorderType B, class = Require<HasTypeTraits<T>>>
__host__ auto nvcv::cuda::CreateBorderWrapNHW(const TensorDataStridedCuda &tensor, T borderValue = {})

Factory function to create an NHW border wrap given a tensor data.

The output BorderWrap wraps an NHW 3D tensor allowing to access data per batch (N), per row (H) and per column (W) of the input tensor border aware in rows (or height H) and columns (or width W). The input tensor data must have either NHWC or HWC layout, where the channel C is inside the given template type T, e.g. T=uchar4 for RGBA8. The active dimensions are H (second) and W (third).

Template Parameters:
  • T – Type of the values to be accessed in the border wrap.

  • B – Border extension to be used when accessing H and W, one of NVCVBorderType

Parameters:
  • tensor[in] Reference to the tensor that will be wrapped.

  • borderValue[in] Border value to be used when accessing outside elements in constant border type

Returns:

Border wrap useful to access tensor data border aware in H and W in CUDA kernels.