RPPT Tensor Operations - Data Exchange Operations.

RPPT Tensor Operations - Data Exchange Operations.#

RPP: RPPT Tensor Operations - Data Exchange Operations.
RPPT Tensor Operations - Data Exchange Operations.

RPPT Tensor Operations - Data Exchange Operations. More...

Functions

RppStatus rppt_copy (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, rppHandle_t rppHandle, RppBackend executionBackend)
 Copy operation on HIP/HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_channel_permute (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u *permutationTensor, rppHandle_t rppHandle, RppBackend executionBackend)
 Channel permute operation on HIP/HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_color_to_greyscale (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptSubpixelLayout srcSubpixelLayout, rppHandle_t rppHandle, RppBackend executionBackend)
 Color to greyscale operation on HIP/HOST backend for a NCHW/NHWC layout tensor. More...
 
RppStatus rppt_yuv_to_rgb (RppPtr_t srcYPtr, RppPtr_t srcUVPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u src_y_pitch, Rpp32u src_uv_pitch, Rpp32u dst_pitch, Rpp32u width, Rpp32u height, RpptColorStandard col_standard, RpptColorRange color_range, rppHandle_t rppHandle, RppBackend executionBackend)
 YUV to RGB color conversion on HIP backend (NV12 8-bit only) More...
 

Detailed Description

RPPT Tensor Operations - Data Exchange Operations.

Function Documentation

◆ rppt_channel_permute()

RppStatus rppt_channel_permute ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
Rpp32u permutationTensor,
rppHandle_t  rppHandle,
RppBackend  executionBackend 
)

Channel permute operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

This function performs one of six possible channel permutations (R-G-B, R-B-G, G-R-B, G-B-R, B-R-G, B-G-R) for an image in a batch of RGB(3 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 Input
    Sample Output
    Parameters
    [in]srcPtrsource tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 3)
    [out]dstPtrdestination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
    [in]dstDescPtrdestination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
    [in]permutationTensorA tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend) specifying the channel permutation for each image. Size: 3 × srcDescPtr->n. Each value must satisfy: 0 ≤ permutationTensor[i] ≤ 2.
    [in]rppHandleRPP HIP/HOST handle created with rppCreate()
    [in]executionBackendbackend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_color_to_greyscale()

RppStatus rppt_color_to_greyscale ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
RpptSubpixelLayout  srcSubpixelLayout,
rppHandle_t  rppHandle,
RppBackend  executionBackend 
)

Color to greyscale operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The color to greyscale operation runs for a batch of RGB(3 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 Input
    Sample Output
    Parameters
    [in]srcPtrsource tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
    [in]srcDescPtrsource tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 3)
    [out]dstPtrdestination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
    [in]dstDescPtrdestination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
    [in]srcSubpixelLayoutA RpptSubpixelLayout type enum to specify source subpixel layout (RGBtype or BGRtype)
    [in]rppHandleRPP HIP/HOST handle created with rppCreate()
    [in]executionBackendbackend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_copy()

RppStatus rppt_copy ( RppPtr_t  srcPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
rppHandle_t  rppHandle,
RppBackend  executionBackend 
)

Copy operation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The copy operation runs a buffer copy 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 Input
    Sample Output
    Parameters
    [in]srcPtrsource tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
    [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 (for HIP backend) or HOST memory (for HOST backend)
    [in]dstDescPtrdestination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
    [in]rppHandleRPP HIP/HOST handle created with rppCreate()
    [in]executionBackendbackend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion.

◆ rppt_yuv_to_rgb()

RppStatus rppt_yuv_to_rgb ( RppPtr_t  srcYPtr,
RppPtr_t  srcUVPtr,
RpptDescPtr  srcDescPtr,
RppPtr_t  dstPtr,
RpptDescPtr  dstDescPtr,
Rpp32u  src_y_pitch,
Rpp32u  src_uv_pitch,
Rpp32u  dst_pitch,
Rpp32u  width,
Rpp32u  height,
RpptColorStandard  col_standard,
RpptColorRange  color_range,
rppHandle_t  rppHandle,
RppBackend  executionBackend 
)

YUV to RGB color conversion on HIP backend (NV12 8-bit only)

Converts semi-planar NV12 (separate Y and interleaved UV planes) to packed RGB24.

  • Source: srcYPtr = luma plane, srcUVPtr = interleaved UV
  • src_y_pitch / src_uv_pitch: row strides in bytes
  • Destination: packed RGB at dstPtr (RGB24, Rpp8u) with row stride dst_pitch bytes.
  • Supported execution backend: RppBackend::RPP_HIP_BACKEND only.
    Parameters
    [in]srcYPtrpointer to Y plane in HIP memory
    [in]srcUVPtrpointer to interleaved UV plane in HIP memory
    [in]srcDescPtrsource tensor descriptor (dataType must be U8)
    [out]dstPtrpointer to RGB output buffer in HIP memory
    [in]dstDescPtrdestination tensor descriptor (dataType must be U8)
    [in]src_y_pitchrow pitch of Y plane in bytes
    [in]src_uv_pitchrow pitch of UV plane in bytes
    [in]dst_pitchrow pitch of RGB output in bytes
    [in]widthimage width in pixels
    [in]heightimage height in pixels
    [in]col_standardLuma/matrix family: RpptColorStandard (unknown values use BT.709).
    [in]color_rangeLuma range: RpptColorRange_STUDIO or RpptColorRange_FULL (other values behave like studio).
    [in]rppHandleRPP HIP handle created with rppCreate()
    [in]executionBackendmust be RppBackend::RPP_HIP_BACKEND
    Returns
    A RppStatus enumeration.
    Return values
    RPP_SUCCESSSuccessful completion.
    RPP_ERROR*Unsuccessful completion (e.g. RPP_ERROR_NOT_IMPLEMENTED if executionBackend is not HIP).