diff options
| author | Mahmoud <[email protected]> | 2018-10-16 17:26:34 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2018-10-16 17:26:34 -0400 |
| commit | 7375668786abfa5b0592fca0ce97fb5a8ba512d4 (patch) | |
| tree | 4abf17acab64630f3a099d82e0cd8250c54d7b5f /src/cuda-sim/cuda-math.h | |
| parent | 802bc9f840aac536330ad93a1cbc2f04ead75106 (diff) | |
| parent | b8db00c3d8cfddb37a96b9cf2f308a67db4d319d (diff) | |
Merge branch 'dev-purdue-integration' 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; |
