From d019772bd0518b79fbe4afcf378aeaf0c13bc873 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Mon, 1 Aug 2022 14:07:02 +0000 Subject: [PATCH] SWDEV-348565 - Support for += operator. Change-Id: I29045733de3906849e68b89c22e01badc9bd2b24 [ROCm/clr commit: 638f9a7c0e420537d4b3a51203a7e0a35448453c] --- .../include/hip/amd_detail/amd_hip_runtime.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h index 6bb4658c69..851e3b2f74 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h +++ b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_runtime.h @@ -296,9 +296,18 @@ template struct __HIP_Coordinates { using R = decltype(F{}(0)); - struct __X { __device__ operator R() const noexcept { return F{}(0); } }; - struct __Y { __device__ operator R() const noexcept { return F{}(1); } }; - struct __Z { __device__ operator R() const noexcept { return F{}(2); } }; + struct __X { + __device__ operator R() const noexcept { return F{}(0); } + __device__ R operator+=(const R& rhs) { return F{}(0) + rhs; } + }; + struct __Y { + __device__ operator R() const noexcept { return F{}(1); } + __device__ R operator+=(const R& rhs) { return F{}(1) + rhs; } + }; + struct __Z { + __device__ operator R() const noexcept { return F{}(2); } + __device__ R operator+=(const R& rhs) { return F{}(2) + rhs; } + }; static constexpr __X x{}; static constexpr __Y y{};