RPPT Tensor Operations - Arithmetic Operations.#

RPP: RPPT Tensor Operations - Arithmetic Operations.
RPPT Tensor Operations - Arithmetic Operations.

RPPT Tensor Operations - Arithmetic Operations. More...

Functions

RppStatus rppt_fused_multiply_add_scalar_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *mulTensor, Rpp32f *addTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Fused multiply add scalar augmentation on HOST backend. More...
 
RppStatus rppt_fused_multiply_add_scalar_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *mulTensor, Rpp32f *addTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Fused multiply add scalar augmentation on HIP backend. More...
 
RppStatus rppt_add_scalar_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *addTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Add scalar augmentation on HOST backend. More...
 
RppStatus rppt_add_scalar_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *addTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Add scalar augmentation on HIP backend. More...
 
RppStatus rppt_subtract_scalar_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *subtractTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Subtract scalar augmentation on HOST backend. More...
 
RppStatus rppt_subtract_scalar_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *subtractTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Subtract scalar augmentation on HIP backend. More...
 
RppStatus rppt_multiply_scalar_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *mulTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Multiply scalar augmentation on HOST backend. More...
 
RppStatus rppt_multiply_scalar_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *mulTensor, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle)
 Multiply scalar augmentation on HIP backend. More...
 
RppStatus rppt_magnitude_host (RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Magnitude computation on HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_magnitude_gpu (RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle)
 Magnitude computation on HIP backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_log_host (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u *roiTensor, rppHandle_t rppHandle)
 Logarithm operation on HOST backend. More...
 
RppStatus rppt_log_gpu (RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u *roiTensor, rppHandle_t rppHandle)
 Logarithm operation on HIP backend. More...
 

Detailed Description

RPPT Tensor Operations - Arithmetic Operations.

Function Documentation

◆ rppt_add_scalar_gpu()

RppStatus rppt_add_scalar_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f addTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Add scalar augmentation on HIP backend.

This function performs the addition operation on a batch of 4D tensors. It adds a corresponding element from the 'addTensor' to source tensor, and stores the result in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]addTensoradd values for used for addition (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_add_scalar_host()

RppStatus rppt_add_scalar_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f addTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Add scalar augmentation on HOST backend.

This function performs the addition operation on a batch of 4D tensors. It adds a corresponding element from the 'addTensor' to source tensor, and stores the result in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]addTensoradd values for used for addition (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_fused_multiply_add_scalar_gpu()

RppStatus rppt_fused_multiply_add_scalar_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f mulTensor,
Rpp32f addTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Fused multiply add scalar augmentation on HIP backend.

This function performs the fmadd operation on a batch of 4D tensors. It multiplies each element of the source tensor by a corresponding element in the 'mulTensor', adds a corresponding element from the 'addTensor', and stores the result in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]mulTensormul values for fmadd calculation (1D tensor of batchSize Rpp32f values)
[in]addTensoradd values for fmadd calculation (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_fused_multiply_add_scalar_host()

RppStatus rppt_fused_multiply_add_scalar_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f mulTensor,
Rpp32f addTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Fused multiply add scalar augmentation on HOST backend.

This function performs the fmadd operation on a batch of 4D tensors. It multiplies each element of the source tensor by a corresponding element in the 'mulTensor', adds a corresponding element from the 'addTensor', and stores the result in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]mulTensormul values for fmadd calculation (1D tensor of batchSize Rpp32f values)
[in]addTensoradd values for fmadd calculation (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_log_gpu()

RppStatus rppt_log_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32u roiTensor,
rppHandle_t  rppHandle 
)

Logarithm operation on HIP backend.

Computes Log to base e(natural log) of the input for a given ND Tensor. Supports u8->f32, i8->f32, f16->f16 and f32->f32 datatypes. Uses Absolute of input for log computation and uses nextafter() if input is 0 to avoid undefined result.

Parameters
[in]srcPtrsource tensor in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[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_log_host()

RppStatus rppt_log_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32u roiTensor,
rppHandle_t  rppHandle 
)

Logarithm operation on HOST backend.

