Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4232bcd
Avoid branching in casting implementations
zacharyvincze Jan 28, 2026
77cabc7
Add more tests for Saturate cast
zacharyvincze Feb 3, 2026
d887102
Fix issues with float -> integer saturate casts
zacharyvincze Feb 6, 2026
146a1f9
Undo changes to composite
zacharyvincze Feb 6, 2026
e9e9f0b
Review fixes
zacharyvincze Feb 6, 2026
13a78be
Add another test case for RangeCast
zacharyvincze Feb 6, 2026
f1b1571
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Feb 11, 2026
146c95f
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Feb 12, 2026
1cbedda
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Feb 20, 2026
f97231c
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Feb 23, 2026
e712805
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Feb 25, 2026
9ae56a5
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Mar 2, 2026
12d355b
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Mar 6, 2026
a883238
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Mar 6, 2026
2fcaf2f
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Mar 16, 2026
a88cf40
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 7, 2026
6be0319
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 7, 2026
70a9ef5
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 8, 2026
0916ad2
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 13, 2026
aa74059
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 23, 2026
ae498e7
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 23, 2026
ab56bf8
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze Apr 24, 2026
883a1f0
Fix double precision issue in scalar range casting + add unified roun…
zacharyvincze Apr 28, 2026
bbeefcf
Improve vector saturate/range/static cast constexpr branching
zacharyvincze Apr 28, 2026
0b10ce3
Add additional tests for casting helpers + introduce static cast tests
zacharyvincze Apr 28, 2026
3d54d7d
Use fmed3f for floating point clamping
zacharyvincze Apr 28, 2026
d6fabe0
Merge branch 'develop' into zv/optimization/optimize-casting-performance
zacharyvincze May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 155 additions & 63 deletions include/core/detail/casting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,53 @@
#pragma once

#include <algorithm>
#include <cmath>

#include "core/detail/type_traits.hpp"

