Fix preprocessor guard in gloo/cuda.h for HIP/ROCm builds (#507)#507
Closed
dolpm wants to merge 1 commit into
Closed
Fix preprocessor guard in gloo/cuda.h for HIP/ROCm builds (#507)#507dolpm wants to merge 1 commit into
gloo/cuda.h for HIP/ROCm builds (#507)#507dolpm wants to merge 1 commit into
Conversation
|
@dolpm has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106397943. |
d4l3k
approved these changes
May 26, 2026
gloo/cuda.h for HIP/ROCm buildsgloo/cuda.h for HIP/ROCm builds (#507)
dolpm
added a commit
to dolpm/gloo
that referenced
this pull request
May 26, 2026
) Summary: pytorch#506 Change `#if !GLOO_USE_CUDA` to `#if !defined(GLOO_USE_CUDA)` so the guard checks whether the config macro was defined at all, rather than checking its value. The old form fails when `GLOO_USE_CUDA` is defined to `0` (e.g., in a ROCm-only CMake build via `#cmakedefine01`), because `!0` evaluates to true and triggers the `#error` even though the configuration header was properly generated. Reviewed By: d4l3k Differential Revision: D106397943
) Summary: pytorch#506 Change `#if !GLOO_USE_CUDA` to `#if !GLOO_USE_CUDA && !GLOO_USE_ROCM` so the guard checks whether the either macro is defined and non-zero. The old form fails when `GLOO_USE_CUDA` is defined to `0` (e.g., in a ROCm-only CMake build via `#cmakedefine01`), because `!0` evaluates to true and triggers the `#error` even though the configuration header was properly generated. Reviewed By: d4l3k Differential Revision: D106397943
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.
Summary:
#506
Change
#if !GLOO_USE_CUDAto#if !GLOO_USE_CUDA && !GLOO_USE_ROCMso the guard checks whether the either macro is defined and non-zero. The old form fails whenGLOO_USE_CUDAis defined to0(e.g., in a ROCm-only CMake build via#cmakedefine01), because!0evaluates to true and triggers the#erroreven though the configuration header was properly generated.Reviewed By: d4l3k
Differential Revision: D106397943