MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / abs_diff

Function abs_diff

test_conformance/integer_ops/test_absdiff.cpp:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include <cinttypes>
24template <class Integer>
25static typename std::make_unsigned<Integer>::type abs_diff(Integer a, Integer b)
26{
27 using Unsigned = typename std::make_unsigned<Integer>::type;
28 Unsigned ua = a;
29 Unsigned ub = b;
30 Unsigned diff = ua - ub;
31 if (a < b) diff = -diff;
32 return diff;
33}
34
35static int verify_absdiff_char( const void *p, const void *q, const void *r, size_t n, const char *sizeName, size_t vecSize )
36{

Callers 8

verify_absdiff_charFunction · 0.85
verify_absdiff_ucharFunction · 0.85
verify_absdiff_shortFunction · 0.85
verify_absdiff_ushortFunction · 0.85
verify_absdiff_intFunction · 0.85
verify_absdiff_uintFunction · 0.85
verify_absdiff_longFunction · 0.85
verify_absdiff_ulongFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected