[AMD-SMI] Clean up UALoE/IFoE public header layout#6611
Open
marifamd wants to merge 3 commits into
Open
Conversation
The public-facing impl/amd_smi_gpu_device.h pulled in ualoe_lib/ualoe_lib.h via extern "C", then immediately contradicted that include with a local 'typedef int ualoe_handle_t;'. This forced the vendored ualoe_lib headers to be installed under /opt/rocm/include/ualoe_lib/ to keep downstream consumers compiling. Drop the include from the public header (keep only the forward typedef), move the ctors/dtor out-of-line into amd_smi_gpu_device.cc where the real ualoe_lib.h is included, and remove the now-unneeded install(DIRECTORY ualoe_lib) rule. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
<linux/time_types.h> was introduced in kernel 5.1 (Aug 2019). Targets shipping older sanitized UAPI headers (e.g. Debian 10 with kernel 4.19) fail to build ualoe_lib's cbl_cfg/uapi.h. Guard the include behind LINUX_VERSION_CODE and supply the matching struct definition for older targets. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Public impl/ header amd_smi_system.h included <amdsmi_unified/interface/ smi_nic_interface.h> as a bare path. The source actually lived under src/nic/ai-nic/amdsmi_unified/interface/ and installed at /opt/rocm/ include/amd_smi/impl/nic/amdsmi_unified/interface/, so a second install rule had to drop a duplicate copy at /opt/rocm/include/amdsmi_unified/ interface/ purely to make the bare include resolve for downstream consumers. Relocate the header to include/amd_smi/impl/nic/amdsmi_unified/interface/ so the source layout mirrors the install layout, switch all three consumers (amd_smi_system.h, amd_smi_common.h, amd_smi.cc) to the fully-qualified amd_smi/impl/nic/amdsmi_unified/interface/ path, point the amdsminic static lib's include search at the new location, and drop the duplicate install rule and the now-unneeded BUILD_INTERFACE entry. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
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.
ualoe_lib.hthrough the public install headers: drop the include fromimpl/amd_smi_gpu_device.h(keep only the forward typedef), move ctors/dtor out-of-line intoamd_smi_gpu_device.cc, and remove theinstall(DIRECTORY ualoe_lib)rule so the vendored headers stop landing in/opt/rocm/include/ualoe_lib/.__kernel_timespecfor pre-5.1 kernel headers:<linux/time_types.h>arrived in kernel 5.1 (Aug 2019), so guard the include behindLINUX_VERSION_CODEand supply the matching struct for targets like Debian 10 (kernel 4.19) that ship older sanitized UAPI headers.smi_nic_interface.hinto the public include tree atinclude/amd_smi/impl/nic/amdsmi_unified/interface/so the source layout mirrors the install layout, switch the three consumers (amd_smi_system.h,amd_smi_common.h,amd_smi.cc) to the fully-qualified path, repoint theamdsminicstatic lib's include search, and drop the duplicate install rule and now-unneededBUILD_INTERFACEentry.Signed-off-by: Maisam Arif Maisam.Arif@amd.com