Commit Graph

18 Commits

Author SHA1 Message Date
Kévin Petit
9755c7ac58 [NFC] Only assign gIsEmbedded in the test harness (#1672)
Signed-off-by: Kévin Petit <kpet@free.fr>
2023-03-16 12:15:51 +00:00
Kévin Petit
1f94b5748b [NFC] Remove duplicate symbol declarations (#1671)
* [NFC] Remove duplicate symbol declarations

Those are provided by testHarness.h.

Signed-off-by: Kévin Petit <kpet@free.fr>

* add missing include

---------

Signed-off-by: Kévin Petit <kpet@free.fr>
2023-03-16 12:15:37 +00:00
Steven Winston
ea49084976 Conversions (#1555)
* grab latest from upstream OpenCL

* Removed events for host to device data transfers

* grab latest from upstream OpenCL

* 1.) revert changes to CMakeLists.txt and run_batch script in hopes this will solve the CI issues for the PR.
2.) resolve the merge conflict in test_conversions.cpp

* 1.) resolve 2 additional merge conflicts

* 1.) resolve 1 additional merge conflicts

* locally this fails clang-format but CI version seems to require it.

* fix the warning.

* Remove now-unused event

Also, cut down a comment that is no longer accurate.

Co-authored-by: Joshua Luceno <joshualuceno@gmail.com>
Co-authored-by: Chip Davis <chip@holochip.com>
Co-authored-by: Chip Davis <cdavis5x@gmail.com>
2023-01-24 08:53:18 -08:00
Sven van Haastregt
3cadff7115 Fix unused-function warnings and enable -Wunused-function (#1576)
Move functions in .h files to .cpp files where appropriate; align
prototypes and definitions; and remove functions that are not used.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-12-13 09:47:48 -08:00
Sven van Haastregt
8bb69ef665 Fix -Wformat-extra-args warnings (#1533)
Fix a few instances where an incorrect number of arguments was
supplied when calling (v)log_error.

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

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-11-01 13:09:48 -07:00
niranjanjoshi121
d285ebe5be Fix memory oob problem in test conversions (#1513)
* Fix memory oob problem in test conversions

Allocate memory for argc arguments
instead of argc - 1.

* Fix formatting issue.
2022-10-11 09:32:47 -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
James Price
c25709f396 Fix stack-use-after-scope crash in conversions (#1358)
The way that program sources were being constructed involved capturing
pointers to strings that were allocated on the stack, and then trying
to use them outside of that scope. This change uses a stringstream
defined in the outer scope to build the program instead.
2021-11-23 19:04:02 +00:00
Ben Ashbaugh
02bf24d2b1 remove min max macros (#1310)
* remove the MIN and MAX macros and use the std versions instead

* fix formatting

* fix Arm build

* remove additional MIN and MAX macros from compat.h
2021-09-13 13:25:32 +01:00
Sreelakshmi Haridas Maruthur
b165de7649 conversions: Use ARM emulation for aarch64 (#967)
The host compiler will not always calculate reference values
the same, depending on optimization level.  It generates
instructions that do not respond to CPU rounding mode in
the same way.  Use QCOM rounding mode emulation to correctly
calculate reference values on aarch64.
2020-10-19 15:08:06 -07: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
Ewan Crawford
5bb4d089dd Specify GCC flag -frounding-math on x86 (#873)
* Specify GCC flag `-frounding-math` on x86

We have been seeing fails in `test_conversions` on x86_64 when converting to the following integer types from `cl_double` with a non-default rounding mode:

```
 char_rtn_double
 char_rtp_double
 int_rtn_double
 int_rtp_double
 long_rtn_double
 long_rtp_double
 long_sat_rtn_double
 long_sat_rtp_double
 short_rtn_double
 short_rtp_double
 uchar_rtp_double
 uint_rtp_double
 ulong_rtp_double
 ushort_rtp_double
```

After investigation it was discovered that `rint()` was incorrectly rounding `cl_double` inputs despite the rounding mode being correctly set using `fesetround()` beforehand. E.g  For 'char_rtn_double' `-3.5` was getting rounding to `-3.0` rather than `-4.0`.

This is a gcc issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92164 when using the builtin `rint()` implementation, rather than `std::rint()`, that only presents itself when compiling a Release build with `-O2` rather than Debug.

Adding the compiler flag `-fno-builtin-rint` to the CMake works around this problem, however based on the discussion in the gcc ticket using `-frounding-math` appears to be a more comprehensive fix. As `-frounding-math` tells gcc that the code will be modifying the rounding mode, removing the assumption that the same rounding mode is in effect everywhere.

* Set FENV_ACCESS ON in rounding_mode.h

Inform compilers which are aware of the `FENV_ACCESS` pragma that TUs
which include `harness/rounding_mode.h` may manipulate the floating
point environment.

* Remove FENV_ACCESS pragma from test_conversions.cpp

This pragma is now set in the included header
`test_common/harness/rounding_mode.h`

Co-authored-by: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
2020-08-18 08:00:14 +01:00
Grzegorz Wawiorko
44a240367e Fix code format errors 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
2a8cecb925 Test bruteforce/conversions - run finish only on existing queue. 2020-07-23 17:21:07 +01:00
Kévin Petit
cba5a191c3 Remove duplicate code setting _cpu_capabilities (#676)
All tests that have this code are using the harness which does
this already.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-03-17 10:21:18 +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