diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-26 00:43:48 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-26 00:43:48 +0300 |
commit | f081e76037432cb926be45e980eac201d337032c (patch) | |
tree | dd1225521c12ea21c0b0c3d51ec1ae3f8730755f /intern/cycles/util/types_float8_impl.h | |
parent | fa2084ae58a77b1201289b6bedac427f73c762d1 (diff) | |
parent | 462f99bf38648a08226b1fba423315aec2bc577b (diff) |
Merge branch 'master' into geometry-nodes-iterative-cachegeometry-nodes-rigid-body-integration
Diffstat (limited to 'intern/cycles/util/types_float8_impl.h')
-rw-r--r-- | intern/cycles/util/types_float8_impl.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/intern/cycles/util/types_float8_impl.h b/intern/cycles/util/types_float8_impl.h index 0694f5205a5..21931c55071 100644 --- a/intern/cycles/util/types_float8_impl.h +++ b/intern/cycles/util/types_float8_impl.h @@ -15,8 +15,7 @@ CCL_NAMESPACE_BEGIN -#if !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__) -# ifdef __KERNEL_AVX2__ +#ifdef __KERNEL_AVX2__ __forceinline float8::float8() { } @@ -44,8 +43,9 @@ __forceinline float8 &float8::operator=(const float8 &f) m256 = f.m256; return *this; } -# endif /* __KERNEL_AVX2__ */ +#endif /* __KERNEL_AVX2__ */ +#ifndef __KERNEL_GPU__ __forceinline float float8::operator[](int i) const { util_assert(i >= 0); @@ -59,30 +59,29 @@ __forceinline float &float8::operator[](int i) util_assert(i < 8); return *(&a + i); } +#endif ccl_device_inline float8 make_float8(float f) { -# ifdef __KERNEL_AVX2__ +#ifdef __KERNEL_AVX2__ float8 r(_mm256_set1_ps(f)); -# else +#else float8 r = {f, f, f, f, f, f, f, f}; -# endif +#endif return r; } ccl_device_inline float8 make_float8(float a, float b, float c, float d, float e, float f, float g, float h) { -# ifdef __KERNEL_AVX2__ - float8 r(_mm256_set_ps(a, b, c, d, e, f, g, h)); -# else +#ifdef __KERNEL_AVX2__ + float8 r(_mm256_setr_ps(a, b, c, d, e, f, g, h)); +#else float8 r = {a, b, c, d, e, f, g, h}; -# endif +#endif return r; } -#endif /* !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__) */ - CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT8_IMPL_H__ */ |