RPP bitwise operations#
-
RppStatus rppt_bitwise_and(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise AND computation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function computes bitwise AND 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). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input1#
Sample Input2#
Sample Output#
- Parameters:
srcPtr1 – [in] source1 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source2 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions
numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), 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))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_bitwise_xor(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise XOR computation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function computes bitwise XOR 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). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input1#
Sample Input2#
Sample Output#
- Parameters:
srcPtr1 – [in] source1 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source2 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions
numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), 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))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreateWithBatchSize()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_bitwise_or(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise OR computation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function computes bitwise OR 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). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input1#
Sample Input2#
Sample Output#
- Parameters:
srcPtr1 – [in] source1 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source2 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions
numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), 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))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_bitwise_not(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise NOT computation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function computes bitwise NOT 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). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), 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))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreateWithBatchSize()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_tensor_and_tensor(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptGenericDescPtr srcGenericDescPtr1, RpptGenericDescPtr srcGenericDescPtr2, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, RpptBroadcastMode broadcastMode, Rpp32u *roiTensor1, Rpp32u *roiTensor2, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise AND Generic augmentation on HIP/HOST backend with broadcasting support.
This function computes bitwise AND between two 2D, 3D or ND tensors with broadcasting support Broadcasting is permitted when, for each axis, the corresponding dimensions of the input tensors are either equal or one of them is 1
- Parameters:
srcPtr1 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr1GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr1
srcPtr2GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr2
dstPtr – [out] destination tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstGenericDescPtr – [in] destination tensor descriptor
broadcastMode – [in] enum used to represent if broadcast support is enabled or disabled for the binary operation (can only be disabled if input tensors are of same shape).
srcPtr1roiTensor – [in] values to represent dimensions of input tensor srcPtr1
srcPtr2roiTensor – [in] values to represent dimensions of input tensor srcPtr2
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_tensor_or_tensor(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptGenericDescPtr srcGenericDescPtr1, RpptGenericDescPtr srcGenericDescPtr2, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, RpptBroadcastMode broadcastMode, Rpp32u *roiTensor1, Rpp32u *roiTensor2, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise OR Generic augmentation on HIP/HOST backend with broadcasting support.
This function computes bitwise OR between two 2D, 3D or ND tensors with broadcasting support Broadcasting is permitted when, for each axis, the corresponding dimensions of the input tensors are either equal or one of them is 1
- Parameters:
srcPtr1 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr1GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr1
srcPtr2GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr2
dstPtr – [out] destination tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstGenericDescPtr – [in] destination tensor descriptor
broadcastMode – [in] enum used to represent if broadcast support is enabled or disabled for the binary operation (can only be disabled if input tensors are of same shape).
srcPtr1roiTensor – [in] values to represent dimensions of input tensor srcPtr1
srcPtr2roiTensor – [in] values to represent dimensions of input tensor srcPtr2
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_tensor_xor_tensor(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptGenericDescPtr srcGenericDescPtr1, RpptGenericDescPtr srcGenericDescPtr2, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, RpptBroadcastMode broadcastMode, Rpp32u *roiTensor1, Rpp32u *roiTensor2, rppHandle_t rppHandle, RppBackend executionBackend)#
Bitwise XOR Generic augmentation on HIP/HOST backend with broadcasting support.
This function computes bitwise XOR between two 2D, 3D or ND tensors with broadcasting support Broadcasting is permitted when, for each axis, the corresponding dimensions of the input tensors are either equal or one of them is 1
- Parameters:
srcPtr1 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr1GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr1
srcPtr2GenericDescPtr – [in] source tensor descriptor for the input tensor srcPtr2
dstPtr – [out] destination tensor memory in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstGenericDescPtr – [in] destination tensor descriptor
broadcastMode – [in] enum used to represent if broadcast support is enabled or disabled for the binary operation (can only be disabled if input tensors are of same shape).
srcPtr1roiTensor – [in] values to represent dimensions of input tensor srcPtr1
srcPtr2roiTensor – [in] values to represent dimensions of input tensor srcPtr2
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.