From 43d55a79e499ac5cd9a832cc7ff9906654eef331 Mon Sep 17 00:00:00 2001 From: Jorghi12 Date: Sat, 26 May 2018 00:41:24 -0400 Subject: [PATCH 1/2] Adding double/long int signatures for abs Adding overloads for abs that are found in cuda's math_functions. [ROCm/clr commit: b127488ea9a3891ecffffa6dc6b176c4aef956c7] --- projects/clr/hipamd/include/hip/hcc_detail/math_functions.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h b/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h index e717df07c1..e7312f32f2 100644 --- a/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h +++ b/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h @@ -58,6 +58,8 @@ __device__ float expf(float x); __device__ float expm1f(float x); __device__ int abs(int x); __device__ long long abs(long long x); +__device__ double abs(double x); +__device__ long int abs(long int x); __device__ float fabsf(float x); __device__ float fdimf(float x, float y); __device__ float fdividef(float x, float y); From 8a2d7a25b1f63fa039dd20616bb7586e250d47e3 Mon Sep 17 00:00:00 2001 From: Jorghi12 Date: Sat, 26 May 2018 16:22:10 -0400 Subject: [PATCH 2/2] Update math_functions.h CUDA also has a function named labs. [ROCm/clr commit: b33876ee4d7ee4c135c3217936c9288801819ce0] --- projects/clr/hipamd/include/hip/hcc_detail/math_functions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h b/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h index e7312f32f2..ea3bd97571 100644 --- a/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h +++ b/projects/clr/hipamd/include/hip/hcc_detail/math_functions.h @@ -60,6 +60,7 @@ __device__ int abs(int x); __device__ long long abs(long long x); __device__ double abs(double x); __device__ long int abs(long int x); +__device__ long long int labs(long long int x); __device__ float fabsf(float x); __device__ float fdimf(float x, float y); __device__ float fdividef(float x, float y);