diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-28 23:21:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-28 23:21:13 +0400 |
commit | 131de4352b9e8f3e4ce77d2d9dc145f5db461aed (patch) | |
tree | c796dc4d9697a1122383dea92aab31493e9c0e1a /intern/cycles/kernel/kernel_compat_cuda.h | |
parent | c2be2fd4083845a381c2462a65dc0856dc6efb8e (diff) |
Cycles: fixes to make CUDA 4.2 work, compiling gave errors in shadows and
other places, was mainly due to instancing not working, but also found
issues in procedural textures.
The problem was with --use_fast_math, this seems to now have way lower
precision for some operations. Disabled this flag and selectively use
fast math functions. Did not find performance regression on GTX 460 after
doing this.
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_cuda.h')
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cuda.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index 2f9f2c45e88..06bdce6c35c 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -62,5 +62,15 @@ typedef texture<uchar4, 2, cudaReadModeNormalizedFloat> texture_image_uchar4; #define kernel_data __data +/* 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 cosf(x) __cosf(((float)x)) +#define tanf(x) __tanf(((float)x)) +#define logf(x) __logf(((float)x)) +#define expf(x) __expf(((float)x)) + #endif /* __KERNEL_COMPAT_CUDA_H__ */ |