namespace roccv::detail {

/**
* @brief Rounds a floating-point value to the nearest integer using IEEE
* half-to-even rounding (the default rounding mode). Matches the semantics of
* __float2int_rn on device. Selects single- vs double-precision based on the
* argument type to avoid silent precision loss when U is double.
*/
template <typename U>
__device__ __host__ inline U IEEERound(U v) {
static_assert(std::is_floating_point_v<U>, "IEEERound requires a floating-point input");
#ifdef __HIP_DEVICE_COMPILE__
if constexpr (std::is_same_v<U, float>) {
return rintf(v);
} else {
return rint(v);
}
#else
return std::rint(v);
#endif
}

/**
* @brief Clamps v to [lo, hi].
* @param[in] v The value to clamp.
* @param[in] lo The lower bound of the clamp.
* @param[in] hi The upper bound of the clamp.
* @return The value v clamped to [lo, hi].
*/
template <typename U>
__device__ __host__ inline U FpClamp(U v, U lo, U hi) {
static_assert(std::is_floating_point_v<U>, "FpClamp requires a floating-point input");
#ifdef __HIP_DEVICE_COMPILE__
if constexpr (std::is_same_v<U, float>) {
return __builtin_amdgcn_fmed3f(v, lo, hi);
} else {
return fmin(fmax(v, lo), hi);
}
#else
return std::clamp(v, lo, hi);
#endif
}

/**
* @brief ScalarSaturateCast is for implementation purposes only. Use SaturateCast directly.
*/
Expand All @@ -36,36 +78,55 @@ __device__ __host__ T ScalarSaturateCast(U v) {
constexpr bool bigToSmall = !smallToBig;

if constexpr (std::is_integral_v<T> && std::is_floating_point_v<U>) {
// Any float -> any integral
return static_cast<T>(std::clamp<U>(std::round(v), static_cast<U>(std::numeric_limits<T>::min()),
static_cast<U>(std::numeric_limits<T>::max())));
} else if constexpr (std::is_integral_v<T> && std::is_integral_v<U> && std::is_signed_v<U> &&
std::is_unsigned_v<T> && smallToBig) {
// Any integral signed -> Any integral unsigned, small -> big or equal
return v <= 0 ? 0 : static_cast<T>(v);
} else if constexpr (std::is_integral_v<U> && std::is_integral_v<T> &&
((std::is_signed_v<U> && std::is_signed_v<T>) ||
(std::is_unsigned_v<U> && std::is_unsigned_v<T>)) &&
bigToSmall) {
// Any integral signed -> Any integral signed, big -> small
// Any integral unsigned -> Any integral unsigned, big -> small
return v <= std::numeric_limits<T>::min()
? std::numeric_limits<T>::min()
: (v >= std::numeric_limits<T>::max() ? std::numeric_limits<T>::max() : static_cast<T>(v));
} else if constexpr (std::is_integral_v<U> && std::is_unsigned_v<U> && std::is_integral_v<T> &&
std::is_signed_v<T>) {
// Any integral unsigned -> Any integral signed, small -> big or equal
return v >= std::numeric_limits<T>::max() ? std::numeric_limits<T>::max() : static_cast<T>(v);
} else if constexpr (std::is_integral_v<U> && std::is_signed_v<U> && std::is_integral_v<T> &&
std::is_unsigned_v<T> && bigToSmall) {
// Any integral signed -> Any integral unsigned, big -> small
return v <= static_cast<U>(std::numeric_limits<T>::min())
? std::numeric_limits<T>::min()
: (v >= static_cast<U>(std::numeric_limits<T>::max()) ? std::numeric_limits<T>::max()
: static_cast<T>(v));
} else {
// All other cases fall into this
return v;
// Float -> integral: clamp to [min, max] then round (IEEE half-to-even).
constexpr U minVal = static_cast<U>(std::numeric_limits<T>::lowest());
constexpr U maxVal = static_cast<U>(std::numeric_limits<T>::max());

if constexpr (sizeof(T) <= 2) {
// 8/16 bit integer cases. These can be represented exactly in floating point.
return static_cast<T>(IEEERound(FpClamp(v, minVal, maxVal)));
} else {
// 32/64 bit integer cases. maxVal may round up to an unrepresentable
// value when cast back, so compare against the rounded source.
const U rounded = IEEERound(v);
return rounded >= maxVal ? std::numeric_limits<T>::max()
: rounded <= minVal ? std::numeric_limits<T>::min()
: static_cast<T>(rounded);
}
}

else if constexpr (std::is_integral_v<T> && std::is_integral_v<U> && std::is_signed_v<U> && std::is_unsigned_v<T> &&
smallToBig) {
// Signed -> unsigned, small to big: clamp negative to 0
// Branchless: max(v, 0) handles negative values
return static_cast<T>(max(v, U{0}));
}

else if constexpr (std::is_integral_v<U> && std::is_integral_v<T> &&
((std::is_signed_v<U> && std::is_signed_v<T>) ||
(std::is_unsigned_v<U> && std::is_unsigned_v<T>)) &&
bigToSmall) {
// Same signedness, big -> small: clamp to [min, max]
constexpr U minVal = static_cast<U>(std::numeric_limits<T>::min());
constexpr U maxVal = static_cast<U>(std::numeric_limits<T>::max());
return static_cast<T>(min(max(v, minVal), maxVal));
}

else if constexpr (std::is_integral_v<U> && std::is_unsigned_v<U> && std::is_integral_v<T> && std::is_signed_v<T>) {
// Unsigned -> signed: clamp to max (can't exceed min since unsigned)
constexpr U maxVal = static_cast<U>(std::numeric_limits<T>::max());
return static_cast<T>(min(v, maxVal));
}

else if constexpr (std::is_integral_v<U> && std::is_signed_v<U> && std::is_integral_v<T> && std::is_unsigned_v<T> &&
bigToSmall) {
// Signed -> unsigned, big -> small: clamp to [0, max]
constexpr U maxVal = static_cast<U>(std::numeric_limits<T>::max());
return static_cast<T>(min(max(v, U{0}), maxVal));
}

else {
return static_cast<T>(v);
}
}

Expand All @@ -83,18 +144,21 @@ __device__ __host__ T ScalarSaturateCast(U v) {
template <typename T, typename U,
class = std::enable_if_t<(HasTypeTraits<T> && HasTypeTraits<U>) && (NumElements<T> <= NumElements<U>)>>
__device__ __host__ T SaturateCast(U v) {
using B = BaseType<T>;
if constexpr (std::is_same_v<T, U>) {
return v;
} else if constexpr (NumElements<T> == 1) {
return T{ScalarSaturateCast<B>(GetElement(v, 0))};
} else if constexpr (NumElements<T> == 2) {
return T{ScalarSaturateCast<B>(GetElement(v, 0)), ScalarSaturateCast<B>(GetElement(v, 1))};
} else if constexpr (NumElements<T> == 3) {
return T{ScalarSaturateCast<B>(GetElement(v, 0)), ScalarSaturateCast<B>(GetElement(v, 1)),
ScalarSaturateCast<B>(GetElement(v, 2))};
} else {
static_assert(NumElements<T> == 4, "SaturateCast supports up to 4-element vectors");
return T{ScalarSaturateCast<B>(GetElement(v, 0)), ScalarSaturateCast<B>(GetElement(v, 1)),
ScalarSaturateCast<B>(GetElement(v, 2)), ScalarSaturateCast<B>(GetElement(v, 3))};
}

T ret{};

GetElement(ret, 0) = ScalarSaturateCast<BaseType<T>>(GetElement(v, 0));
if constexpr (NumElements<T> >= 2) GetElement(ret, 1) = ScalarSaturateCast<BaseType<T>>(GetElement(v, 1));
if constexpr (NumElements<T> >= 3) GetElement(ret, 2) = ScalarSaturateCast<BaseType<T>>(GetElement(v, 2));
if constexpr (NumElements<T> >= 4) GetElement(ret, 3) = ScalarSaturateCast<BaseType<T>>(GetElement(v, 3));

return ret;
}

/**
Expand All @@ -109,17 +173,40 @@ __device__ __host__ T ScalarRangeCast(U v) {
}

else if constexpr (std::is_integral_v<T> && std::is_floating_point_v<U> && std::is_signed_v<T>) {
// Float to signed integers
return v >= T{1} ? std::numeric_limits<T>::max()
: v <= T{-1} ? std::numeric_limits<T>::min()
: static_cast<T>(std::round(static_cast<U>(std::numeric_limits<T>::max()) * v));
// Float to signed integer. Map [-1, 1] -> [min, max] with IEEE half-to-even rounding.
constexpr U scale = static_cast<U>(std::numeric_limits<T>::max());

if constexpr (sizeof(T) <= 2) {
// 8/16 bit signed cases. These can be represented exactly in floating point,
// so clamp first then round.
return static_cast<T>(IEEERound(FpClamp(v, U{-1}, U{1}) * scale));
} else {
// 32/64 bit signed cases.
return v >= U{1} ? std::numeric_limits<T>::max()
: v <= U{-1} ? std::numeric_limits<T>::min()
: static_cast<T>(IEEERound(scale * v));
}
}

else if constexpr (std::is_integral_v<T> && std::is_floating_point_v<U> && std::is_unsigned_v<T>) {
// float to unsigned integers
return v >= T{1} ? std::numeric_limits<T>::max()
: v <= T{0} ? 0
: static_cast<T>(lrintf(static_cast<U>(std::numeric_limits<T>::max()) * v));
constexpr U scale = static_cast<U>(std::numeric_limits<T>::max());

if constexpr (sizeof(T) <= 2) {
// 8/16 bit integer cases. These can be represented exactly in floating point.
#ifdef __HIP_DEVICE_COMPILE__
if constexpr (std::is_same_v<U, float>) {
return static_cast<T>(__float2int_rn(__saturatef(v) * scale));
} else {
return static_cast<T>(IEEERound(FpClamp(v, U{0}, U{1}) * scale));
}
#else
return static_cast<T>(IEEERound(FpClamp(v, U{0}, U{1}) * scale));
#endif
} else {
// 32/64 bit integer cases.
return v >= U{1} ? std::numeric_limits<T>::max() : v <= U{0} ? T{0} : static_cast<T>(IEEERound(v * scale));
}
}

else if constexpr (std::is_floating_point_v<T> && std::is_integral_v<U> && std::is_signed_v<U>) {
Expand Down Expand Up @@ -162,18 +249,21 @@ __device__ __host__ T ScalarRangeCast(U v) {
template <typename T, typename U,
class = std::enable_if_t<(HasTypeTraits<T> && HasTypeTraits<U>) && NumElements<T> <= NumElements<U>>>
__device__ __host__ T RangeCast(U v) {
using B = BaseType<T>;
if constexpr (std::is_same_v<T, U>) {
return v;
} else if constexpr (NumElements<T> == 1) {
return T{ScalarRangeCast<B>(GetElement(v, 0))};
} else if constexpr (NumElements<T> == 2) {
return T{ScalarRangeCast<B>(GetElement(v, 0)), ScalarRangeCast<B>(GetElement(v, 1))};
} else if constexpr (NumElements<T> == 3) {
return T{ScalarRangeCast<B>(GetElement(v, 0)), ScalarRangeCast<B>(GetElement(v, 1)),
ScalarRangeCast<B>(GetElement(v, 2))};
} else {
static_assert(NumElements<T> == 4, "RangeCast supports up to 4-element vectors");
return T{ScalarRangeCast<B>(GetElement(v, 0)), ScalarRangeCast<B>(GetElement(v, 1)),
ScalarRangeCast<B>(GetElement(v, 2)), ScalarRangeCast<B>(GetElement(v, 3))};
}

T ret{};

GetElement(ret, 0) = ScalarRangeCast<BaseType<T>>(GetElement(v, 0));
if constexpr (NumElements<T> >= 2) GetElement(ret, 1) = ScalarRangeCast<BaseType<T>>(GetElement(v, 1));
if constexpr (NumElements<T> >= 3) GetElement(ret, 2) = ScalarRangeCast<BaseType<T>>(GetElement(v, 2));
if constexpr (NumElements<T> >= 4) GetElement(ret, 3) = ScalarRangeCast<BaseType<T>>(GetElement(v, 3));

return ret;
}

/**
Expand All @@ -187,21 +277,23 @@ __device__ __host__ T RangeCast(U v) {
template <typename T, typename U,
class = std::enable_if_t<(HasTypeTraits<T> && HasTypeTraits<U>) && NumElements<T> <= NumElements<U>>>
__device__ __host__ T StaticCast(U v) {
using B = BaseType<T>;
if constexpr (std::is_same_v<T, U>) {
// Both same type, just return the value.
return v;
} else if constexpr (!IsCompound<T> && !IsCompound<U>) {
// Both scalar values. Reduces to a standard static cast.
return static_cast<T>(v);
} else if constexpr (NumElements<T> == 1) {
return T{StaticCast<B>(GetElement(v, 0))};
} else if constexpr (NumElements<T> == 2) {
return T{StaticCast<B>(GetElement(v, 0)), StaticCast<B>(GetElement(v, 1))};
} else if constexpr (NumElements<T> == 3) {
return T{StaticCast<B>(GetElement(v, 0)), StaticCast<B>(GetElement(v, 1)), StaticCast<B>(GetElement(v, 2))};
} else {
// Vector types. Perform casting on each element.
T ret{};
GetElement(ret, 0) = StaticCast<BaseType<T>>(GetElement(v, 0));
if constexpr (NumElements<T> >= 2) GetElement(ret, 1) = StaticCast<BaseType<T>>(GetElement(v, 1));
if constexpr (NumElements<T> >= 3) GetElement(ret, 2) = StaticCast<BaseType<T>>(GetElement(v, 2));
if constexpr (NumElements<T> >= 4) GetElement(ret, 3) = StaticCast<BaseType<T>>(GetElement(v, 3));

return ret;
static_assert(NumElements<T> == 4, "StaticCast supports up to 4-element vectors");
return T{StaticCast<B>(GetElement(v, 0)), StaticCast<B>(GetElement(v, 1)), StaticCast<B>(GetElement(v, 2)),
StaticCast<B>(GetElement(v, 3))};
}
}
} // namespace roccv::detail
3 changes: 3 additions & 0 deletions include/core/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include <hip/hip_runtime.h>

#include <cassert>

#pragma once
Expand Down Expand Up @@ -83,6 +84,8 @@ DEFINE_TYPE_TRAITS_0_TO_4(int, signed int);
DEFINE_TYPE_TRAITS_0_TO_4(short, signed short);
DEFINE_TYPE_TRAITS_0_TO_4(ushort, unsigned short);
DEFINE_TYPE_TRAITS_0_TO_4(double, double);
DEFINE_TYPE_TRAITS_0_TO_4(long, signed long);
DEFINE_TYPE_TRAITS_0_TO_4(ulong, unsigned long);

/**
* @brief Returns the number of elements in a HIP vectorized type. For example: uchar3 will return 3, int2 will
Expand Down
67 changes: 67 additions & 0 deletions tests/roccv/cpp/src/tests/core/detail/test_range_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int main(int argc, char **argv) {
TEST_CASE(EXPECT_EQ(RangeCast<int>(-1.0f), std::numeric_limits<int>::min()));
TEST_CASE(EXPECT_EQ(RangeCast<uint>(1.0f), std::numeric_limits<uint>::max()));
TEST_CASE(EXPECT_EQ(RangeCast<uint>(-1.0f), 0));
TEST_CASE(EXPECT_EQ(RangeCast<uint>(0.0f), 0));


// Test unsigned/signed integer -> float casting
TEST_CASE(EXPECT_EQ(RangeCast<float>(std::numeric_limits<int>::max()), 1.0f));
Expand All @@ -58,6 +60,71 @@ int main(int argc, char **argv) {
TEST_CASE(EXPECT_EQ(RangeCast<double>(std::numeric_limits<uint>::max()), 1.0f));
TEST_CASE(EXPECT_EQ(RangeCast<double>(0), 0.0f));

// ----- 8/16-bit signed fast path -----
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(1.0f), 127));
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(-1.0f), -127));
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(0.0f), 0));
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(2.0f), 127)); // out-of-range positive clamps
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(-2.0f), -127)); // out-of-range negative clamps
TEST_CASE(EXPECT_EQ(RangeCast<int16_t>(1.0f), 32767));
TEST_CASE(EXPECT_EQ(RangeCast<int16_t>(-1.0f), -32767));
TEST_CASE(EXPECT_EQ(RangeCast<int16_t>(2.0f), 32767));
TEST_CASE(EXPECT_EQ(RangeCast<int16_t>(-2.0f), -32767));

// ----- 8/16-bit unsigned fast path -----
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(1.0f), 255));
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(0.0f), 0));
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(2.0f), 255)); // clamp positive
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(-0.5f), 0)); // clamp negative
TEST_CASE(EXPECT_EQ(RangeCast<uint16_t>(1.0f), 65535));
TEST_CASE(EXPECT_EQ(RangeCast<uint16_t>(-1.0f), 0));

// ----- Rounding mode: must be IEEE half-to-even -----
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(0.5f / 255.0f), 0)); // would be 1 with std::round
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(1.5f / 255.0f), 2)); // round half to even
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(2.5f / 255.0f), 2)); // round half to even (down)
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(0.5f / 127.0f), 0)); // signed: same rounding rule
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(-0.5f / 127.0f), 0));
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(-1.5f / 127.0f), -2));

// ----- Double precision in float -> int -----
TEST_CASE(EXPECT_EQ(RangeCast<int>(0.5), std::numeric_limits<int>::max() / 2 + 1));
TEST_CASE(EXPECT_EQ(RangeCast<int>(0.0), 0));
TEST_CASE(EXPECT_EQ(RangeCast<uint>(0.0), 0u));

// ----- int -> float clamping: signed min hits the -1.008... clamp -----
// numeric_limits<int8_t>::min() / max() = -128 / 127 = -1.0078..., must clamp to -1.
TEST_CASE(EXPECT_EQ(RangeCast<float>(int8_t{-128}), -1.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(int8_t{127}), 1.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(int8_t{0}), 0.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(int16_t{-32768}), -1.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(int16_t{32767}), 1.0f));

// ----- uint -> float -----
TEST_CASE(EXPECT_EQ(RangeCast<float>(uint8_t{255}), 1.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(uint8_t{0}), 0.0f));
TEST_CASE(EXPECT_EQ(RangeCast<float>(uint16_t{65535}), 1.0f));

// ----- Integer -> integer falls back to SaturateCast -----
TEST_CASE(EXPECT_EQ(RangeCast<int8_t>(int32_t{300}), 127));
TEST_CASE(EXPECT_EQ(RangeCast<uint8_t>(int32_t{-1}), 0));

// ----- Vector types -----
// float -> uchar4: 0.0 -> 0, 0.5 -> 128, 1.0 -> 255 (with banker's rounding at half)
TEST_CASE(EXPECT_TRUE(
(RangeCast<uchar4>(float4{0.0f, 0.5f, 1.0f, -0.5f}) == uchar4{0, 128, 255, 0})));
// uchar4 -> float4: 0 -> 0.0, 255 -> 1.0
{
float4 result = RangeCast<float4>(uchar4{0, 128, 255, 64});
TEST_CASE(EXPECT_EQ(result.x, 0.0f));
TEST_CASE(EXPECT_EQ(result.z, 1.0f));
TEST_CASE(EXPECT_TRUE(std::abs(result.y - (128.0f / 255.0f)) < 1e-6f));
TEST_CASE(EXPECT_TRUE(std::abs(result.w - (64.0f / 255.0f)) < 1e-6f));
}
// 2- and 3-element vectors
TEST_CASE(EXPECT_TRUE((RangeCast<uchar2>(float2{0.5f, -10.0f}) == uchar2{128, 0})));
TEST_CASE(EXPECT_TRUE((RangeCast<char3>(float3{1.0f, -1.0f, 0.0f}) == char3{127, -127, 0})));

// clang-format on

TEST_CASES_END();
Expand Down
Loading