From 786e509ca7ab8494e0e8e4580cf446aa6ba8f268 Mon Sep 17 00:00:00 2001 From: Jack Chung Date: Fri, 6 May 2016 08:09:52 +0800 Subject: [PATCH] Fix math functions so they can be used on host codes as well Add __host__ for some math functions to fix the following tests: - hipSinglePrecisionMathHost - hipDobulePrecisionMathHost [ROCm/clr commit: 5e86860c0580a8203757fa1ab4b9af8fcc6e6ffd] --- projects/clr/hipamd/include/hcc_detail/hip_runtime.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/include/hcc_detail/hip_runtime.h b/projects/clr/hipamd/include/hcc_detail/hip_runtime.h index 5b9eedcab1..3288996dce 100644 --- a/projects/clr/hipamd/include/hcc_detail/hip_runtime.h +++ b/projects/clr/hipamd/include/hcc_detail/hip_runtime.h @@ -142,7 +142,7 @@ __device__ float fmodf(float x, float y); __device__ float frexpf(float x, float y); __device__ float hypotf(float x, float y); __device__ float ilogbf(float x); -__device__ unsigned isfinite(float a); +__host__ __device__ unsigned isfinite(float a); __device__ unsigned isinf(float a); __device__ unsigned isnan(float a); __device__ float j0f(float x); @@ -181,7 +181,7 @@ __device__ float roundf(float x); __device__ float rsqrtf(float x); __device__ float scalblnf(float x, long int n); __device__ float scalbnf(float x, int n); -__device__ unsigned signbit(float a); +__host__ __device__ unsigned signbit(float a); __device__ void sincosf(float x, float *sptr, float *cptr); __device__ void sincospif(float x, float *sptr, float *cptr); __device__ float sinf(float x); @@ -234,7 +234,7 @@ __device__ double fmod(double x, double y); __device__ double frexp(double x, int *nptr); __device__ double hypot(double x, double y); __device__ double ilogb(double x); -__device__ unsigned isfinite(double x); +__host__ __device__ unsigned isfinite(double x); __device__ unsigned isinf(double x); __device__ unsigned isnan(double x); __device__ double j0(double x); @@ -273,7 +273,7 @@ __device__ double round(double x); __host__ __device__ double rsqrt(double x); __device__ double scalbln(double x, long int n); __device__ double scalbn(double x, int n); -__device__ unsigned signbit(double a); +__host__ __device__ unsigned signbit(double a); __device__ double sin(double a); __device__ double sincos(double x, double *sptr, double *cptr); __device__ double sincospi(double x, double *sptr, double *cptr);