From f466df63a944c78f18cc615662fa4c92fecbdfe8 Mon Sep 17 00:00:00 2001 From: Dan Zimmerman Date: Mon, 28 Oct 2024 18:26:40 +0000 Subject: [PATCH] [torch] Address -Wreturn-type warning when compiling for AMD (#138951) Summary: Yep yep see title Test Plan: CI Differential Revision: D64971115 Pull Request resolved: https://github.com/pytorch/pytorch/pull/138951 Approved by: https://github.com/cyyever, https://github.com/adamomainz --- torch/csrc/distributed/c10d/CUDASymmetricMemory-inl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/torch/csrc/distributed/c10d/CUDASymmetricMemory-inl.h b/torch/csrc/distributed/c10d/CUDASymmetricMemory-inl.h index ef2b61eb8ec..f1c3b5cf117 100644 --- a/torch/csrc/distributed/c10d/CUDASymmetricMemory-inl.h +++ b/torch/csrc/distributed/c10d/CUDASymmetricMemory-inl.h @@ -59,6 +59,7 @@ __device__ __forceinline__ uint32_t cas(uint32_t* addr, uint32_t compare, uint32_t val) { #if defined(USE_ROCM) || (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 800)) CUDA_KERNEL_ASSERT(false); + return 0; #else uint32_t old_val; if constexpr (Sem == MemOpSem::Relaxed) {