Skip to content

RPP Channel Permute : Modified swap channels as Channel Permute#428

Merged
r-abishek merged 2 commits intor-abishek:ar/opt_swap_channelsfrom
Dineshbabu-Ravichandran:db/randomChannelPermute
Apr 29, 2025
Merged

RPP Channel Permute : Modified swap channels as Channel Permute#428
r-abishek merged 2 commits intor-abishek:ar/opt_swap_channelsfrom
Dineshbabu-Ravichandran:db/randomChannelPermute

Conversation

@HazarathKumarM
Copy link
Copy Markdown
Collaborator

  • Renamed swap channels as channel permute
  • changed the permuatation tensor computation

Copy link
Copy Markdown
Owner

@r-abishek r-abishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HazarathKumarM Please address comments

/*! \brief Swap channels operation on HOST backend for a NCHW/NHWC layout tensor
* \details The swap channels operation swaps R and B channels to toggle RGB<->BGR for a batch of RGB(3 channel) images with an NHWC/NCHW tensor layout.<br>
/*! \brief Channel permute operation on HOST backend for a NCHW/NHWC layout tensor
* \details \details The channel permute operation runs 6 channel swap permutations (R-G-B, R-B-G, G-R-B, G-B-R, B-R-G, B-G-R) by varying permuatationIndex (0 to 5)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls remove one \details

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* \param [out] dstPtr destination tensor in HIP memory
* \param [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
* \param [in] permTensor permutation tensor for swap operation in pinned / HIP memory
* \param [in] permutationIndexes permutation indexes for the channels permute operation in pinned/HIP memory. (0 <= permutationIndexes[n] <= 5), which specifies the swap order for the kernel.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a user perspective, permutationIndexes is not quite intuitive - it indicates an index to an array. Instead:
Call it:

 * \param [in] permutationsList An array of Rpp32u elements of size batchSize (srcDescPtr->n) containing a type of permutation order (0-5) for each image in the batch in pinned/HIP memory. (0 <= permutationsList[n] <= 5), which specifies the permutation order for the output of each image in the batch.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for host too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@r-abishek r-abishek added the enhancement New feature or request label Apr 29, 2025
@r-abishek r-abishek added this to the sow12ms3 milestone Apr 29, 2025
@r-abishek r-abishek merged commit cec7dd6 into r-abishek:ar/opt_swap_channels Apr 29, 2025
ManasaDattaT pushed a commit to ManasaDattaT/rpp that referenced this pull request Dec 19, 2025
* Test Suite - updates

* Changelog - Updates

* Readme - Fix

* CMakeList - cleanup

* Version - update

* Version - Add note

* Readme - updates

* Readme - Updates

* Readme - Fix add ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants