[Bugfix]: Compile on CPU backend - #502
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CPU-backend compilation by removing/guarding HIP-specific code paths and ensuring the correct OpenVX extension headers are included where needed.
Changes:
- Remove a non-existent CPU-side
device/device_manager.hinclude fromtensor.h(HIP-only include remains guarded). - Guard
VX_MEMORY_TYPE_HIPusage and GPU-only cleanup logic behind#if ENABLE_HIP. - Add missing
#include <vx_ext_amd.h>to compilation units that require AMD OpenVX extension definitions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rocAL/source/pipeline/master_graph.cpp | Guards _box_encoder_gpu deletion behind ENABLE_HIP to avoid CPU build breakage. |
| rocAL/source/augmentations/node_python_function.cpp | Adds missing vx_ext_amd.h include for AMD OpenVX extension symbols. |
| rocAL/source/augmentations/geometry_augmentations/node_slice.cpp | Guards VX_MEMORY_TYPE_HIP usage behind ENABLE_HIP. |
| rocAL/source/augmentations/effects_augmentations/node_lut.cpp | Adds vx_ext_amd.h and guards VX_MEMORY_TYPE_HIP usage behind ENABLE_HIP. |
| rocAL/source/augmentations/color_augmentations/node_color_cast.cpp | Guards VX_MEMORY_TYPE_HIP usage behind ENABLE_HIP. |
| rocAL/include/pipeline/tensor.h | Removes invalid non-HIP include; keeps HIP includes under ENABLE_HIP. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kiritigowda
approved these changes
Aug 7, 2026
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
Fixes #498: compile successfully when rocAL is built for CPU backend.
Technical Details
tensor.h: Remove#elsebranch on#if ENABLE_HIPthat included non-existentdevice/device_manager.hnode_color_cast.cpp,node_lut.cpp,node_slice.cpp: GuardVX_MEMORY_TYPE_HIPwith#if ENABLE_HIPnode_lut.cpp,node_python_function.cpp: Add missing#include <vx_ext_amd.h>headermaster_graph.cpp: Guard_box_encoder_gpudeletion with#if ENABLE_HIPsince this object only exists in GPU buildsTest Plan
CTests on both the CPU (-D BACKEND=CPU) and HIP (-D BACKEND=HIP) build. Note that tested on the MIVisionX and RPP branches which fix the CPU builds on those repos as well, rather than TOT (RPP #10295 and MIVisionX #1726).
Test Result
On CPU build, cpu ctests pass:
On HIP build, all ctests still pass: