From 816760d62e16fd6fc7de5ca50cfdf416b676acc8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Nov 2025 04:13:02 -0700 Subject: [PATCH 1/2] hipFile: Apply IWYU to NVIDIA side of hipFile Modest changes. Ignores gtest header confustion from iwyu and its insistance that we drop stdbool.h from hipfile.h. --- hipfile/include/hipfile.h | 1 - hipfile/src/nvidia_detail/hipfile-cufile.cpp | 5 +++++ hipfile/src/nvidia_detail/hipfile.cpp | 10 ++++++++++ hipfile/test/hipfile-cufile.cpp | 11 +++++++++-- hipfile/test/system/driver.cpp | 4 ++++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/hipfile/include/hipfile.h b/hipfile/include/hipfile.h index c9705ed7..a137e7f4 100644 --- a/hipfile/include/hipfile.h +++ b/hipfile/include/hipfile.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #if defined(__GNUC__) diff --git a/hipfile/src/nvidia_detail/hipfile-cufile.cpp b/hipfile/src/nvidia_detail/hipfile-cufile.cpp index 1f4deecb..85718fd7 100644 --- a/hipfile/src/nvidia_detail/hipfile-cufile.cpp +++ b/hipfile/src/nvidia_detail/hipfile-cufile.cpp @@ -6,8 +6,13 @@ #include "hipfile-cufile.h" #include +#include #include +#ifdef __HIP_PLATFORM_NVIDIA__ +#include +#endif + hipFileOpError_t toHipFileOpError(CUfileOpError cu_status) { diff --git a/hipfile/src/nvidia_detail/hipfile.cpp b/hipfile/src/nvidia_detail/hipfile.cpp index 086f5d3b..10713084 100644 --- a/hipfile/src/nvidia_detail/hipfile.cpp +++ b/hipfile/src/nvidia_detail/hipfile.cpp @@ -3,10 +3,20 @@ * SPDX-License-Identifier: MIT */ +#include "hipfile.h" #include "hipfile-cufile.h" +#include "hipfile-types.h" +#include +#include #include +#ifdef __HIP_PLATFORM_NVIDIA__ +#include +#include +#include +#endif + using namespace std; /* diff --git a/hipfile/test/hipfile-cufile.cpp b/hipfile/test/hipfile-cufile.cpp index 0dceb3a6..7649b1ee 100644 --- a/hipfile/test/hipfile-cufile.cpp +++ b/hipfile/test/hipfile-cufile.cpp @@ -5,12 +5,19 @@ #include "hipfile.h" #include "hipfile-cufile.h" -#include "test-common.h" - #include "hipfile-warnings.h" #include "invalid-enum.h" +#include "test-common.h" #include +#include +#include +#include + +#ifdef __HIP_PLATFORM_NVIDIA__ +#include +#include +#endif // Put tests inside the macros to suppress the global constructor // warnings diff --git a/hipfile/test/system/driver.cpp b/hipfile/test/system/driver.cpp index 8ef4033b..cfd0d91d 100644 --- a/hipfile/test/system/driver.cpp +++ b/hipfile/test/system/driver.cpp @@ -18,6 +18,10 @@ #include #include +#ifdef __HIP_PLATFORM_NVIDIA__ +#include +#endif + using namespace std; extern SystemTestOptions test_env; From b4729a25fd31bac651e0d982bbceb5fae586e49b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Nov 2025 04:18:31 -0700 Subject: [PATCH 2/2] Remove ifdefs from obvious NVIDIA code --- hipfile/src/nvidia_detail/hipfile-cufile.cpp | 5 +---- hipfile/src/nvidia_detail/hipfile.cpp | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/hipfile/src/nvidia_detail/hipfile-cufile.cpp b/hipfile/src/nvidia_detail/hipfile-cufile.cpp index 85718fd7..2d12284b 100644 --- a/hipfile/src/nvidia_detail/hipfile-cufile.cpp +++ b/hipfile/src/nvidia_detail/hipfile-cufile.cpp @@ -6,13 +6,10 @@ #include "hipfile-cufile.h" #include +#include #include #include -#ifdef __HIP_PLATFORM_NVIDIA__ -#include -#endif - hipFileOpError_t toHipFileOpError(CUfileOpError cu_status) { diff --git a/hipfile/src/nvidia_detail/hipfile.cpp b/hipfile/src/nvidia_detail/hipfile.cpp index 10713084..60092bf0 100644 --- a/hipfile/src/nvidia_detail/hipfile.cpp +++ b/hipfile/src/nvidia_detail/hipfile.cpp @@ -7,15 +7,12 @@ #include "hipfile-cufile.h" #include "hipfile-types.h" -#include -#include -#include - -#ifdef __HIP_PLATFORM_NVIDIA__ #include #include #include -#endif +#include +#include +#include using namespace std;