The main sources of warnings were:
* Printing of a `size_t` which requires the `%zu` specifier.
* Printing of `cl_long`/`cl_ulong` which is now done using the
`PRI*64` macros to ensure portability across 32 and 64-bit builds.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
After compiling OpenCL CTS with -fsanitize=undefined I stumbled upon
some signed integer overflows.
test_absdiff.cpp:103:24: runtime error: signed integer overflow:
419625160 - -1937831252 cannot be represented in type 'int'
test_absdiff.cpp:101:28: runtime error: signed integer overflow:
1277901399 - -1294103363 cannot be represented in type 'int'
test_absdiff.cpp:140:24: runtime error: signed integer overflow:
8945130301981949496 - -2872789959208163723 cannot be represented in type
'long int'
test_absdiff.cpp:138:29: runtime error: signed integer overflow:
5488544718097069860 - -5558131619970145206 cannot be represented in type
'long int'
The result from these operations was used to compare against the kernel result.
This patch replaces the abs_diff manual computations by a function that handles
the signed integer overflow case.