MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / CheckFloat

Function CheckFloat

tests/cpu/SSE_tests.cpp:60–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void CheckFloat(const std::string& operation,
61 const float expected,
62 const float actual,
63 const unsigned precision)
64{
65
66 if ((IsInfinity(expected) && IsInfinity(actual)) ||
67 (OCIO::IsNan(expected) && OCIO::IsNan(actual)))
68 {
69 return;
70 }
71
72 const float rtol = powf(2.f, -((float)precision));
73 OCIO_CHECK_ASSERT_MESSAGE(OCIO::EqualWithAbsError(expected, actual, rtol),
74 GetErrorMessage(operation, expected, actual));
75}
76
77void CheckSSE(const std::string & operation,
78 float expected,

Callers 2

CheckSSEFunction · 0.85
OCIO_ADD_TESTFunction · 0.85

Calls 4

IsInfinityFunction · 0.85
IsNanFunction · 0.85
EqualWithAbsErrorFunction · 0.85
GetErrorMessageFunction · 0.70

Tested by

no test coverage detected