Repository navigation
ci(hipfile): Add a test that hipfile.h is valid C11 and C++11 - #13862
Merged
Merged
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are focused, and no unresolved correctness or integration issues were identified.
No open issues 🎉
What changed in this PR
Adds compile-only checks to keep hipfile.h self-contained and compatible with C11 and C++11.
Changes:
- Compiles the header and exercises its macros with strict warnings.
- Enables the checks for AMD-detail builds.
- Adds the missing
<time.h>include and documents the fix.
| File | Description |
|---|---|
| projects/hipfile/test/header/header-check.c | Includes the header first and exercises its macros. |
| projects/hipfile/test/header/CMakeLists.txt | Configures strict C11 and C++11 compilation checks. |
| projects/hipfile/test/CMakeLists.txt | Enables header checks for AMD-detail builds. |
| projects/hipfile/include/hipfile.h | Includes <time.h> for struct timespec. |
| projects/hipfile/CHANGELOG.md | Documents the C compatibility fix. |
Review effort: Balanced
derobins
force-pushed
the
users/derobins/check_hipfile_h_c11
branch
from
October 20, 2026 22:24
14e13b6 to
f668315
Compare
spolifroni-amd
approved these changes
Oct 21, 2026
akolliasAMD
approved these changes
Oct 21, 2026
kurtmcmillan
approved these changes
Oct 21, 2026
hipfile.h is compiled as C11 and C++11 with -Wall -Wextra -Werror -pedantic. It's included first in its own C source file to check that it compiles on its own, and every macro it defines is used. The source is compiled as C, and as C++ from a copy CMake makes in the build directory. The objects are never linked, so a failure breaks the build. This found that hipfile.h uses struct timespec without including <time.h>. In C, the struct was declared only inside the parameter list of hipFileBatchIOGetStatus(), so it didn't match the struct timespec from <time.h>. hipfile.h now includes <time.h>. Co-Authored-By: Claude <noreply@anthropic.com>
derobins
force-pushed
the
users/derobins/check_hipfile_h_c11
branch
from
October 21, 2026 16:25
f668315 to
3b75455
Compare
1 task done
Contributor
TheRock Submodule Bump ActivityNewest first
|
pmoutsias-amd
added a commit
that referenced
this pull request
Nov 5, 2026
…branch to the (Unreleased) hipFile 0.7.0 section (#14918) These 4 CHANGELOG entries sit in release sections, but the code was merged to develop after the `rocm-systems` commit that TheRock `release/therock-10.2` pins (`ded49fd`), and is not in that commit. This moves them into `## (Unreleased) hipFile 0.7.0`, under the matching subsections. - #13473 (merged 2026-10-15, and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0 for ROCm 10.2.0` section: > * MD and LVM software RAID arrays running pass-through personalities whose member devices are all local NVMe are now fastpath capable, and `ais-check` reports them as such. - #13473 (merged 2026-10-15, and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0 for ROCm 10.2.0` section: > * `ais-check` no longer reports an LVM parity RAID logical volume (`raid4`, `raid5`, `raid6`) as fastpath capable. - #13657 (merged 2026-10-16, and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0 for ROCm 10.2.0` section: > * Per-GPU I/O statistics are now attributed to the GPU that owns the I/O buffer instead of the caller's active HIP device. Previously, `hipFileGetStatsL3()` and `ais-stats` could report counters against the wrong GPU when the active device differed from the buffer's device. - #13862 (merged 2026-10-21, and its merge commit is not in `ded49fd`), moved from the `hipFile 0.6.0 for ROCm 10.2.0` section: > * `hipfile.h` now includes `<time.h>`, which declares the `struct timespec` used by `hipFileBatchIOGetStatus()`. Previously, C code that included `<time.h>` after `hipfile.h` got an incompatible pointer type error or warning when passing a `struct timespec *` to `hipFileBatchIOGetStatus()`. Only the CHANGELOG is changed. Version macros are left to the component owners. JIRA ID : AIROCDOC-4467
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.
Motivation
The hipfile.h header needs to hew to C11/C++11 and nothing tests that this doesn't drift.
Technical Details
hipfile.h is compiled as C11 and C++11 with -Wall -Wextra -Werror -pedantic. It's included first in its own C source file to check that it compiles on its own, and every macro it defines is used. The source is compiled as C, and as C++ from a copy CMake makes in the build directory. The objects are never linked, so a failure breaks the build.
This found that hipfile.h uses struct timespec without including <time.h>. In C, the struct was declared only inside the parameter list of hipFileBatchIOGetStatus(), so it didn't match the struct timespec from <time.h>. hipfile.h now includes <time.h>.
Issue Tracking
JIRA ID: ROCM-28534
Test Plan
CI passes
Test Result
Success
Submission Checklist