diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-08 15:34:59 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-08 16:27:25 +0300 |
commit | fd397a7d28666f1c3ee9cd85de5760825d62d28e (patch) | |
tree | 87d232e1d575e0f47b87a9bb9b9fd08886e9d562 /intern/cycles/kernel/kernel_compat_cuda.h | |
parent | 01ee88563b64e8f381bbbe9f54894ad27541f050 (diff) |
Cycles: Add utility macro ccl_ref
It is defined to & for CPU side compilation, and defined to an empty for any GPU
platform. The idea here is to use this macro instead of #ifdef block with bunch
of duplicated lines just to make it so CPU code is efficient.
Eventually we might switch to references on CUDA as well, but that would require
some intensive testing.
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_cuda.h')
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cuda.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index 38708f7ff0b..6d1cf055f2c 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -53,6 +53,10 @@ #define ccl_may_alias #define ccl_addr_space #define ccl_restrict __restrict__ +/* TODO(sergey): In theory we might use references with CUDA, however + * performance impact yet to be investigated. + */ +#define ccl_ref #define ccl_align(n) __align__(n) #define ATTR_FALLTHROUGH |