Skip to content

[Bugfix]: Compile on CPU backend - #502

Merged
kiritigowda merged 5 commits into
ROCm:developfrom
daniellegillai:cpu-fix
Aug 7, 2026
Merged

[Bugfix]: Compile on CPU backend#502
kiritigowda merged 5 commits into
ROCm:developfrom
daniellegillai:cpu-fix

Conversation

@daniellegillai

@daniellegillai daniellegillai commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

Fixes #498: compile successfully when rocAL is built for CPU backend.

Technical Details

  • tensor.h: Remove #else branch on #if ENABLE_HIP that included non-existent device/device_manager.h
  • node_color_cast.cpp, node_lut.cpp, node_slice.cpp: Guard VX_MEMORY_TYPE_HIP with #if ENABLE_HIP
  • node_lut.cpp, node_python_function.cpp: Add missing #include <vx_ext_amd.h> header
  • master_graph.cpp: Guard _box_encoder_gpu deletion with #if ENABLE_HIP since this object only exists in GPU builds

Test 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:

    Start  1: basic_test_cpu
1/6 Test  #1: basic_test_cpu .....................   Passed    1.07 sec
    Start  5: dataloader_multithread_cpu
2/6 Test  #5: dataloader_multithread_cpu .........   Passed    2.07 sec
    Start  7: performance_tests_cpu
3/6 Test  #7: performance_tests_cpu ..............   Passed    1.03 sec
    Start  9: performance_tests_with_depth_cpu
4/6 Test  #9: performance_tests_with_depth_cpu ...   Passed    1.10 sec
    Start 11: unit_tests_cpu
5/6 Test #11: unit_tests_cpu .....................   Passed    9.25 sec
    Start 18: serialization_test_cpu
6/6 Test #18: serialization_test_cpu .............   Passed    0.93 sec

On HIP build, all ctests still pass:

      Start  1: basic_test_cpu
 1/21 Test  #1: basic_test_cpu .....................   Passed    1.46 sec
      Start  2: basic_test_gpu
 2/21 Test  #2: basic_test_gpu .....................   Passed    0.26 sec
      Start  3: basic_test_gray
 3/21 Test  #3: basic_test_gray ....................   Passed    0.21 sec
      Start  4: basic_test_rgb
 4/21 Test  #4: basic_test_rgb .....................   Passed    0.25 sec
      Start  5: dataloader_multithread_cpu
 5/21 Test  #5: dataloader_multithread_cpu .........   Passed    2.09 sec
      Start  6: dataloader_multithread_gpu
 6/21 Test  #6: dataloader_multithread_gpu .........   Passed    2.44 sec
      Start  7: performance_tests_cpu
 7/21 Test  #7: performance_tests_cpu ..............   Passed    1.04 sec
      Start  8: performance_tests_gpu
 8/21 Test  #8: performance_tests_gpu ..............   Passed    0.27 sec
      Start  9: performance_tests_with_depth_cpu
 9/21 Test  #9: performance_tests_with_depth_cpu ...   Passed    1.13 sec
      Start 10: performance_tests_with_depth_gpu
10/21 Test #10: performance_tests_with_depth_gpu ...   Passed    0.38 sec
      Start 11: unit_tests_cpu
11/21 Test #11: unit_tests_cpu .....................   Passed   11.30 sec
      Start 12: unit_tests_gpu
12/21 Test #12: unit_tests_gpu .....................   Passed    8.26 sec
      Start 13: unit_tests_gray
13/21 Test #13: unit_tests_gray ....................   Passed    3.47 sec
      Start 14: video_tests_ffmpeg
14/21 Test #14: video_tests_ffmpeg .................   Passed   46.46 sec
      Start 15: video_tests_rocdecode
15/21 Test #15: video_tests_rocdecode ..............   Passed   11.16 sec
      Start 16: basic_test_rocjpeg_gray
16/21 Test #16: basic_test_rocjpeg_gray ............   Passed    0.30 sec
      Start 17: basic_test_rocjpeg_rgb
17/21 Test #17: basic_test_rocjpeg_rgb .............   Passed    0.30 sec
      Start 18: serialization_test_cpu
18/21 Test #18: serialization_test_cpu .............   Passed    0.91 sec
      Start 19: serialization_test_gpu
19/21 Test #19: serialization_test_gpu .............   Passed    0.21 sec
      Start 20: checkpoint_save
20/21 Test #20: checkpoint_save ....................   Passed    1.82 sec
      Start 21: checkpoint_restore
21/21 Test #21: checkpoint_restore .................   Passed    2.07 sec

100% tests passed, 0 tests failed out of 21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.h include from tensor.h (HIP-only include remains guarded).
  • Guard VX_MEMORY_TYPE_HIP usage 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
kiritigowda merged commit 39ed544 into ROCm:develop Aug 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: Compilation warnings on CPU backend

3 participants