Skip to content

Return error status - Capture error status for each function invocation#518

Merged
r-abishek merged 3 commits intor-abishek:ar/test_suite_mods_14_error_codefrom
Srihari-mcw:return_error_status
Nov 4, 2025
Merged

Return error status - Capture error status for each function invocation#518
r-abishek merged 3 commits intor-abishek:ar/test_suite_mods_14_error_codefrom
Srihari-mcw:return_error_status

Conversation

@Srihari-mcw
Copy link
Copy Markdown
Collaborator

No description provided.

@Srihari-mcw Srihari-mcw changed the base branch from master to develop November 2, 2025 17:53
@r-abishek r-abishek requested a review from Copilot November 3, 2025 22:29
@r-abishek r-abishek added the validation Validate build and tests label Nov 3, 2025
Copy link
Copy Markdown

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 adds error status capturing and validation for RPP (ROCm Performance Primitives) API function calls across all test suite files. The changes ensure that API function return values are captured and checked, providing early error detection and improved error reporting in the test suites.

Key Changes:

  • Added RppStatus errorCodeCapture variable to capture return values from RPP API calls
  • Modified all RPP API function calls to capture their return status
  • Added error checking logic that exits early with a descriptive message if any function returns a non-success status

Reviewed Changes

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

Show a summary per file
File Description
utilities/test_suite/HOST/Tensor_voxel_host.cpp Added error capture and validation for voxel processing host functions
utilities/test_suite/HOST/Tensor_misc_host.cpp Added error capture and validation for miscellaneous tensor host functions
utilities/test_suite/HOST/Tensor_image_host.cpp Added error capture and validation for image processing host functions
utilities/test_suite/HOST/Tensor_audio_host.cpp Added error capture and validation for audio processing host functions
utilities/test_suite/HIP/Tensor_voxel_hip.cpp Added error capture and validation for voxel processing HIP/GPU functions
utilities/test_suite/HIP/Tensor_misc_hip.cpp Added error capture and validation for miscellaneous tensor HIP/GPU functions
utilities/test_suite/HIP/Tensor_image_hip.cpp Added error capture and validation for image processing HIP/GPU functions
utilities/test_suite/HIP/Tensor_audio_hip.cpp Added error capture and validation for audio processing HIP/GPU functions

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

@r-abishek r-abishek changed the base branch from develop to ar/test_suite_mods_14_error_code November 3, 2025 22:36
}
if (errorCodeCapture != RPP_SUCCESS)
{
cout << "\nThe function returned an error status\n";
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.

@Srihari-mcw Can we convert the error status to string and print? Or does it print from python? Can also give the name of the functionality?

Suggest:
Just like above on L383, can perhaps say - cout << "\nThe functionality " << func << " returned an error status " << str(errorCodeCapture) \n";

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.

Is it fine if we declare a separate map/switch for this? There is a feature called #include "magic_enum.hpp" to do this in C++17 or above, but not sure we can enforce this standard

Please share your thoughts @r-abishek

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.

@Srihari-mcw Sure, perhaps add a map under common header .h
Directly in the cout statement, just get the string value from the map.
Ensure its not double printing if called from python say in the CI

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.

Hi @r-abishek , the changes were addressed
The document attached is a log for posterize, where the error is captured and shown as part of the C++ code execution

The python summary also shows the error code at the end
posterize_new_changes.txt

@r-abishek r-abishek merged commit 622d597 into r-abishek:ar/test_suite_mods_14_error_code Nov 4, 2025
Srihari-mcw pushed a commit to Srihari-mcw/rpp that referenced this pull request Dec 8, 2025
* Add the change to support turbojpeg package Installation

* Update CHANGELOG.md

---------

Co-authored-by: HazarathKumarM <hazarathkumar@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
ManasaDattaT pushed a commit to ManasaDattaT/rpp that referenced this pull request Dec 19, 2025
* Add the change to support turbojpeg package Installation

* Update CHANGELOG.md

---------

Co-authored-by: HazarathKumarM <hazarathkumar@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validation Validate build and tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants