From a7171e039150a5f6fbfde0c2c1ded1ca32d26d03 Mon Sep 17 00:00:00 2001 From: Xavier Hallade Date: Tue, 4 Jun 2024 18:56:52 +0200 Subject: [PATCH] Cycles: oneAPI: Cleanup: Change packed_float3 to float3 float3 is already packed in oneAPI. No functional change is expected. --- intern/cycles/util/math_float3.h | 3 ++- intern/cycles/util/types_float3.h | 4 ++-- intern/cycles/util/types_int3.h | 4 ++-- intern/cycles/util/types_uint3.h | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/intern/cycles/util/math_float3.h b/intern/cycles/util/math_float3.h index 581a29094b9..b15e522854a 100644 --- a/intern/cycles/util/math_float3.h +++ b/intern/cycles/util/math_float3.h @@ -158,7 +158,8 @@ ccl_device_inline float3 operator/=(float3 &a, float f) return a = a * invf; } -# if !(defined(__KERNEL_METAL__) || defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__)) +# if !(defined(__KERNEL_METAL__) || defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__) || \ + defined(__KERNEL_ONEAPI__)) ccl_device_inline packed_float3 operator*=(packed_float3 &a, const float3 b) { a = float3(a) * b; diff --git a/intern/cycles/util/types_float3.h b/intern/cycles/util/types_float3.h index 47e17959e74..6c327005797 100644 --- a/intern/cycles/util/types_float3.h +++ b/intern/cycles/util/types_float3.h @@ -63,8 +63,8 @@ ccl_device_inline void print_float3(ccl_private const char *label, const float3 * CPU SIMD instructions can be used. */ #if defined(__KERNEL_METAL__) /* Metal has native packed_float3. */ -#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__) -/* CUDA and HIP float3 are already packed. */ +#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_HIP__) || defined(__KERNEL_ONEAPI__) +/* CUDA, HIP and oneAPI float3 are already packed. */ typedef float3 packed_float3; #else struct packed_float3 { diff --git a/intern/cycles/util/types_int3.h b/intern/cycles/util/types_int3.h index 160eead9dfb..56911ecc803 100644 --- a/intern/cycles/util/types_int3.h +++ b/intern/cycles/util/types_int3.h @@ -53,8 +53,8 @@ ccl_device_inline void print_int3(ccl_private const char *label, const int3 a); #if defined(__KERNEL_METAL__) /* Metal has native packed_int3. */ -#elif defined(__KERNEL_CUDA__) -/* CUDA int3 is already packed. */ +#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_ONEAPI__) +/* CUDA and oneAPI int3 are already packed. */ typedef int3 packed_int3; #else /* HIP int3 is not packed (https://github.com/ROCm-Developer-Tools/HIP/issues/706). */ diff --git a/intern/cycles/util/types_uint3.h b/intern/cycles/util/types_uint3.h index a0bd004be76..f3ee89e8929 100644 --- a/intern/cycles/util/types_uint3.h +++ b/intern/cycles/util/types_uint3.h @@ -25,8 +25,8 @@ ccl_device_inline uint3 make_uint3(uint x, uint y, uint z); #if defined(__KERNEL_METAL__) /* Metal has native packed_float3. */ -#elif defined(__KERNEL_CUDA__) -/* CUDA uint3 is already packed. */ +#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_ONEAPI__) +/* CUDA and oneAPI uint3 are already packed. */ typedef uint3 packed_uint3; #else /* HIP uint3 is not packed (https://github.com/ROCm-Developer-Tools/HIP/issues/706). */