From 3b19fd578dbd13ed69ea6318719305505c07fdb3 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 1 Feb 2016 14:26:50 +0530 Subject: [PATCH] Restrict using namespace hc::precise_math to device only --- include/hcc_detail/hip_runtime.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/hcc_detail/hip_runtime.h b/include/hcc_detail/hip_runtime.h index 72ecc3515c..9f5c81152a 100644 --- a/include/hcc_detail/hip_runtime.h +++ b/include/hcc_detail/hip_runtime.h @@ -352,10 +352,11 @@ __device__ inline unsigned long long int __ballot( int input) } -#ifdef __HCC_ACCELERATOR__ #include // TODO: Choose whether default is precise math or fast math based on compilation flag. +#ifdef __HCC_ACCELERATOR__ using namespace hc::precise_math; +#endif //TODO: Undo this once min/max functions are supported by hc inline int min(int arg1, int arg2) __attribute((hc,cpu)) { \ @@ -368,9 +369,6 @@ inline int max(int arg1, int arg2) __attribute((hc,cpu)) { \ __device__ inline float __log2f(float x) {return hc::fast_math::log2(x); }; __device__ inline float __powf(float base, float exponent) {return hc::fast_math::powf(base, exponent); }; -#endif - - /** * Kernel launching