Commit eabb08c
Fix [[nodiscard]] build errors and BUCK deps across comms, gloo, caffe2 (#494)
Summary:
X-link: meta-pytorch/torchcomms#960
X-link: pytorch/pytorch#176671
ROCm 7.0+ HIP headers annotate API functions (hipStreamDestroy,
hipMemcpyAsync, hipStreamSynchronize, hipSetDevice, hipGetDevice, hipFree,
hipHostUnregister, hipDeviceEnablePeerAccess, cuGetErrorString) with
[[nodiscard]]. Combined with -Werror, this causes build failures wherever
return values are discarded.
Originally discovered building with ROCm 7.2 headers, but confirmed to
also affect ROCm 7.0 builds (reported independently by yvliu and hqguo).
The [[nodiscard]] attribute is present in both ROCm 7.0 and 7.2 HIP
headers — the fix is the same for both versions.
Changes:
- Add (void) casts to suppress [[nodiscard]] warnings across comms/
(tcp_devmem, ctran, rcclx), gloo/, and caffe2/ (nativert) — 12 C++ files
- Fix BUCK dependency issues in comms/tcp_devmem/nccl (replace devmgr-client
with common:common) and comms/tcp_devmem/unpack (explicit glog dep path)
that surface when building these targets under ROCm constraints
The (void) casts are no-ops on CUDA and older ROCm — safe to land
regardless of ROCm version.
Reviewed By: bbeckca
Differential Revision: D937592691 parent bcd1672 commit eabb08c
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
0 commit comments