RPPT Tensor Operations - Statistical Operations.

RPPT Tensor Operations - Statistical Operations.#

RPP: RPPT Tensor Operations - Statistical Operations.
RPPT Tensor Operations - Statistical Operations.

RPPT Tensor Operations - Statistical Operations. More...

Functions

RppStatus rppt_tensor_sum_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorSumArr, Rpp32u tensorSumArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor sum operation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_sum_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorSumArr, Rpp32u tensorSumArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor sum operation on HIP backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_min_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t minArr, Rpp32u minArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor min operation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_min_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t imageMinArr, Rpp32u imageMinArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor min operation on HIP backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_max_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t maxArr, Rpp32u maxArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor max operation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_max_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t imageMaxArr, Rpp32u imageMaxArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor max operation on HIP backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_normalize_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u axisMask, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp8u computeMeanStddev, Rpp32f scale, Rpp32f shift, Rpp32u *roiTensor, rppHandle_t rppHandle)
 Normalize Generic augmentation on HOST backend. More...
 
RppStatus rppt_normalize_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u axisMask, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp8u computeMeanStddev, Rpp32f scale, Rpp32f shift, Rpp32u *roiTensor, rppHandle_t rppHandle)
 Normalize Generic augmentation on HIP backend. More...
 
RppStatus rppt_tensor_mean_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorMeanArr, Rpp32u tensorMeanArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor mean operation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_mean_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorMeanArr, Rpp32u tensorMeanArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor mean operation on HIP backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_stddev_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorStddevArr, Rpp32u tensorStddevArrLength, Rpp32f *meanTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor stddev operation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_tensor_stddev_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorStddevArr, Rpp32u tensorStddevArrLength, Rpp32f *meanTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Tensor stddev operation on HIP backend for a NCHW/NHWC layout tensor. More...
 

Detailed Description

RPPT Tensor Operations - Statistical Operations.

Function Documentation

◆ rppt_normalize_gpu()

RppStatus rppt_normalize_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32u  axisMask,
Rpp32f meanTensor,
Rpp32f stdDevTensor,
Rpp8u  computeMeanStddev,
Rpp32f  scale,
Rpp32f  shift,
Rpp32u roiTensor,
rppHandle_t  rppHandle 
)

Normalize Generic augmentation on HIP backend.

Normalizes the input generic ND buffer by removing the mean and dividing by the standard deviation for a given ND Tensor.

Parameters
[in]srcPtrsource tensor memory in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor memory in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]axisMaskaxis along which normalization needs to be done
[in]meanTensorvalues to be subtracted from input
[in]stdDevTensorstandard deviation values to scale the input
[in]computeMeanStddevflag to represent internal computation of mean, stddev (Wherein 0th bit used to represent computeMean and 1st bit for computeStddev, 0- Externally provided)
[in]scalevalue to be multiplied with data after subtracting from mean
[in]shiftvalue to be added finally
[in]roiTensorvalues to represent dimensions of input tensor
[in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_normalize_host()

RppStatus rppt_normalize_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32u  axisMask,
Rpp32f meanTensor,
Rpp32f stdDevTensor,
Rpp8u  computeMeanStddev,
Rpp32f  scale,
Rpp32f  shift,
Rpp32u roiTensor,
rppHandle_t  rppHandle 
)

Normalize Generic augmentation on HOST backend.

Normalizes the input generic ND buffer by removing the mean and dividing by the standard deviation for a given ND Tensor. Supports u8->f32, i8->f32, f16->f16 and f32->f32 datatypes. Also has toggle variant(NHWC->NCHW) support for 3D.

Parameters
[in]srcPtrsource tensor memory in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor memory in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]axisMaskaxis along which normalization needs to be done
[in]meanTensorvalues to be subtracted from input
[in]stdDevTensorstandard deviation values to scale the input
[in]computeMeanStddevflag to represent internal computation of mean, stddev (Wherein 0th bit used to represent computeMean and 1st bit for computeStddev, 0- Externally provided)
[in]scalevalue to be multiplied with data after subtracting from mean
[in]shiftvalue to be added finally
[in]roiTensorvalues to represent dimensions of input tensor
[in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_max_gpu()

RppStatus rppt_tensor_max_gpu ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  imageMaxArr,
Rpp32u  imageMaxArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor max operation on HIP backend for a NCHW/NHWC layout tensor.

The tensor max is a reduction operation that finds the channel-wise (R max / G max / B max) and overall max for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HIP memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]maxArrdestination array in HIP memory
    [in]maxArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HIP memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HIP handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_max_host()

RppStatus rppt_tensor_max_host ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  maxArr,
Rpp32u  maxArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor max operation on HOST backend for a NCHW/NHWC layout tensor.

The tensor max is a reduction operation that finds the channel-wise (R max / G max / B max) and overall max for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HOST memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]maxArrdestination array in HOST memory
    [in]maxArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HOST memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_mean_gpu()

