diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-08 02:02:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-08 02:13:26 +0400 |
commit | e2522b4a291b5b67f040fadbbef6f52ccce838ed (patch) | |
tree | d9e510b297ab48cf436049fbda028c4b1262f977 /intern/cycles/kernel/kernel_compat_cuda.h | |
parent | 9245e1aeb86ebe173849b9543966a42ca3964805 (diff) |
Cycles: correct math wrappers
include the parens around value before cast,
in some cases was causing double/float promotion by only casting the left value.
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_cuda.h')
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cuda.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index e4c20d26ff1..f14f3262274 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -75,12 +75,11 @@ typedef texture<uchar4, 2, cudaReadModeNormalizedFloat> texture_image_uchar4; /* Use fast math functions */ -#define cosf(x) __cosf(((float)x)) -#define sinf(x) __sinf(((float)x)) -#define powf(x, y) __powf(((float)x), ((float)y)) -#define tanf(x) __tanf(((float)x)) -#define logf(x) __logf(((float)x)) -#define expf(x) __expf(((float)x)) +#define cosf(x) __cosf(((float)(x))) +#define sinf(x) __sinf(((float)(x))) +#define powf(x, y) __powf(((float)(x)), ((float)(y))) +#define tanf(x) __tanf(((float)(x))) +#define logf(x) __logf(((float)(x))) +#define expf(x) __expf(((float)(x))) #endif /* __KERNEL_COMPAT_CUDA_H__ */ - |