ROCM-20419 - Remove dep on MAX_SIZE.#4241
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the local dependency on MAX_SIZE in the HIP multiprocess device visibility tests by replacing fixed-size buffers/arrays with std::string and std::vector.
Changes:
- Replaced
MAX_SIZE-basedsnprintfbuffer withstd::to_string()+std::stringfor*_VISIBLE_DEVICESenv var values. - Replaced
MAX_SIZE-based device list arrays withstd::vector<int>and passed raw pointers via.data()where needed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <hip_test_common.hh> | ||
|
|
||
| #ifdef __linux__ | ||
| #include <sys/wait.h> | ||
| #include <unistd.h> |
There was a problem hiding this comment.
This file now uses std::string/std::to_string and std::vector, but it doesn’t include or . Relying on transitive includes (e.g., via iostream/Catch2) is non-portable and can break builds with different standard library implementations. Add the missing standard headers explicitly near the top of the file.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@jaydeeppatel1111 I've opened a new pull request, #4251, to work on those changes. Once the pull request is ready, I'll request review from you. |
….cc (#4251) `hipSetGetDeviceMproc.cc` uses `std::string`, `std::to_string`, and `std::vector` without explicitly including their respective headers. These are not transitively provided by `hip_test_common.hh`. ## Motivation Missing standard library headers cause implicit dependency on transitive includes, which is fragile and non-portable. This ensures the file's dependencies are explicitly declared. ## Technical Details - Added `#include <string>` and `#include <vector>` to `projects/hip-tests/catch/multiproc/hipSetGetDeviceMproc.cc` following the existing `hip_test_common.hh` include. Addresses feedback from [#4241](#4241 (comment)). ## JIRA ID ROCM-20419 ## Test Plan No functional changes — header-only fix. Relies on compiler to catch any regressions if headers are missing. ## Test Result N/A — compilation correctness ensured by explicit include declarations. ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jaydeeppatel1111 <106300970+jaydeeppatel1111@users.noreply.github.com>
Motivation
Remove dep on MAX_SIZE.
Technical Details
Remove dep on MAX_SIZE.
JIRA ID
ROCM-20419
Test Plan
NA
Test Result
NA
Submission Checklist