/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/detail/swizzling.hpp Source File#
4 min read time
Applies to Linux
swizzling.hpp
Go to the documentation of this file.
36 // This section defines compile-time index mapping for all defined eSwizzle patterns using template specialization.
45 template <> struct SwizzleIndexMap<eSwizzle::ZYXW, 1> { using Seq = std::integer_sequence<size_t, 0>; };
46 template <> struct SwizzleIndexMap<eSwizzle::ZYXW, 3> { using Seq = std::integer_sequence<size_t, 2, 1, 0>; };
47 template <> struct SwizzleIndexMap<eSwizzle::ZYXW, 4> { using Seq = std::integer_sequence<size_t, 2, 1, 0, 3>; };
79 static_assert(HasTypeTraits<T> && IsCompound<T>, "Type must have type traits and be a compound type");
Definition: strided_data_wrap.hpp:33
__host__ constexpr __device__ T Swizzle(const T &v)
Rearranges the components of a vector according to a given swizzle pattern.
Definition: swizzling.hpp:78
__host__ constexpr __device__ T ExpandSwizzle(const T &v, std::integer_sequence< size_t, I... >)
Definition: swizzling.hpp:56
__host__ constexpr __device__ T SwizzleIndicesImpl(const T &v)
Definition: swizzling.hpp:51
@ XYZW
@ ZYXW
std::make_integer_sequence< size_t, N > Seq
Definition: swizzling.hpp:41
std::integer_sequence< size_t, 0 > Seq
Definition: swizzling.hpp:45
std::integer_sequence< size_t, 2, 1, 0 > Seq
Definition: swizzling.hpp:46
std::integer_sequence< size_t, 2, 1, 0, 3 > Seq
Definition: swizzling.hpp:47
Definition: swizzling.hpp:32