RppStatus rppt_tensor_mean_gpu ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorMeanArr,
Rpp32u  tensorMeanArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor mean operation on HIP backend for a NCHW/NHWC layout tensor.

The tensor mean is a reduction operation that finds the channel-wise (R mean / G mean / B mean) and total mean for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HIP memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorMeanArrdestination array in HIP memory
    [in]tensorMeanArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorMeanArrLength = srcDescPtr->n, and if srcDescPtr->c == 3 then tensorMeanArrLength = srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HIP memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_mean_host()

RppStatus rppt_tensor_mean_host ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorMeanArr,
Rpp32u  tensorMeanArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor mean operation on HOST backend for a NCHW/NHWC layout tensor.

The tensor mean is a reduction operation that finds the channel-wise (R mean / G mean / B mean) and total mean for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HOST memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorMeanArrdestination array in HOST memory
    [in]tensorMeanArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorMeanArrLength = srcDescPtr->n, and if srcDescPtr->c == 3 then tensorMeanArrLength = srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HOST memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_min_gpu()

RppStatus rppt_tensor_min_gpu ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  imageMinArr,
Rpp32u  imageMinArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor min operation on HIP backend for a NCHW/NHWC layout tensor.

The tensor min is a reduction operation that finds the channel-wise (R min / G min / B min) and overall min for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HIP memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]minArrdestination array in HIP memory
    [in]minArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HIP memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_min_host()

RppStatus rppt_tensor_min_host ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  minArr,
Rpp32u  minArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor min operation on HOST backend for a NCHW/NHWC layout tensor.

The tensor min is a reduction operation that finds the channel-wise (R min / G min / B min) and overall min for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HOST memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]minArrdestination array in HOST memory
    [in]minArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HOST memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_stddev_gpu()

RppStatus rppt_tensor_stddev_gpu ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorStddevArr,
Rpp32u  tensorStddevArrLength,
Rpp32f meanTensor,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor stddev operation on HIP backend for a NCHW/NHWC layout tensor.

The tensor stddev is a reduction operation that finds the channel-wise (R stddev / G stddev / B stddev) and total standard deviation for each image with respect to meanTensor passed.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HIP memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorStddevArrdestination array in HIP memory
    [in]tensorStddevArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorStddevArrLength = srcDescPtr->n, and if srcDescPtr->c == 3 then tensorStddevArrLength = srcDescPtr->n * 4)
    [in]meanTensormean values for stddev calculation (1D tensor of size batchSize * 4 in format (MeanR, MeanG, MeanB, MeanImage) for each image in batch)
    [in]roiTensorPtrSrcROI data in HIP memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_stddev_host()

RppStatus rppt_tensor_stddev_host ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorStddevArr,
Rpp32u  tensorStddevArrLength,
Rpp32f meanTensor,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor stddev operation on HOST backend for a NCHW/NHWC layout tensor.

The tensor stddev is a reduction operation that finds the channel-wise (R stddev / G stddev / B stddev) and total standard deviation for each image with respect to meanTensor passed.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HOST memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorStddevArrdestination array in HOST memory
    [in]tensorStddevArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorStddevArrLength = srcDescPtr->n, and if srcDescPtr->c == 3 then tensorStddevArrLength = srcDescPtr->n * 4)
    [in]meanTensormean values for stddev calculation (1D tensor of size batchSize * 4 in format (MeanR, MeanG, MeanB, MeanImage) for each image in batch)
    [in]roiTensorPtrSrcROI data in HOST memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_sum_gpu()

RppStatus rppt_tensor_sum_gpu ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorSumArr,
Rpp32u  tensorSumArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor sum operation on HIP backend for a NCHW/NHWC layout tensor.

The tensor sum is a reduction operation that finds the channel-wise (R sum / G sum / B sum) and total sum for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HIP memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorSumArrdestination array in HIP memory
    [in]tensorSumArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HIP memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_tensor_sum_host()

RppStatus rppt_tensor_sum_host ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  tensorSumArr,
Rpp32u  tensorSumArrLength,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Tensor sum operation on HOST backend for a NCHW/NHWC layout tensor.

The tensor sum is a reduction operation that finds the channel-wise (R sum / G sum / B sum) and total sum for each image in a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
  • dstPtr depth ranges - Will be same depth as srcPtr.
    Parameters
    [in]srcPtrsource tensor in HOST memory
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
    [out]tensorSumArrdestination array in HOST memory
    [in]tensorSumArrLengthlength of provided destination array (Restrictions - if srcDescPtr->c == 1 then tensorSumArrLength >= srcDescPtr->n, and if srcDescPtr->c == 3 then tensorSumArrLength >= srcDescPtr->n * 4)
    [in]roiTensorPtrSrcROI data in HOST memory, for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorSrc[i].xywhROI.roiWidth <= 3840 and roiTensorSrc[i].xywhROI.roiHeight <= 2160)
    [in]roiTypeROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
    [in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.