Return error status - Capture error status for each function invocation#518
Conversation
There was a problem hiding this comment.
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 errorCodeCapturevariable 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.
| } | ||
| if (errorCodeCapture != RPP_SUCCESS) | ||
| { | ||
| cout << "\nThe function returned an error status\n"; |
There was a problem hiding this comment.
@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";
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
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
* 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>
* 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>
No description provided.