Skip to content

Conversation

@r-abishek
Copy link
Member

@r-abishek r-abishek commented Oct 8, 2025

RPP was originally also responsible for host to hip buffer conversions. This was removed during the course of tensor implementations to ensure all RPP HOST API only have HOST buffers, and GPU API only have HIP buffers (or pinned memory for smaller argument buffers).

The following functionality were still using the old style host->hip memcopy within RPP, and this is now being removed. After this, RPP tensor API will no longer be responsible for any HOST -> HIP buffer copy. The user is responsible to provide HOST buffers for HOST API, and HIP/Pinned memory for GPU API.

copy_param_float(), copy_param_uint() etc perform these copies and are now eliminated.
Just like all other tensor functionalities, pinned memory allocation from test suite is used for samller argument buffers.

These are the changed functionalities:
exposure
blend
brightness
color cast
color twist
constrast
crop mirror normalize
gamma_correction
gaussian_filter
noise
non_linear_blend
resize_mirror_normalize
water

@rrawther Please note equivalent changes in MIVisionX would need to be merged together with this PR.
A patch version change has been done for this tentatively from 2.2.0 to 2.2.1

HazarathKumarM and others added 23 commits September 17, 2025 08:29
@r-abishek r-abishek requested a review from a team as a code owner October 8, 2025 06:41
@r-abishek r-abishek changed the title Ar/device memcpy removal Consistent HOST and HIP/pinned buffers for respective API Oct 8, 2025
@kiritigowda kiritigowda self-assigned this Oct 9, 2025
@kiritigowda kiritigowda requested a review from rrawther October 9, 2025 17:56
@LakshmiKumar23
Copy link
Contributor

@r-abishek please resolve merge conflicts

Copilot finished reviewing on behalf of kiritigowda November 17, 2025 18:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes internal host-to-HIP buffer copy functionality from RPP to ensure consistent memory management. GPU APIs now require users to provide HIP/pinned memory buffers directly, eliminating the copy_param_float(), copy_param_uint(), and similar helper functions that previously performed host-to-device copies within RPP.

Key changes include:

  • Memory allocation updated from stack arrays to hipHostMalloc in test suite
  • API function signatures updated to pass tensor pointers directly to HIP kernels
  • Memory management responsibility shifted entirely to the user

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utilities/test_suite/HIP/Tensor_image_hip.cpp Updated to use hipHostMalloc for parameter buffers instead of stack arrays; added cleanup code
src/modules/tensor/rppt_tensor_geometric_augmentations.cpp Removed copy_param calls; parameters now passed directly to kernels
src/modules/tensor/rppt_tensor_filter_augmentations.cpp Removed copy_param calls for gaussian_filter
src/modules/tensor/rppt_tensor_effects_augmentations.cpp Removed copy_param calls; added hipHostMalloc for spatter mask arrays
src/modules/tensor/rppt_tensor_color_augmentations.cpp Removed copy_param calls for all color augmentations
src/modules/tensor/hip/kernel/*.cpp Updated function signatures to accept tensor pointers directly
src/include/tensor/hip_tensor_executors.hpp Updated function declarations with new parameters
CMakeLists.txt Version bump from 2.2.0 to 2.2.1; trailing whitespace cleanup
CHANGELOG.md Added entry for memory copy elimination

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LakshmiKumar23
Copy link
Contributor

@r-abishek please check and resolve conflicts

@LakshmiKumar23
Copy link
Contributor

@Srihari-mcw @HazarathKumarM please add the doc changes as we discussed offline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants