[Cleanup] Remove stdout/stderr prints in core library implementations#713
Open
zacharyvincze wants to merge 17 commits intoROCm:developfrom
Open
[Cleanup] Remove stdout/stderr prints in core library implementations#713zacharyvincze wants to merge 17 commits intoROCm:developfrom
zacharyvincze wants to merge 17 commits intoROCm:developfrom
Conversation
…CCESS in binary operation dispatcher
…emplate dispatcher
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes stdout/stderr printing from core RPP implementations and improves error propagation by consistently returning RppStatus (including HIP runtime failures) instead of printing + exiting.
Changes:
- Replaces
CHECK_RETURN_STATUS/printf/exit()usage in core HIP/CPU tensor paths withRppStatusreturns. - Introduces
RPP_HIP_RETURN_IF_ERRORand updates many HIP runtime calls to returnRPP_ERROR_HIP_LAUNCHon failure. - Gates SIMD debug print helpers behind
RPP_DEBUG_SIMD_PRINTS.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| utilities/test_suite/rpp_test_suite_common.h | Reintroduces a test-only CHECK_RETURN_STATUS macro for HIP test binaries. |
| src/modules/tensor/rppt_tensor_filter_augmentations.cpp | Converts HIP malloc/free/sync error handling in rppt_sobel_filter to RppStatus returns. |
| src/modules/tensor/rppt_tensor_effects_augmentations.cpp | Converts multiple HIP runtime calls to RPP_HIP_RETURN_IF_ERROR. |
| src/modules/tensor/hip/kernel/transpose.cpp | Propagates HIP memcpy failure via RppStatus. |
| src/modules/tensor/hip/kernel/to_decibels.cpp | Propagates HIP stream sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_sum.cpp | Propagates HIP memset/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_stddev.cpp | Propagates HIP memset failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_min.cpp | Propagates HIP memset/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_mean.cpp | Propagates HIP memset failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_max.cpp | Propagates HIP memset/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/tensor_bitwise_binary_operations.cpp | Removes printf-based dimension errors; returns RppStatus and tracks incompatibility across OpenMP. |
| src/modules/tensor/hip/kernel/tensor_binary_operations.cpp | Removes printf and improves return-code propagation from arithmetic dispatchers. |
| src/modules/tensor/hip/kernel/spectrogram.cpp | Propagates HIP memcpy/memset/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/spatter.cpp | Propagates HIP memcpy failures via RppStatus. |
| src/modules/tensor/hip/kernel/slice.cpp | Propagates HIP stream sync failure via RppStatus. |
| src/modules/tensor/hip/kernel/resize_mirror_normalize.cpp | Propagates HIP memset/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/random_erase.cpp | Propagates HIP memcpy/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/rain.cpp | Propagates HIP memcpyAsync failure via RppStatus. |
| src/modules/tensor/hip/kernel/normalize.cpp | Returns RppStatus from launch-config helpers and propagates invalid axis / HIP failures. |
| src/modules/tensor/hip/kernel/noise_shot.cpp | Propagates HIP memcpy failure via RppStatus. |
| src/modules/tensor/hip/kernel/noise_salt_and_pepper.cpp | Propagates HIP memcpy failure via RppStatus. |
| src/modules/tensor/hip/kernel/noise_gaussian.cpp | Propagates HIP memcpy failure via RppStatus. |
| src/modules/tensor/hip/kernel/jitter.cpp | Propagates HIP memcpyAsync failure via RppStatus. |
| src/modules/tensor/hip/kernel/histogram_equalize.cpp | Propagates HIP malloc/memset failures via RppStatus. |
| src/modules/tensor/hip/kernel/grid_dropout.cpp | Propagates HIP memcpyAsync failures via RppStatus. |
| src/modules/tensor/hip/kernel/erase.cpp | Propagates HIP memcpy/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/crop_and_patch.cpp | Propagates HIP memcpy/sync failures via RppStatus. |
| src/modules/tensor/hip/kernel/copy.cpp | Propagates HIP memcpy failure via RppStatus. |
| src/modules/tensor/hip/kernel/color_space_conversion.cpp | Converts YUV->RGB constant upload helper to return HIP status and propagates it as RppStatus. |
| src/modules/tensor/hip/kernel/coarse_dropout.cpp | Propagates HIP memcpy/sync failures via RppStatus. |
| src/modules/tensor/cpu/kernel/tensor_bitwise_binary_operations.cpp | Removes printf errors; returns RppStatus and tracks incompatibility across OpenMP. |
| src/modules/tensor/cpu/kernel/tensor_binary_operations.cpp | Removes printf/silent success paths; propagates error codes and adds missing default returns. |
| src/modules/tensor/cpu/kernel/spectrogram.cpp | Replaces printf+exit() on FFT plan failure with RppStatus propagation across OpenMP. |
| src/modules/tensor/cpu/kernel/normalize.cpp | Replaces invalid-axis printing with RppStatus propagation across OpenMP. |
| src/modules/handle_hip.cpp | Replaces CHECK_RETURN_STATUS with explicit HIP status checks and throws with HIP error details. |
| src/include/common/errors.hpp | Removes stderr logging from try_ catch paths. |
| src/include/common/cpu/rpp_cpu_simd_load_store.hpp | Gated SIMD print helpers behind RPP_DEBUG_SIMD_PRINTS. |
| api/rppdefs.h | Removes public CHECK_RETURN_STATUS; adds RPP_HIP_RETURN_IF_ERROR and silences HIP launch stderr output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ready included in rpp_test_suite_common.h
LakshmiKumar23
approved these changes
Apr 22, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
reviewed
Apr 29, 2026
rrawther
requested changes
Apr 29, 2026
Contributor
|
@zacharyvincze Few comments still need resolution |
…com:zacharyvincze/rpp into zv/cleanup/remove-prints-in-implementations
Contributor
Author
|
@rrawther resolved the comments and synced with develop. I've re-added the printouts for internal HIP runtime errors (and HIP launch errors). Good to merge if everything looks good on your end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to fully remove prints to stdout/stderr from the core library implementation, instead opting for error propagation through the standard RppStatus return codes.
Technical Details
RPP_DEBUG_SIMD_PRINTSis set as a build flag to avoid printing in the core library. These should be enabled when debugging is required.Known Issues
RppStatus. This may be too generic for debugging purposes. Previously, the HIP error was printed out before callingexit(-1). Hard crashes such as these cannot occur in a library which is expected to propagate its error and let the user handle it accordingly. We will need to come back to this later and offer a better solution.