SIGN IN SIGN UP

test/ucx: add AMD GPU support to plugins/ucx unit tests (#1787)

## What?
Add support for running UCX plugin unit tests on AMD GPUs using ROCm/HIP

Changes:
- Add meson options 'use_rocm' and 'rocm_path' for ROCm configuration
- Implement ROCm detection in test/unit/plugins/ucx/meson.build
- Map CUDA API calls to HIP equivalents via preprocessor defines
- Add hipStreamSynchronize(0) after hipMemset calls (required for ROCm)
- Support both CUDA and ROCm builds (mutually exclusive)

## How?
Implementation details:
- All CUDA function calls remain unchanged in source code
- When HAVE_ROCM is defined, #define statements map CUDA→HIP
- ROCm detection is fully localized to UCX test directory
- Zero impact on other components (CUDA detection continues normally)

Building with ROCm:
  meson setup build -Duse_rocm=true -Drocm_path=/opt/rocm

Tested on an MI250X system with an MLX5 NIC and UCX 1.21.xRC2. All UCX
plugin unit tests passed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added Meson options to enable ROCm/HIP (`use_rocm`) and configure the
ROCm install location (`rocm_path`).
* Extended UCX GPU/VRAM unit tests to support ROCm in addition to CUDA,
including worker coverage.
* **Bug Fixes**
* Improved backend-aware ROCm GPU memory and pointer handling for VRAM
test paths, with correct device discovery and data movement.
* **Documentation**
* Updated ROCm/HIP build guidance to be vendor-neutral, reorganized ROCm
plugin notes, added a Meson ROCm command example, and refreshed
remaining known gaps.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Colin Hirsch <chirsch@nvidia.com>
E
Edgar Gabriel committed
c17d52f64bd9a38eb27dcee73b87649d8c557556
Parent: 2976c5b
Committed by GitHub <noreply@github.com> on 7/24/2026, 6:56:41 AM