Commit Graph

51 Commits

Author SHA1 Message Date
Marcin Hajder
0395a1efef Correction for printing long type variables in 32-bit system (#2094)
Due to change request from #2037
2024-10-01 08:45:39 -07:00
Marcin Hajder
661a7b08ae Added printf test for long type cases (#2037)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-09-24 08:42:49 -07:00
Cui, Dele
9f88b0b229 Specify precision in the format flag for float4 hexadecimal output (#2064)
This will ensure consistent output on any conforming implementation.
Note that the specification does not define the output style when
precision is missing.

---------

Signed-off-by: Cui, Dele <dele.cui@intel.com>
2024-09-19 09:30:10 +02:00
Sven van Haastregt
c0db608eac printf: add missing vector length modifiers (#2044)
The length modifier is required with a vector specifier.

Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/2039

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-08-29 14:45:15 +02:00
Marcin Hajder
0a00a1f5b0 Added printf test for double type cases (#2022)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-08-27 08:41:05 -07:00
Marcin Hajder
aa49f3bb53 Added few missing format cases for zero and blank space padding (#2016)
according to work plan for issue #1058
2024-08-13 09:50:07 -07:00
Marcin Hajder
19cb042985 Extended printf test to support more vector cases (#2019)
according to work plan for issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1058
2024-08-06 08:45:58 -07:00
David Neto
0be82dce5e [printf] Test empty format string, and empty arg string (#2018)
Issue: #1058
2024-07-23 20:11:34 +01:00
David Neto
5b5e43e1fb [printf]: input value should be exactly representable as 32-bit float (#2015)
Fixed: #2009
2024-07-18 14:08:43 -07:00
Sven van Haastregt
881560a0fe printf: add missing cstdint include (#2011)
Since GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-07-12 17:23:59 +02:00
Marcin Hajder
8cd2b7d799 Extended printf test with new mixed format cases (#1988)
According to work plan from issue #1058

Added new case `TYPE_MIXED_FORMAT_RANDOM` which focus on three factors:

-data before conversion flags - this is randomly generated ascii string
-randomly generated conversion flags - integer or floating point, for
each flag specific argument is generated
-data after conversion flags - this is randomly generated ascii string

Moreover, due to fact in case of `TYPE_MIXED_FORMAT_RANDOM` test is
generated on the fly, logging of negative result was extended.
2024-07-09 08:47:31 -07:00
Karol Herbst
89923f8004 Extend printf tests with more %% corner cases (#1986)
We've had a couple of bugs inside mesa/rusticl processing %% correctly.
I've added those cases locally to make sure all corner cases are
properly handled.
2024-07-02 09:30:03 -07:00
Marcin Hajder
582fea57dc Extended printf test with new strings cases (#1951)
According to work plan from issue #1058

Corrections to general test:
-removed duplication of separate tests for each element of
`PrintfTestType` vector, instead `doTest` procedure would iterate over
vector related to specific `PrintfTestType` automaticaly
-fixed procedure to assemble kernel source so it can accept only one
parameter of the function ( eg. `printf("%%");` )
-incorporated important modifications from #1940 to avoid expected
conflicts
-warnings fixes, minor corrections, clang format

Extension for string testing:
-special symbols
-nested symbols
-all ascii characters 
-added new type of test `TYPE_FORMAT_STRING` to verify format string
only (according to request from the issue)
2024-06-18 08:44:18 -07:00
Marcin Hajder
88a707dd13 Corrections for printf test with floating point limits arguments (#1940)
According to work plan from issue #1058
2024-05-21 08:38:04 -07:00
Marcin Hajder
f31b2f029c Added cl_half support for test_relationals (#1623)
* Added cl_khr_fp16 support for test_relationals (issue #142, relationals)

* Added cl_khr_fp16 support for any and bitselect test cases (issue #142, relationals)

* correction related to automated travis build for macOS (issue #142, relationals)

* more corrections related to automated travis build for macOS (issue #142, relationals)

* Added few cosmetic corrections (issue #142, test_relationals)

* Added missing clang format

* Added corrections related to order of initialization

* Added corrections due to code review (issue #142, relationals)

* Correction for prev commit

* Added subnormals related condition for test verification (issue #142, relationals)

* Added indexing correction due to code review

* Replaced hardcoded iteration limit (issue #142, relationals)
2023-05-16 08:43:47 -07:00
Marcin Hajder
f0f887d07f printf test cases for cl_khr_command_buffer extenstion (#1592)
* Added printf test case for cl_khr_command_buffer extenstion according to point 1.6 from:

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Corrections related to macos and windows build

* Added missing header

* Added corrections related to code review of draft PR:

https://github.com/KhronosGroup/OpenCL-CTS/pull/1592

refers to issue #1369, p.1.6:

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* minor fix for previous commit

* printf capability condition moved to ::Skip method (#1369, p.1.6):

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Applied minor corrections related to code review (#1369, p.1.6):

https://github.com/KhronosGroup/OpenCL-CTS/issues/1369

* Added correction to replace string literals with sequence of characters printf arguments (issue #1369, printf)

* Added clang formatting.

* Added header related to android build (issue #1369, printf)

* Fixed memory leak

* Fixed memory leak in test_printf

* Added cosmetic fix for last commit
2023-04-04 08:12:05 +01:00
Marcin Hajder
20ab003053 Added cl_half support for test_printf (#1622)
* Added support to test half floats with printf calls (issue #142, printf)

* Added corrections related to rounding and casting halfs (issue #142, printf)

* Reusing similar function (issue #142, printf)

* Corrected path without cl_khr_fp16 support (issue #142, printf)

* Cosmetic fix for order of vector tests (issue #142, printf)

* Added correction related to vendor test review (issue #142, printf)
2023-03-28 08:57:03 -07:00
Sven van Haastregt
a61fa63054 [NFC] cmake: Remove redundant CMAKE_CXX_STANDARD (#1558)
`CMAKE_CXX_STANDARD` is already set in the top-level CMakeLists.txt
file, so there is no need to have it repeated for individual modules.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-11-04 08:53:42 -07:00
Krzysztof Kosiński
180adef84c Remove __DATE__ and __TIME__ usage (#1506)
These macros make the build non-deterministic.
2022-09-23 17:29:18 +01:00
Sven van Haastregt
6554c49018 [NFCI] Remove unused variables and enable -Wunused-variable (#1483)
Remove unused variables throughout the code base and enable the
`-Wunused-variable` warning flag globally to prevent new unused
variable issues being introduced in the future.

This is mostly a non-functional change, with one exception:

 - In `test_conformance/api/test_kernel_arg_info.cpp`, an error check
   of the clGetDeviceInfo return value was added.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-09-08 12:54:36 +01:00
Jeremy Kemp
e437acd908 Added simple test for CL_DEVICE_PRINTF_BUFFER_SIZE. (#1386)
* Added simple test for CL_DEVICE_PRINTF_BUFFER_SIZE.

* Clang format fix.
2022-03-02 18:28:12 +00:00
ellnor01
25d9ff5d6e Using helper functions for clCreateKernel (#1064)
* Using helper functions for clCreateKernel

Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.

Contributes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Skip tests using clCompileProgram in offline mode

Contributes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Using type wrappers when using kernel helper functions

Also includes fix for windows build

Fixes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Remove clReleaseKernel for wrapped kernel

Fixes #31

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2021-01-07 11:34:42 +00:00
Pierre Moreau
c001dc2d9c Only include sys/sysctl.h on for Apple (#916)
glibc deprecated that header in version 2.30, and removed it in 2.32.
2020-08-27 18:31:51 +01:00
Grzegorz Wawiorko
44a240367e Fix code format errors 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
d643dc5399 Add API name to version_expected_info function 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
e9dc1bc5d2 Fix test_printf build errors (#801)
* Fix test_printf build errors

* Return error code in case of function failure
2020-06-10 19:03:09 +01:00
Jeremy Kemp
ce39ffdda7 Printf fixes for reference results #673 #675 (#680)
* Moved float tests that expect limits into their own sub-test.

These are harder to test generically on the CPU so have them be their own test which will retain hard-coded reference results.

* Remove unused variable.

* Switched reference result type from (char**) to (vector::const char*)

* printf: generate reference results where possible #673 #675

The reference results had two issues:
- They did not take into account the rounding mode of the device.
- Scientific notation results did not have trailing zero's, meaning that the exponent could be a single digit, despite the requirement being at least two digits.

This change introduces runtime generated reference results for types with numerical representations (float, int, hex, etc) where a direct mapping to standard C99 (sn)printf is possible to execute on the CPU.

* Trim leading zeroes from the exponent when verifying result #675.

There is no limit on how many leading zeros may be in the exponent, so strip them all.

* Switched to using get_default_rounding_mode.
2020-04-15 14:30:29 +01:00
ellnor01
93e76a8a4a Ensure is_extension_available is used where possible (#722)
(Patch2)
A number of tests have got their own code for checking the presence of
extensions. This change replaces that code with is_extension_available
function.

Contributes to #627

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

Change-Id: I17e007e5ad009e522c5006c42537bf1170550a6f
2020-04-03 10:49:53 +01:00
Jeremy Kemp
9d5dc202cb Updated the test to use get_device_cl_version (instead of check_opencl_version) (#527) (#672)
Also changed the test so that any implementation supporting < 1.2 can skip the test.

Uses format that @gwawiork has recently used to verify device version.
2020-03-11 10:09:35 +00:00
Kévin Petit
b2eba77d42 Get rid of test_finish macro and related ATF cruft (#633)
Closes #431

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-03-02 15:06:44 +00:00
James Price
b95ef1ad04 Use format string for sprintf (#634)
Fixes KhronosGroup/OpenCL-CTS#492
2020-02-28 12:20:50 +00:00
Radek Szymanski
80c3a27a6a Remove unused parameter (#630)
The imageSupportRequired param is not needed in runTestHarnessWithCheck,
so just remove it.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-02-27 15:36:28 +00: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
Bhargav Das
b2cb18073c Improved PrintArch functions (#595) (#601)
Moved all duplicate 'PrintArch' functions to testHarness.c
Replaced sysctl system call used in 'PrintArch' function with uname
system call

Signed-off-by: bhargavdas <bhargav_das@mentor.com>

Update testHarness.c
2020-02-21 16:47:54 +00:00
Grzegorz Wawiorko
45cfe12450 Use stdlib implementation. Do not redefine (#543) 2020-01-10 15:15:55 +00:00
Kévin Petit
937a2cb67d Use clCreateCommandQueue when possible (in a few tests) (#474)
In all these cases, the new entrypoint is not necessary. These
changes enable the tests to work or are a necessary step to get
the tests to work on an OpenCL 1.2 implementation.

While this may not be the final approach we want to solve this
specific compatibility issue, it also has the nice property of
reducing the diff with cl12_trunk until we merge.

Signed-off-by: Kévin Petit <kpet@free.fr>
2019-11-11 17:16:22 +00:00
Mats Petersson
83f2a64d8a Add support for arm printf extension. (#434)
The cl_arm_printf extension uses a call-back to tell the user-code
that some printf output has appeared from the execution of the CL
kernel.

The extsiting Printf tests assume output to stdout.

This change adds code to detect the cl_arm_printf extension, and an
implementation of the callback code to write to stdout.

Also fix a couple of formatting errors and don't "poll" when waiting
for events.

Signed-off-by: Mats Petersson <mats.petersson@arm.com>
2019-08-15 16:38:53 +01:00
Kévin Petit
fa4b278432 Build the harness as a static library (#430)
This reduces by a factor of roughly two the number of files to build.

Fixes #193.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 17:18:10 +01:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Wenju He
2eea74bc95 Use unique tmp file to allow parallel printf tests (#215)
Parallel printf tests fail because they use the same file /tmp/tmpfile
to capture OpenCL kernel outputs. This patch solves this problem by
using a unique file for each process.
2019-04-25 18:10:46 +01:00
Wenju He
2c9ba4b352 Remove redundant releaseOutputStream call in printf (#218) 2019-04-22 12:07:26 +01:00
Grzegorz Wawiorko
6c999818ee cl22: Improved CRC calculation (#133)
* Improved CRC calculation

* Improved CRC calculation - review fix

* Improved CRC calculation - build brake fix

* Improved CRC calculation - remove external initializaiton
2019-04-18 15:00:45 +01:00
Radek Szymanski
c9c10138c6 cl22: Reuse test harness code in printf
Some of the setup functionality is already there in the test harness, so
use that and remove the duplicated code from within the suite.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-12 12:36:54 +01:00
Kevin Petit
63b726feed Fix memory leaks in printf
Signed-off-by: Mats Petersson <mats.petersson@arm.com>
2019-04-11 13:03:46 +01:00
Radek Szymanski
07196c351a cl22: Use single array for function list (#148)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:30:38 +01:00
Radek Szymanski
dd036cd02e cl22: Convert printf to testHarness (#92)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-02 15:34:32 +01:00
Wenju He
f10ee34dd8 Fix verifyOutputBuffer return value in printf (#102)
Function verifyOutputBuffer returns non-zero value in case of mismatch.
Return value 'false' means some mismatches are treated as matches. This
commit fix this problem.
2019-03-19 09:33:07 +00:00
Kevin Petit
b6446a2f1d Remove build systems other than CMake
Make it clear that CMake is the only supported build system.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-03-15 09:47:56 +00:00
Kevin Petit
45bb1a5672 Fix build of printf test
Also build as C++11 (required for unique_ptr)

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-03-05 16:24:50 +00:00
Kevin Petit
95b040bec2 Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github.

This commit contains all the changes that have been done in
Gitlab since the first public release of the conformance tests.

Signed-off-by: Kevin Petit kevin.petit@arm.com
2019-03-05 16:24:50 +00:00