Repository navigation
CMake: check that the HIP headers compile as CUDA at configure time - #254
Open
Thenewmanator15 wants to merge 1 commit into
Open
Thenewmanator15 wants to merge 1 commit into
Thenewmanator15 wants to merge 1 commit into
Conversation
With OPENEMS_HIP_AS_CUDA only hip/hip_runtime.h was looked for, so a setup with unusable headers reported the backend as enabled and failed in the build. Now a test compile decides; if it fails, openEMS is built without the backend, with a warning that names the usual causes. Generated-by: Claude Code Signed-off-by: Mathew Newman <3686761+Thenewmanator15@users.noreply.github.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.
AI use: the change and this text were generated with Claude Code; I have read and tested them.
With
OPENEMS_HIP_AS_CUDA=ON, CMake only looks forhip/hip_runtime.h. Building the GPU engine on Ubuntu 26.04(WSL2, RTX 5070 Ti), configure reported "HIP GPU backend enabled" each time and the build then failed in the
.hipsources, for three different reasons:
libamdhip64-dev(7.1) has nohip/nvidia_detailcuda-nvcc,cuda-cudart-dev) has nocuda_profiler_api.hcudaGraphEdgeDatasignatures); 7.2.4 doesThis PR test-compiles
#include <hip/hip_runtime.h>with the CUDA compiler at configure time. If that fails, thebackend is switched off with a warning naming these causes, as is done for the other missing parts.
Tested (configure only) with CUDA 13.3.73, GCC 15.2, CMake 4.2:
libamdhip64-dev7.1.0 (nonvidia_detail)nvidia_detailof hipother rocm-7.1.0hip-dev7.2.4 of repo.radeon.comNot tested: Windows, and a missing
cuda_profiler_api.hon its own (same code path).Also seen, not changed here: CUDA 12.9 does not work with GCC 15 even with
-allow-unsupported-compiler, so on acurrent distribution CUDA 13 with HIP 7.2 headers is the working pair; and CMake 4.2 prints a CMP0167 (FindBoost)
dev warning.
With the 7.2.4 headers the backend builds and runs: 5420 MC/s against 131 MC/s for the v0.37.0 default engine
(Windows build, 12 threads) on the same machine, 3.5 M cells with PML and lumped ports; S11 of the two runs agrees
to 2e-6.
🤖 Generated with Claude Code