Commit Graph

122 Commits

Author SHA1 Message Date
Romaric Jodin
11db332281 fix error message in work_item_functions_out_of_range (#2303)
The value printed in the error message is not the correct one (used in
the comparison statement)
2025-03-07 23:43:00 +00:00
zzk0
bdd0eb0b7e bugfix nan test for basic fpmath (#2268)
This PR fixes the validation logic for cases where the data type is not
half. Because the variable nan_test is always false, types like float
never trigger a validation failure.
2025-02-18 20:51:19 -08:00
Sven van Haastregt
ea934a7648 basic: fix size_t Wformat warnings (#2264)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-18 09:11:32 -08:00
Sven van Haastregt
9f63decb9c basic: add missing newline at end of error messages (#2275)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-13 07:24:51 -08:00
Antonios Christidis
2031e21a58 Fix Build Warnings for AArch64 (#2242)
This commit links to issue (#2234).

When cross-compiling for AArch64, using gcc 13.3, you encounter three
warnings types that turn into errors:

- maybe-uninitialized
- stringop-truncation
- strict-aliasing

This commit fixes all the warnings found, in regards to the first two
rules. To resolve the warnigns due to strict-aliasing, I am editing the
CMake build system.

Signed-off-by: Antonios Christidis <a-christidis@ti.com>
2025-02-05 13:58:17 +01:00
Marcin Hajder
98c3fe4f16 Added test for work-item functions with out-of-range arguments (#2099)
Fixes #2005 according to task description.
2025-01-21 08:39:28 -08:00
Sven van Haastregt
2ea4d165d5 cmake: remove global -Wno-format (#2195)
Move the global `-Wno-format` compiler option to the individual tests
that still trigger Wformat warnings. The majority of the tests now
compile cleanly with `-Wformat` enabled.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-12-24 14:49:31 +01:00
Michael Rizkalla
e61da21cd6 Fix using incorrect free function in arrayimagecopy and imagearraycopy basic tests' unique_ptr (#2177)
This change addresses a free function mis-match issue where `delete` is
used to free memory allocated via `malloc` within `create_random_data`
and in the test function.

The change involves the following tests:
1. arrayimagecopy
2. arrayimagecopy3d
3. imagearraycopy
4. imagearraycopy3d

This should address #2173

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2024-12-17 09:30:48 +01:00
Michael Rizkalla
918d561c6c Refactor test copy from and to image to buffer (#2138)
This change refactors the following files:
1. test_imagearraycopy.cpp
2. test_arrayimagecopy.cpp

The purpose of refactoring is to allow passing different buffer and
image flags to the test function as well as passing customisable test
functions.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2024-11-19 10:11:58 -08:00
ellnor01
617e7cb233 Re-enabling narrowing errors (#1144)
Fixes narrowing conversion build errors in test_common

Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to specific test_conformance suite's 
CMakeLists.txt where there are many more build errors revealed
from this fix. 

Fixes a few simple issues under test_conformance in the process.

Contributes #787

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

---------

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2024-10-08 09:54:32 -07:00
John Kesapides
cd74e02643 Use CTS type wrappers for test_global_linear_id. (#1545)
Signed-off-by: John Kesapides <john.kesapides@arm.com>

---------

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-09-24 18:02:32 +01:00
joshqti
b8981f5fb8 [basic] Enable image format aware scanline comparison. (#2042)
Use format aware memory comparison instead of memcmp.
2024-08-13 09:54:09 -07:00
Ahmed
b4c3bf2af2 Fixes for basic explicit_s2v and commonfns degrees for cl_half (#2024)
Basic explicit_s2v:

The verification step was always using round to even when converting a
float to half even for round to zero cores.

Commonfns degrees:

The verification step was only taking into account infinities and not
values that over/underflow. This resulted in an incorrect error
calculation. E.g:

double cpu_result = 175668.85998711039;
cl_half gpu_result = 31743; // this is 65504 when converting to float,
we overflowed.
float error = (cpu_result - gpu_result) * some_factor;

The fix adds the check if( (cl_half) reference == test ) before
calculating the error.
2024-08-13 09:52:07 -07:00
John Kesapides
dd029cab8f Deduplicate test_imagedim (#1546)
Signed-off-by: John Kesapides <john.kesapides@arm.com>

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-07-09 09:56:42 -07:00
John Kesapides
cabdf6a5fc Use CTS type wrappers for test_basic test_if. (#1540)
Signed-off-by: John Kesapides
[john.kesapides@arm.com](mailto:john.kesapides@arm.com)
2024-07-09 09:55:57 -07:00
John Kesapides
cb9b8db894 Deduplicate test_basic image_array_copy (#1538)
Merge image_array_copy, image_array_copy3d
as they share a lot of common code.

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

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-07-09 09:55:16 -07:00
Sreelakshmi Haridas Maruthur
5ce18c3f5a basic: workaround MSVC compiler bug with post-increment operator (#1939)
Prevent the compiler from optimizing away initialization loops
2024-05-21 08:47:47 -07:00
BZZiv
90cefbb38e Bug fix in test_async_copy_fence - wrong events usage (#1736) 2024-03-12 09:25:22 -07:00
Harald van Dijk
6a60db558b Fix uninitialised memory use. (#1909)
CL_DEVICE_MAX_WORK_GROUP_SIZE is specified to fill in a size_t. By
asking it to fill in an uninitialised cl_long, on platforms where size_t
is smaller than cl_long, the high bits of the cl_long remain
uninitialised.
2024-03-08 08:07:09 -08:00
Haonan Yang
a73f2b38fb Fix windows stack overflow. (#1839) 2023-12-12 09:33:09 -08:00
John Kesapides
7e4b59dfaa Delete unused file test_float2int.cpp (#1831)
Remove left over file from (#1537)

https://github.com/KhronosGroup/OpenCL-CTS/pull/1537#issuecomment-1642088122

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-10-30 13:01:34 +00:00
Karol Herbst
c6dd6f2aa3 make atomic tests in prog var testing optional (#1799)
This is helpful for testing progvars on implementations not implementing
all the optional atomic features.
2023-10-17 09:40:44 -07:00
Marcin Hajder
72bb711646 Added cl_khr_fp16 extension support for test_explicit_s2v from basic (#1713)
* Added cl_khr_fp16 support for test_explicit_s2v from basic (issue #142, basic)

* Cosmetic corrections

* cosmetic fix

* Added correction to distinguish signed and unsigned char types for ARM architecture tests

* Added missing pieces of convertion procedure to support half

* Corrected condition to verify if additional pragma is necessary (issue #142, basic)

* Add NaN check for half to float conversion

* check-format fixes

* Add NaN check for all float types

Use std::isnan for float/double types.

Change-Id: I005bddccaa3f8490ac59b2aa431ed315733ad143

* Fix Ubuntu build error with isnan macro definition

Change-Id: I671ed826a9631fbbc66d0aa9b674ab00124c7967

* Check format fixes

* NAN define not needed anymore

---------

Co-authored-by: Vasu Penugonda <vpenugon@qti.qualcomm.com>
Co-authored-by: Sreelakshmi Haridas <sharidas@quicinc.com>
2023-10-17 09:38:36 -07:00
Sreelakshmi Haridas Maruthur
7759c2669a basic: fix more unused-but-set variables (#1811) 2023-09-21 08:30:32 -07:00
Sven van Haastregt
aa953aaa51 [NFC] cmake: do not suppress -Wsign-compare globally (#1810)
Only disable `-Wsign-compare` for tests that do not compile cleanly
with this warning enabled.  Re-enable the warning for the other tests,
so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-20 15:48:25 +01:00
Sven van Haastregt
d7f24a7986 Fix more -Wsign-compare warnings (#1779)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-14 11:00:30 +01:00
John Kesapides
a01349c44e Use CTS type wrappers for test_basic test_loop (#1541)
* Use CTS type wrappers for test_basic test_loop
* Move variable declaration to first use in verify_loop

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-27 14:00:03 +01:00
Sven van Haastregt
0460756f6e basic/int2fp: fix missing include (#1789)
With GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-23 09:36:23 +01:00
John Kesapides
25ce398037 Use CTS type wrappers for test_constant. (#1543)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-20 16:13:42 +01:00
John Kesapides
339c932c57 Use the CTS typewrappers in image_r8 (#1539)
Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-19 14:18:49 +01:00
John Kesapides
cd5c165946 Deduplicate test_barrier (#1542)
Merge test_barrier and test_wg_barrier.

Reformat using clang-format kernel source code.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-07-19 13:51:30 +01:00
Marcin Hajder
3a1388a2b4 Added cl_khr_fp16 extension support for test_vloadstore from basic (#1734)
* Added cl_khr_fp16 support for test_vloadstore from basic (issue #142, basic)

* Moved string helper procedures due to request from test_commonfns PR #1695

* restored original test sizes

* Corrected invalid initialization of reference buffer
2023-07-11 08:51:05 -07:00
Sven van Haastregt
9e8430a6a6 [NFC] clang-format basic/test_enqueue_map.cpp (#1777)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-07-03 10:07:32 +01:00
Marcin Hajder
df3ec8deec Added cl_khr_fp16 extension support for test_int2fp from basic (#1742)
* Added cl_khr_fp16 and cl_khr_fp64 support for float2int and int2float tests from basic

* removed debug output

* Replaced procedure to generate random half values in specific range (issue #142, basic)

* Added cosmetic fixes due to code review comments

* Moved string helper procedures due to request for test_commonfns PR #1695
2023-06-20 08:44:45 -07:00
Marcin Hajder
0e229b8f01 Added cl_khr_fp16 extension support for test_fpmath from basic (#1718)
* Added half and double support for fpmath test from basic (issue #142, basic)

* Cosmetic corrections due to code review

* Removed unnecessary casting

* Added corrections due to code review

* Tuning range of input generation to avoid hitting infinity

* Moved string helpers procedures due to request from test_commonfns PR #1695
2023-06-20 08:42:57 -07:00
Sven van Haastregt
44b2578ac7 basic: fix unused-but-set variables (#1764)
Remove the unused `numItems` variable.

As this fixes all occurrences of this warning in test_basic, remove
the suppression flag.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-16 10:53:08 +01:00
Marcin Hajder
16a75dc0af Added cl_khr_fp16 extension support for test_vector_creation from basic (#1728)
* Added cl_khr_fp16 extension support for vector_creation test from basic

* Added corrections related to vendor's review

* Added protection to avoid similar creation cases

* Added comment for recent correction

* cosmetics

* Corrected factor array to restore lost capacity of original test..

leaving only 16-sizes vector tests limited.
2023-06-13 08:41:39 -07:00
Marcin Hajder
095091bc57 Added cl_khr_fp16 extension support for test_vec_type_hint from basic (#1724)
* Added cl_khr_fp16 extension support for test_vec_type_hint from basic (issue #142, basic)

* Added correction to fix casting problem
2023-06-12 23:39:22 -07:00
Romaric Jodin
1011f8ea81 fix async strided test outputing error during verify (#1754)
This bug was introduced by
https://github.com/KhronosGroup/OpenCL-CTS/pull/1711

Ref google/clspv#1127
2023-06-07 15:53:12 +01:00
Marcin Hajder
c467391680 Added support for cl_khr_fp16 extension in test_async_copy from basic (issue #142, basic) (#1707) 2023-06-06 08:46:56 -07:00
Chris Gearing
19f4fc3f3d Make extended_async_copy tests type agnostic (#1619)
The latest version of the cl_khr_extended_async_copies extension uses
element size rather the element type as its base. The means it can be
called with arbitrary and in particular non power of 2 sizes, such as 3
or 13.

Update the test_async_copy2D and test_async_copy3D tests to make them
element size based rather than type based.

As well as this run all tests that can fit into the memory of the
target rather than presumed large elements cannot fit.

Make some addtional good practice changes in terms of const usage,
declaring variables where they are use, and usage of iterators.

The test coverage increases from 1224 cases to 1332 cases for the
test_async_copy2D and test_async_copy3D cases.

Ticket: #1579

Signed-off-by: Chris Gearing <chris.gearing@mobileye.com>
Co-authored-by: Chris Gearing <chris.gearing@mobileye.com>
2023-05-30 09:05:18 -07:00
Marcin Hajder
b3c1401d48 Added cl_khr_fp16 extension support for test_async_strided_copy from basic (issue #142, basic) (#1711) 2023-05-30 08:52:27 -07:00
Marcin Hajder
c58ead9aea Added cl_khr_fp16 extension support for test_astype from basic (#1706)
* Added support for cl_khr_fp16 extenstion in test_astype from basic (issue #142, basic)

* Added correction to iterate over vector of types

* Fixed case with both fp16 and fp64 supported

* Cosmetic corrections due to code review

* Cosmetic corrections due to code review
2023-05-30 08:52:06 -07:00
Marcin Hajder
4cb39b8c14 Added cl_khr_fp16 extension support for test_hiloeo from basic (#1721)
* Added cl_khr_fp16 support for hiloeo test from basic (issue #142, basic)

* Added correction due to compiler warrning

* Cosmetic correction
2023-05-30 08:48:09 -07:00
Marcin Hajder
4dece20f7d Added cl_khr_fp16 extension support for test_vector_swizzle from basic (#1729)
* Added cl_khr_fp16 extension support for vector_swizzle from basic (issue #142, basic)

* Added code review related fix
2023-05-29 14:04:04 +01:00
John Kesapides
3e8898ffeb Deduplicate test_basic int2float/float2int (#1537)
Merge int2float,float2int.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2023-05-24 16:55:25 +01:00
Sven van Haastregt
8f3027387a Fix some Wformat size_t warnings (#1726)
Printing a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-05-18 09:29:27 +01:00
Tuomas Lauttia
85c95297ac Removed hardcoded -cl-std=CL2.0 build option from progvar tests (#1710)
* Removed hardcoded -cl-std=CL2.0 build option from progvar tests

Fixes issue #1380
https://github.com/KhronosGroup/OpenCL-CTS/issues/1380

These changes will query the device for the latest supported CL C
version instead of using a hardcoded value. The create_single_kernel_helper
function queries for the latest CL C version internally, so calls to
create_single_kernel_helper_with_build_options were replaced with calls
to create_single_kernel_helper instead.

* Fixed formatting
2023-05-16 08:46:28 -07:00
Sven van Haastregt
1884042f5d [NFC] cmake: do not suppress -Wunused-but-set-variable globally (#1723)
Only disable `-Wunused-but-set-variable` for tests that do not compile
cleanly with this warning enabled.  This re-enables the warning for
most other tests, so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-05-16 09:58:04 +01:00
Sven van Haastregt
a70fa56003 Fix some Wunused-but-set warnings (#1666)
To the best of my understanding, these occurrences of the
`-Wunused-but-set` warnings do not reveal any underlying issues, so we
can safely remove these variables.  There are more occurrences of this
warning in other places (not touched by this commit) that require
further analysis.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-03-30 09:34:00 +01:00