Computes Log to base e(natural log) of the input for a given ND Tensor. Supports u8->f32, i8->f32, f16->f16 and f32->f32 datatypes. Uses Absolute of input for log computation and uses nextafter() if input is 0 to avoid undefined result.

Parameters
[in]srcPtrsource tensor in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[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_magnitude_gpu()

RppStatus rppt_magnitude_gpu ( RppPtr_t  srcPtr1,
RppPtr_t  srcPtr2,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Magnitude computation on HIP backend for a NCHW/NHWC layout tensor.

This function computes magnitude of corresponding pixels for 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.

Sample Input1
Sample Input2
Sample Output
Parameters
[in]srcPtr1source1 tensor in HIP memory
[in]srcPtr2source2 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]dstPtrdestination tensor in HIP memory
[in]dstDescPtrdestination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
[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))
[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_magnitude_host()

RppStatus rppt_magnitude_host ( RppPtr_t  srcPtr1,
RppPtr_t  srcPtr2,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
RpptROIPtr  roiTensorPtrSrc,
RpptRoiType  roiType,
rppHandle_t  rppHandle 
)

Magnitude computation on HOST backend for a NCHW/NHWC layout tensor.

This function computes magnitude of corresponding pixels for 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.

Sample Input1
Sample Input2
Sample Output
Parameters
[in]srcPtr1source1 tensor in HOST memory
[in]srcPtr2source2 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]dstPtrdestination tensor in HOST memory
[in]dstDescPtrdestination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
[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))
[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_multiply_scalar_gpu()

RppStatus rppt_multiply_scalar_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f mulTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Multiply scalar augmentation on HIP backend.

This function performs the multiplication operation on a batch of 4D tensors. It takes a corresponding element from 'multiplyTensor' and multiplies it with source tensor. Result is stored in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]mulTensormultiplier values for used for multiplication (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_multiply_scalar_host()

RppStatus rppt_multiply_scalar_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f mulTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Multiply scalar augmentation on HOST backend.

This function performs the multiplication operation on a batch of 4D tensors. It takes a corresponding element from 'multiplyTensor' and multiplies it with source tensor. Result is stored in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]mulTensormultiplier values for used for multiplication (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_subtract_scalar_gpu()

RppStatus rppt_subtract_scalar_gpu ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f subtractTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Subtract scalar augmentation on HIP backend.

This function performs the subtraction operation on a batch of 4D tensors. It takes a corresponding element from 'subtractTensor' and subtracts it from source tensor. Result is stored in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HIP memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HIP memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]subtractTensorsubtract values for used for subtraction (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HIP handle created with rppCreateWithStreamAndBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.

◆ rppt_subtract_scalar_host()

RppStatus rppt_subtract_scalar_host ( RppPtr_t  srcPtr,
RpptGenericDescPtr  srcGenericDescPtr,
RppPtr_t  dstPtr,
RpptGenericDescPtr  dstGenericDescPtr,
Rpp32f subtractTensor,
RpptROI3DPtr  roiGenericPtrSrc,
RpptRoi3DType  roiType,
rppHandle_t  rppHandle 
)

Subtract scalar augmentation on HOST backend.

This function performs the subtraction operation on a batch of 4D tensors. It takes a corresponding element from 'subtractTensor' and subtracts it from source tensor. Result is stored in the destination tensor. Support added for f32 -> f32 dataype.

Sample Input
Sample Output
Parameters
[in]srcPtrsource tensor in HOST memory
[in]srcGenericDescPtrsource tensor descriptor
[out]dstPtrdestination tensor in HOST memory
[in]dstGenericDescPtrdestination tensor descriptor
[in]subtractTensorsubtract values for used for subtraction (1D tensor of batchSize Rpp32f values)
[in]roiGenericPtrSrcROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
[in]roiTypeROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
[in]rppHandleRPP HOST handle created with rppCreateWithBatchSize()
Returns
A RppStatus enumeration.
Return values
RPP_SUCCESSSuccessful completion.
RPP_ERROR*Unsuccessful completion.