diff options
| author | Mahmoud <[email protected]> | 2018-09-14 19:06:37 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2018-09-14 19:06:37 -0400 |
| commit | 7633c9da64049ee379ee48e17ace2c171a0c7abc (patch) | |
| tree | 1af03364b7c2d28543d12e72a139f5d33943af06 /src/cuda-sim/cuda-math.h | |
| parent | a3e64bb5465b2384c46003947c3b874892ba2f5f (diff) | |
| parent | e8c9c7f780b237aad9e5914f4cc57831b562490b (diff) | |
Merge branch 'dev' of https://github.com/gpgpu-sim/gpgpu-sim_distribution into dev
Diffstat (limited to 'src/cuda-sim/cuda-math.h')
| -rw-r--r-- | src/cuda-sim/cuda-math.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cuda-sim/cuda-math.h b/src/cuda-sim/cuda-math.h index 4721e8a..afac330 100644 --- a/src/cuda-sim/cuda-math.h +++ b/src/cuda-sim/cuda-math.h @@ -67,6 +67,8 @@ #ifndef CUDA_MATH #define CUDA_MATH +#include <cmath> + // cuda math implementations #undef max #undef min @@ -148,6 +150,7 @@ float __ll2float_rd(long long int a) { #include <device_types.h> #include <fenv.h> + // 32-bit integer to float float __int2float_rn(int a) { int orig_rnd_mode = fegetround(); @@ -321,7 +324,7 @@ float __internal_accurate_fdividef(float a, float b) float __saturatef(float a) { float b; - if (isnan(a)) b = 0.0f; + if (std::isnan(a)) b = 0.0f; else if (a >= 1.0f) b = 1.0f; else if (a <= 0.0f) b = 0.0f; else b = a; |
