Commit Graph

4 Commits

Author SHA1 Message Date
Michael Rizkalla
e36da9798e Migrate integer_ops suite to the new test registration framework (#2332)
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/2181.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-23 15:12:34 +00:00
Sven van Haastregt
b36b2d592c integer_ops: fix -Wformat warnings (#1860)
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>
2023-12-20 17:57:35 +01:00
Juan Manuel Martinez Caamaño
0447b7a2c8 Avoid integer overflows when computing abs_diff (#1689)
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.
2023-05-16 08:44:15 -07:00
James Price
40f50d77a3 Rename test .c sources to .cpp where necessary (#604)
Remove hacks to force language from CMake files.

Closes KhronosGroup/OpenCL-CTS#25
2020-02-21 17:34:31 +00:00