From e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Apr 2019 06:17:24 +0200 Subject: ClangFormat: apply to source, most of intern Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat --- intern/cycles/kernel/kernel_compat_cpu.h | 94 ++++++++++++++++---------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'intern/cycles/kernel/kernel_compat_cpu.h') diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index 4ee80850402..e8fedca4489 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -55,9 +55,9 @@ /* On x86_64, versions of glibc < 2.16 have an issue where expf is * much slower than the double version. This was fixed in glibc 2.16. */ -#if !defined(__KERNEL_GPU__) && defined(__x86_64__) && defined(__x86_64__) && \ - defined(__GNU_LIBRARY__) && defined(__GLIBC__ ) && defined(__GLIBC_MINOR__) && \ - (__GLIBC__ <= 2 && __GLIBC_MINOR__ < 16) +#if !defined(__KERNEL_GPU__) && defined(__x86_64__) && defined(__x86_64__) && \ + defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \ + (__GLIBC__ <= 2 && __GLIBC_MINOR__ < 16) # define expf(x) ((float)exp((double)(x))) #endif @@ -71,41 +71,41 @@ CCL_NAMESPACE_BEGIN /* Texture types to be compatible with CUDA textures. These are really just * simple arrays and after inlining fetch hopefully revert to being a simple * pointer lookup. */ -template struct texture { - ccl_always_inline const T& fetch(int index) - { - kernel_assert(index >= 0 && index < width); - return data[index]; - } +template struct texture { + ccl_always_inline const T &fetch(int index) + { + kernel_assert(index >= 0 && index < width); + return data[index]; + } #if defined(__KERNEL_AVX__) || defined(__KERNEL_AVX2__) - /* Reads 256 bytes but indexes in blocks of 128 bytes to maintain - * compatibility with existing indicies and data structures. - */ - ccl_always_inline avxf fetch_avxf(const int index) - { - kernel_assert(index >= 0 && (index+1) < width); - ssef *ssef_data = (ssef*)data; - ssef *ssef_node_data = &ssef_data[index]; - return _mm256_loadu_ps((float *)ssef_node_data); - } + /* Reads 256 bytes but indexes in blocks of 128 bytes to maintain + * compatibility with existing indicies and data structures. + */ + ccl_always_inline avxf fetch_avxf(const int index) + { + kernel_assert(index >= 0 && (index + 1) < width); + ssef *ssef_data = (ssef *)data; + ssef *ssef_node_data = &ssef_data[index]; + return _mm256_loadu_ps((float *)ssef_node_data); + } #endif #ifdef __KERNEL_SSE2__ - ccl_always_inline ssef fetch_ssef(int index) - { - kernel_assert(index >= 0 && index < width); - return ((ssef*)data)[index]; - } - - ccl_always_inline ssei fetch_ssei(int index) - { - kernel_assert(index >= 0 && index < width); - return ((ssei*)data)[index]; - } + ccl_always_inline ssef fetch_ssef(int index) + { + kernel_assert(index >= 0 && index < width); + return ((ssef *)data)[index]; + } + + ccl_always_inline ssei fetch_ssei(int index) + { + kernel_assert(index >= 0 && index < width); + return ((ssei *)data)[index]; + } #endif - T *data; - int width; + T *data; + int width; }; /* Macros to handle different memory storage on different devices */ @@ -124,33 +124,33 @@ typedef vector3 sse3b; typedef vector3 sse3f; typedef vector3 sse3i; -ccl_device_inline void print_sse3b(const char *label, sse3b& a) +ccl_device_inline void print_sse3b(const char *label, sse3b &a) { - print_sseb(label, a.x); - print_sseb(label, a.y); - print_sseb(label, a.z); + print_sseb(label, a.x); + print_sseb(label, a.y); + print_sseb(label, a.z); } -ccl_device_inline void print_sse3f(const char *label, sse3f& a) +ccl_device_inline void print_sse3f(const char *label, sse3f &a) { - print_ssef(label, a.x); - print_ssef(label, a.y); - print_ssef(label, a.z); + print_ssef(label, a.x); + print_ssef(label, a.y); + print_ssef(label, a.z); } -ccl_device_inline void print_sse3i(const char *label, sse3i& a) +ccl_device_inline void print_sse3i(const char *label, sse3i &a) { - print_ssei(label, a.x); - print_ssei(label, a.y); - print_ssei(label, a.z); + print_ssei(label, a.x); + print_ssei(label, a.y); + print_ssei(label, a.z); } -#if defined(__KERNEL_AVX__) || defined(__KERNEL_AVX2__) +# if defined(__KERNEL_AVX__) || defined(__KERNEL_AVX2__) typedef vector3 avx3f; -#endif +# endif #endif CCL_NAMESPACE_END -#endif /* __KERNEL_COMPAT_CPU_H__ */ +#endif /* __KERNEL_COMPAT_CPU_H__ */ -- cgit v1.2.3