Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_cpu.h')
-rw-r--r--intern/cycles/kernel/kernel_compat_cpu.h94
1 files changed, 47 insertions, 47 deletions
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<typename T> struct texture {
- ccl_always_inline const T& fetch(int index)
- {
- kernel_assert(index >= 0 && index < width);
- return data[index];
- }
+template<typename T> 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<sseb> sse3b;
typedef vector3<ssef> sse3f;
typedef vector3<ssei> 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<avxf> avx3f;
-#endif
+# endif
#endif
CCL_NAMESPACE_END
-#endif /* __KERNEL_COMPAT_CPU_H__ */
+#endif /* __KERNEL_COMPAT_CPU_H__ */