Blender V4.3
types_uint3.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifndef __UTIL_TYPES_H__
8# error "Do not include this file directly, include util/types.h instead."
9#endif
10
12
13#ifndef __KERNEL_NATIVE_VECTOR_TYPES__
14struct uint3 {
15 uint x, y, z;
16
17# ifndef __KERNEL_GPU__
20# endif
21};
22
24#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */
25
26#if defined(__KERNEL_METAL__)
27/* Metal has native packed_float3. */
28#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_ONEAPI__)
29/* CUDA and oneAPI uint3 are already packed. */
30typedef uint3 packed_uint3;
31#else
32/* HIP uint3 is not packed (https://github.com/ROCm-Developer-Tools/HIP/issues/706). */
34 uint x, y, z;
35
37
38 ccl_device_inline_method packed_uint3(const uint px, const uint py, const uint pz)
39 : x(px), y(py), z(pz){};
40
41 ccl_device_inline_method packed_uint3(const uint3 &a) : x(a.x), y(a.y), z(a.z) {}
42
44 {
45 return make_uint3(x, y, z);
46 }
47
49 {
50 x = a.x;
51 y = a.y;
52 z = a.z;
53 return *this;
54 }
55
56# ifndef __KERNEL_GPU__
59# endif
60};
61
62static_assert(sizeof(packed_uint3) == 12, "packed_uint3 expected to be exactly 12 bytes");
63#endif
unsigned int uint
blender::uint3 packed_uint3
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define ccl_device_inline_method
#define __forceinline
__forceinline uint operator[](uint i) const
ccl_device_inline_method packed_uint3()
Definition types_uint3.h:36
ccl_device_inline_method packed_uint3(const uint3 &a)
Definition types_uint3.h:41
ccl_device_inline_method packed_uint3(const uint px, const uint py, const uint pz)
Definition types_uint3.h:38
ccl_device_inline_method packed_uint3 & operator=(const uint3 &a)
Definition types_uint3.h:48
uint y
Definition types_uint3.h:15
__forceinline uint operator[](uint i) const
uint z
Definition types_uint3.h:15
uint x
Definition types_uint3.h:15
ccl_device_inline uint3 make_uint3(uint x, uint y, uint z)