Commit Graph

811 Commits

Author SHA1 Message Date
Marco Antognini
01aa55029d Update warning options (#1252)
Remove workaround for #783, this was fixed by #1237.

Remove workaround for overflow, #699 has been merged.

Disable errors from -Wimplicit-const-int-float-conversion, the issue is
covered by #1250.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-21 10:06:13 +01:00
Pierre Moreau
de49d59c8d Allocations fixes (#1245)
* allocations: Run buffer non-blocking even without images

Testing buffer non-blocking should not be dependent on whether images
are supported by a device or not.

* allocations: Fix typos
2021-05-18 18:12:55 +01:00
Sreelakshmi Haridas Maruthur
6c8045911a gles: Fix compile warnings. (#1070)
* gles: Fix compile warnings.

For 32 and 64-bit Visual Studio and the Android Q NDK.

* Fix formatting violations

Co-authored-by: spauls <spauls@qti.qualcomm.com>
2021-05-18 18:10:24 +01:00
Marco Antognini
17a0d09567 Cleanup usage of static, extern and typedef (#1256)
* Cleanup usage of static, extern and typedef

Remove static on functions defined headers, as it can result in
duplication in binaries.

Remove unnecessary extern keyword on a function declaration, as it is
the default behavior and can be puzzling when reading the code.

Remove the unused declaration of my_ilogb, which is never defined.

Remove unnecessary usage of typedef, as they are only increasing the
cognitive load of the code for no purpose.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Improve usage of inline and static in harness

Functions declared in header as static can trigger unused warnings when
(indirectly) included in translation units that do not use such
functions. Use inline instead, which also avoids duplicating symbols in
binaries.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-18 18:09:46 +01:00
Pierre Moreau
6572837994 buffers: Switch from enqueueing to enqueuing (#1246)
OpenCL-Docs has 45 occurrences of “enqueuing” but a single one of
“enqueueing”.
2021-05-14 09:44:51 +01:00
Kévin Petit
e7c5694cf5 Fix image pixel reference calculation for CL_{INTENSITY,LUMINANCE} formats (#1247)
As per 6.15.15.7, the first three components have to be set to the luminance
value and all components to the intensity value.

Signed-off-by: Kévin Petit <kpet@free.fr>
2021-05-14 09:44:38 +01:00
Marco Antognini
02c2a424f7 Remove unnecessary code from unary_u_*.cpp (#1237)
Only nan() is tested by unary_u_float.cpp and unary_u_double.cpp.
Testing of half_sin, half_tan and half_cos is done in unary_float.cpp
and unary_double.cpp.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-13 09:31:13 +01:00
Grzegorz Wawiorko
db939bbb20 Fix test_buffer - undefined behavior in case of CL_MEM_USE_HOST_PTR (#1210) 2021-05-13 09:22:50 +01:00
Chetan Mistry
71e2681414 Add Test for CL_KERNEL_ATTRIBUTES (#832) (#1055)
* Improve Functionality of Harness

In the harness we previously were able to determine whether or
not a device supports the half or double data types, but doing so
required unintuitive function calls and would need to be repeated
per test.
A new pair of functions have been added which clearly state
what they do, and makes it easier to determine whether or not
a device supports the types.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* Add Test for CL_KERNEL_ATTRIBUTES (#832)

This test generates dummy kernels which have any
permutation combining the following attributes:

    * vec_type_hint
    * work_group_size_hint
    * reqd_work_group_size

It then gets the attributes by using clGetKernelInfo
and validates that the attributes returned are correct.
By matching the attributes which were used to generate
the kernel are present in the returned string from
clGetKernelInfo.
This test has been implemented as part of the
test_conformance/api suite.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Remove Signed Vector Attribute Hints

As per comments, SPIR-V does not distinguish the signedness
of an argument. This change removes the "signed" types
to ensure that the test passes in all scenarios.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Add TODO for Signed Vector Hints

As the current version only tests for unsigned
vector types (uchar/uint/etc), add a TODO in the code
as a reference to future work to introduce signed vector
tests

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2021-05-13 09:20:45 +01:00
Chetan Mistry
a43d96de69 Redesign clGetKernelArgInfo (#522) (#1056)
* Improve Functionality of Harness

In the harness we previously were able to determine whether or
not a device supports the half or double data types, but doing so
required unintuitive function calls and would need to be repeated
per test.
A new pair of functions have been added which clearly state
what they do, and makes it easier to determine whether or not
a device supports the types.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* Remove Old GetKernelArgInfo Tests (#522)

In the API test suite we have 2 versions which test the
clGetKernelArgInfo API. As part of this ticket we are redesigning
the implementation of this test. This change removes all of
the old code and makes it so that the tests simply pass. A later
commit will add the redesigned test

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* Redesign GetKernelArgInfo (#522)

The previous test for this API consisted of 5K+ lines
of code which would define the test kernels and the
expected outputs from this API. This redesign
instead generates the kernels and expected outputs
leading to incresased maintanability and a significantly
reduce line-of-code count.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Address Review Comments

This commit does the following:
    1) Update the Copyright to 2021
    2) Fixes a typo in a comment
    3) Explicitly declares a vector variable
       (previously auto)
    4) Output subtest result after completion rather than
       all of them at the end

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Ensure Kernel Arguments do not exceed CL_DEVICE_MAX_PARAMETER_SIZE

As per upstream comments, this change ensures that the total
size of parameters passed into a kernel does not exceed the
limit specified by CL_DEVICE_MAX_PARAMETER_SIZE for the device
used.
Additionally this change replaces ASSERT_SUCCESS() with test_error()
as per upstream requests.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Address Image and Vector Failures

This change aligns vector 3 types to be sized 4.
Additionally it ensures that image arguments do not
have the address space qualifier specified because
they are by default in the __global space.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Ensure that the size of pipe arguments are correct

As mentioned in PR comments, the test previously assumed that
sizeof(char) == sizeof(pipe char). The Clang implementation
treats a pipe to take the same size as a pointer, which
is now reflected in the code.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Ensure that CL_DEVICE_MAX_PIPE_ARGS is not Exceeded

This commit refactors the code so that Pipes are handled
separately.
Additionally, it removes signed char and char signed as
scalar types to test and removes some redundent code
for modifiying the expected type when processing unsigned
scalar types.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Remove compatibility test from skip-list

There is a list of tests which should be skipped when
using an offline compiler. As get_kernel_arg_compatibility
has been removed, it should also be removed here.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* [SQUASH] Disable Pipe Tests

This change disables the Pipe tests for clGetKernelArgInfo
as pipe metadata is not accurately reported on clang
which leads to the pipe tests failing.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2021-05-13 09:18:12 +01:00
Kévin Petit
ad8ab3fe90 Remove OpenCL C++ tests (#1241)
* Remove OpenCL C++ tests

Agreed in the 2021/05/11 teleconference.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>

* fix CI
2021-05-13 09:13:03 +01:00
Pierre Moreau
d7f87492bd testHarness: Print error string when clFinish fails (#1243) 2021-05-12 11:39:45 +01:00
Pierre Moreau
06f7661fdc basic/async: Check for extension only once per test (#1242)
As the extension is vector size and type independent, we only need to
check for the extension once per test and not for every possible
combination of inputs, thereby drastically reducing the log output of
the test when the extension is not supported.
2021-05-12 11:39:17 +01:00
sravikumar3393
59a12047a8 Fix for test_conversions failure with Clang build on Linux #1057 (#1062)
* Avoid optimization by using volatile qualifier
    * Fix both uint2float and ulong2double
2021-05-11 18:17:48 +01:00
Marco Antognini
3dd6d4137d Avoid manual memory management, fixes #975 (#1240)
Fix heap-buffer-overflow reported by AddressSanitizer: ensure the
appropriate number of elements are allocated for the list of tests.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-11 18:06:16 +01:00
Marco Antognini
3dab3df48d Report inputs for worst errors (#1231)
Builtin functions producing two results can have their worst error, for
each result, on different inputs. Report both inputs.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-07 09:29:28 +01:00
Marco Antognini
5daca107ad Remove dead variables and functions (#1238)
These were identified using Clang's -Wunused warning flag.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-05-07 09:28:38 +01:00
Marco Antognini
01497c402e Reduce scope of variables (#1228)
Make variables local to loops, with appropriate types. These variables
are not read after the loop without being reset first, so this patch
doesn't change behaviour.

These variables should now be used for one purpose only, making it
easier to reason about the code. This will make future refactoring
easier.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-28 09:30:51 +01:00
Marco Antognini
cba7a8a537 Remove dead CMake code (#1230)
Remove CMake statements that have no effect in math_brute_force.

set_source_files_properties without a list of files has no effect.

When MODULE_NAME is FOO,
set_source_files_properties(${MODULE_NAME}_SOURCES ...) sets the
properties of "FOO_SOURCES", not of the files listed in the variable
named FOO_SOURCES.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-28 09:30:25 +01:00
Chetan Mistry
edc36b5d53 Remove NULL Platform Check for Negative clGetPlatformInfo (#1222) (#1229)
Part of the negative CTS test for clGetPlatformInfo
incorrectly tested with a NULL platform. As this is a
special case it meant that the test was not correct.
This change removes the incorrect part of the test so that
it conforms with the OpenCL specification.

Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2021-04-27 15:43:39 +01:00
Marco Antognini
b8d1ea9962 Fold constant global variable (#1217)
gWimpyBufferSize is never modified and is actually not used to modify
the number of tests -- gWimpyReductionFactor is used for that purpose by
some tests, but not all.

This patch removes this unnecessary global variable to simplify the
codebase, and reduce differences between tests.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-21 10:45:34 +01:00
Marco Antognini
7542ae2443 Fold code into loop (#1218)
Use one loop to read buffers from device, with the last read operation
blocking until complete.

This pattern cannot be elegantly refactored just yet, mainly for two
reasons:
 - Some tests use goto statements to clean their resources.
 - Some tests (not modified in this patch) only use blocking read
   operations.

Once code is further unified, this pattern can be refactored into a
helper function.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-20 17:10:29 +01:00
Marco Antognini
6683fa91a9 Use lambda to reduce amount of code (#1219)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-20 17:10:06 +01:00
Marco Antognini
7286e06a94 Make variables and functions local to translation unit (#1216)
* Make variables and functions local to translation unit

Make some global variables local to function, or remove them when
actually dead.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Address comments

Remove unused code.
Reduce scope of gDoubleCapabilities.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-15 18:19:09 +01:00
Marco Antognini
b7e7a3eb65 Remove unsupported code (#1211)
* Remove code for runtime measurement

The GetTime() and associated functions are not fully implemented on
Linux. This functionality is assumed to be untested, or unused at best.

Reduce differences between tests by removing this unnecessary feature.
It can be (re-)implemented later, if desired, once the math_brute_force
component is in better shape.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Coalesce if-statements

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Keep else branch

Address comments.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-13 15:58:44 +01:00
jianguang.li
8e59817ba6 Fix conversion fail when build with -O2 fail (#1193)
* fix conversion fail when compile with gcc -O2

* fix format check error

* fix format check error
2021-04-07 09:19:58 +01:00
Grzegorz Wawiorko
71bef8563e New subgroups - full changes set (#1074)
* Extended subgroups - extended types types

* Extended subgroups - non uniform vote tests

* Extended subgroups - non uniform arithmetic tests

* Extended subgroups - ballot tests

* Extended subgroups - clustered reduce tests

* Extended subgroups - shuffle tests

* Extended subgroups - formating issues

* Extended subgroups - review fixes

* Extended subgroups - review fixes

Fixed: removed additional brakes, kernel_sstr

* Extended subgroups - fix macos build error

* Extended subgroups - review fixes

Fixed: mac os build error

* Extended subgroups - data type verification example

* Extended subgroups - error unification

* Extended subgroups - fix header years

* Extended subgroups - use is_half_nan

* Extended subgroups - compare half as float

* Review fixes mostly for ballot functions.

- Modify kernels for better handling active/inactive workitems
- Modify gen/chk functions for handling non uniform workgroup sizes
- Introduce new variables naming convention
- minor fixes

* Extended subgroups - simplification data generation for ballot lsb/msb functions

* Extended subgroups - minor fixes

* Extended subgroups - move common code to function

* Extended subgroups - formatting errors fix

* Extended subgroups - fix build error

* Extended subgroups - sub_group_elect more sophisticated

Define mask which is 4bytes pattern where bit 1 means work item is active.
If workitem in subgroup matches pattern then run sub_group_elect()

* Extended subgroups - fix Ubuntu build error

* Extended subgroups - voting function review fixes

* adjust all function for using masks
* remove calculate templates
* merge code to one common template
* check results only in active workitems
* normalize values on host side
* minor fixes

* Extended subgroups - fix typos

* Set of fixes and improvements after review

* define WorkGroupParams to stop extended parameters list in function
* better workitems mask handing (WorkGroupParams)
* narrow values of data input generation to avoid overflows (arithmetic func)
* implement work item masks for arithmetic functions
* enable half type testing for reduction/scan/broadcast
* minor fixes

* Extended subgroups - fix Linux issues

* Extended subgroups - fix sub_group_local_id data type

* Extended subgroups - use vector instead of array.

* Extended subgroups - change names to subgroup

* Extended subgroups - uncomment code, fix build

* Extended subgroups - build fix, use cl_half_from_float func

* Extended subgroups - remove is_half_nan

* Extended subgroups - do no use undef min/max

* Extended subgroups - use parenthesis, fix formatting
2021-04-06 17:25:48 +01:00
Marco Antognini
c5e4ca6c91 Remove unnecessary APPLE specific code (#1188)
To reduce differences between tests, remove APPLE specific code from
unary tests as no other test have similar logic.

Ensure gMeasureTimes is consistently initialised regardless of operating
systems to ensure a consistent command line interface.

The remaining APPLE specific pieces of code relate either to include
paths, or to the implementation of PreventSleep(), ResumeSleep() and
GetTime(). Those are not removed in this commit.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-04-06 16:43:55 +01:00
James Price
baa226a779 Remove compiler options that are specific to Apple (#1114)
These are causing test failures for non-Apple implementations of
OpenCL running on macOS.
2021-04-06 16:42:46 +01:00
Marco Antognini
5281b4c916 Improve consistency of clEnqueueWriteBuffer operations (#1195)
Reduce differences between tests by ensuring all these operations are
non-blocking.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
v2021-03-25-00
2021-03-24 16:29:25 +00:00
Marco Antognini
8488d4b2de Use the same kernel name for all tests (#1194)
Make signature of BuildKernel more consistent across tests: now only two
variants exist:

  int BuildKernel(const char *name, int vectorSize, cl_kernel *k,
                  cl_program *p, bool relaxedMode)

or

  int BuildKernel(const char *name/symbol, int vectorSize,
                  cl_uint kernel_count, cl_kernel *k, cl_program *p,
                  bool relaxedMode)

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-24 16:20:05 +00:00
Marco Antognini
ef19796590 Improve log consistency (#1196)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-24 16:19:37 +00:00
Sven van Haastregt
dbd3e787fe Do not dereference null pointer for no matching tests (#1191)
When invoking for example

    test_c11_atomics test-that-does-not-exist

parseAndCallCommandLineTests() would attempt to dereference
`resultTestList` which is still a null pointer.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2021-03-18 21:46:05 +00:00
Zakaria Taha
6b36f645b8 Add tests to proposed new builtin async_copy functions with a bug fix. (#725)
* Add tests to proposed new builtin async_copy functions with a bug fix.

* Revert "Add tests to proposed new builtin async_copy functions with a bug fix."

This reverts commit 7d0f16d014.

* Add tests to proposed new builtin async_copy functions.

* Added is_extension_available to check if an extension is available.

* Added is extension available for test_async_copy_fence.

* fix build issues on windows.

* include algorithms.h for async copy 2D/3D.

* adding algorithms header.

* Fix numLines - 1 in maxTotalPlanesIn/Out.

* fix formatting violations.

* fixed formatting issue.
2021-03-18 14:27:59 +00:00
Marco Antognini
111bb2b185 Fix discrepancy in logging messages (#1189)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-17 09:50:30 +00:00
Marco Antognini
da2a1bd4a5 Remove trivially dead code (#1190)
Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-17 09:50:11 +00:00
Marco Antognini
ee600e89d7 Reduce differences by using common names (#1187)
Improve format.

The binary_operator tests are left untouched by this commit as they
require some non-automatic changes.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-11 09:44:38 +00:00
John Kesapides
68ee30fb4b Fix possible size_t overflow in 32-bit builds. (#1131)
* Fix possible size_t overflow in 32-bit builds.

Use cl_ulong temporary values for row/slice_pitch.

Signed-off-by: John Kesapides <john.kesapides@arm.com>

* Remove redundant casts

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2021-03-09 22:57:49 +00:00
Marco Antognini
a53917a37e Move code around to reduce differences (#1185)
Code is moved to reduce the differences between tests for single- and
double-precision.

Improve consistency in double-literal.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-09 22:55:33 +00:00
Marco Antognini
a483255e50 Fold functions for nextafter (#1176)
* Add assertion to prove isNextafter is true iff the builtin is nextafter()

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Fold functions for nextafter

There is no need to differentiate nextafter() from other binary builtin
functions when creating the vtbl entries.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-09 09:18:40 +00:00
Stuart Brady
6f2cd12a0b Deduplicate logging of pixel differences (#1175)
clCopyImage and clFillImage contain near-duplicate code for logging of
pixel difference errors.  Move this into imageHelpers.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-03-09 09:09:52 +00:00
Marco Antognini
17632c9736 Remove undesired conversions from size_t to int (#1180)
Improve math_brute_force kernels by consistently using size_t to store
the result of get_global_id().

This change was missed in 5d7be40e (Remove undesired conversions from
size_t to int (#1153), 2021-02-11).

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-09 09:09:10 +00:00
Marco Antognini
afe745f47e Fix typo in array size computation (#1178)
Because specialValuesInt2Count < specialValuesIntCount (when correctly
computed), there was no out-of-bound access when running the tests. This
also means additional cases will be covered now that the typo is fixed.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-09 09:08:38 +00:00
jianguang.li
3307ebed9a fix out of boundary when strcpy (#1173)
* fix out of boundary when strcpy, fix #1170

* fix format check failure

* fix format check error
v2021-03-05-00
2021-03-05 14:25:09 +00:00
Marco Antognini
e2fb655e4c Use C++ headers instead of C headers (#1179)
Remove some unnecessary includes.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-05 14:24:03 +00:00
Marco Antognini
9a481c6167 Split math_brute_force files (#1169)
* Split math_brute_force files

Split each file into two: one covering float and the other covering
double. The goal is to make it possible to diff files to identify bugs
more easily, reduce differences between code for float and double, and
ultimately reduce code duplication in all math_brute_force.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Address clang-format issues

In be936303 (Remove dead code in math_brute_force (#1117), 2021-01-20)
the code was reformatted using git-clang-format, which apparently is less
reliable than clang-format itself when changes occur in large files.

With the previous split of large files, git-clang-format complains about
the format of code originating from binary_two_results_i.cpp.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-03-02 15:50:14 +00:00
Kévin Petit
66eb912ad5 ci: move code format check out of the main job/script (#1154)
A bit cleaner than the written-in-a-haste-to-get-ci-going-again current approach.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2021-02-23 14:23:18 +00:00
Marco Antognini
84d70e23c8 Fix incorrect use of kernel parameter (#1168)
This issue was introduced in 8ad1088a (Reduce difference between files
in math_brute_force (#1138), 2021-02-10).

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
2021-02-18 11:11:28 +00:00
Sebastian Łużyński
8b5d3c2055 Fix buffer tests memory leaks (#1165)
* Fix buffer tests memory leaks

This change fixes buffer tests, broken by PR #1082. This pull request is similar to #1160

* Fix formatting
2021-02-18 10:07:10 +00:00
Kévin Petit
fc67d7b28f Move media_sharing tests to test_conformance/extensions/ (#1164)
* Move media_sharing tests to test_conformance/extensions/

And rename to cl_khr_dx9_media_sharing.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>

* format code

* more format changes
2021-02-18 10:06:56 +00:00