From e18aaa955f72979a9a5d0e6977ec5bcf17dbc4f9 Mon Sep 17 00:00:00 2001 From: pensun Date: Wed, 8 Mar 2017 14:06:09 -0600 Subject: [PATCH] add inline to all hip_complex operators Change-Id: Ifba5966c297cbc9299c39ecfc45c7296003ebb5d [ROCm/hip commit: 7488d8c7faf8d8d1f5dd8f4dfd6b3eba65318aa6] --- projects/hip/include/hip/hcc_detail/hip_complex.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/hip_complex.h b/projects/hip/include/hip/hcc_detail/hip_complex.h index d4fea7f034..f50a601b90 100644 --- a/projects/hip/include/hip/hcc_detail/hip_complex.h +++ b/projects/hip/include/hip/hcc_detail/hip_complex.h @@ -28,7 +28,7 @@ THE SOFTWARE. #if __cplusplus #define COMPLEX_ADD_OP_OVERLOAD(type) \ -__device__ __host__ static type operator + (const type& lhs, const type& rhs) { \ +__device__ __host__ static inline type operator + (const type& lhs, const type& rhs) { \ type ret; \ ret.x = lhs.x + rhs.x ; \ ret.y = lhs.y + rhs.y ; \ @@ -36,7 +36,7 @@ __device__ __host__ static type operator + (const type& lhs, const type& rhs) { } #define COMPLEX_SUB_OP_OVERLOAD(type) \ -__device__ __host__ static type operator - (const type& lhs, const type& rhs) { \ +__device__ __host__ static inline type operator - (const type& lhs, const type& rhs) { \ type ret; \ ret.x = lhs.x - rhs.x; \ ret.y = lhs.y - rhs.y; \ @@ -44,7 +44,7 @@ __device__ __host__ static type operator - (const type& lhs, const type& rhs) { } #define COMPLEX_MUL_OP_OVERLOAD(type) \ -__device__ __host__ static type operator * (const type& lhs, const type& rhs) { \ +__device__ __host__ static inline type operator * (const type& lhs, const type& rhs) { \ type ret; \ ret.x = lhs.x * rhs.x - lhs.y * rhs.y; \ ret.y = lhs.x * rhs.y + lhs.y * rhs.x; \ @@ -52,7 +52,7 @@ __device__ __host__ static type operator * (const type& lhs, const type& rhs) { } #define COMPLEX_DIV_OP_OVERLOAD(type) \ -__device__ __host__ static type operator / (const type& lhs, const type& rhs) { \ +__device__ __host__ static inline type operator / (const type& lhs, const type& rhs) { \ type ret; \ ret.x = (lhs.x * rhs.x + lhs.y * rhs.y); \ ret.y = (rhs.x * lhs.y - lhs.x * rhs.y); \ @@ -88,7 +88,7 @@ __device__ __host__ static inline type& operator /= (type& lhs, const type& rhs) } #define COMPLEX_SCALAR_PRODUCT(type, type1) \ -__device__ __host__ static type operator * (const type& lhs, type1 rhs) { \ +__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ type ret; \ ret.x = lhs.x * rhs; \ ret.y = lhs.y * rhs; \