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

Function DiffComponent

tests/gpu/GPUUnitTest.cpp:355–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 }
354
355 void DiffComponent(const std::vector<float> & cpuImage,
356 const std::vector<float> & gpuImage,
357 size_t idx, bool relativeTest, float expectMin,
358 float & diff, size_t & idxDiff,
359 size_t & idxInf, size_t & idxNan)
360 {
361 float cpuVal = cpuImage[idx];
362 float gpuVal = gpuImage[idx];
363 Shader::LimitsDiff infDiff = Shader::ValidateInf(cpuVal, gpuVal);
364 if (infDiff == Shader::NOT_APPLICABLE)
365 {
366 Shader::LimitsDiff nanDiff = Shader::ValidateNan(cpuVal, gpuVal);
367 if (nanDiff == Shader::NOT_APPLICABLE)
368 {
369 if (Shader::ComputeDiff(cpuVal, gpuVal, relativeTest, expectMin, diff))
370 {
371 idxDiff = idx;
372 }
373 }
374 else if (nanDiff == Shader::INCONSISTANT)
375 {
376 idxNan = idx;
377 }
378 }
379 else if (infDiff == Shader::INCONSISTANT)
380 {
381 idxInf = idx;
382 }
383 }
384
385 constexpr size_t invalidIndex = std::numeric_limits<size_t>::max();
386

Callers 1

ValidateImageTextureFunction · 0.85

Calls 3

ValidateInfFunction · 0.85
ValidateNanFunction · 0.85
ComputeDiffFunction · 0.70

Tested by

no test coverage detected