Commit Graph

885 Commits

Author SHA1 Message Date
Ben Ashbaugh
2fcdde96d2 refactor work group scan and reduction tests (#1401)
* updated reduce test

* switched all reduce tests to new framework

* switch over scans to new framework

* remove old files

* minor fixes

* add type type name to the kernel name

* fix Windows build and warnings

* address review comments
2022-04-04 13:19:30 -07:00
Stuart Brady
e121b9d1bf Fix sub_group_ballot_find_msb/lsb tests (#1411)
As per the OpenCL Extension Specification § 38.6 Ballots:

   If no bits representing predicate values from all work items in
   the subgroup are set in the bitfield value then the return value
   is undefined.

The case with no bits set is still worth testing, as it does not result
in undefined behavior, but only an undefined return value.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-04-04 09:57:36 -07:00
Jason Tang
93f4f6a548 test_api_min_max.cpp: use size_t for get_global_id() value (#1410)
In some rare cases where get_global_id() is larger than 2G, the 32bit int type would convert the value into a negative integer.
2022-03-29 16:08:08 -07:00
Stuart Brady
c42cf518da Improve cl_khr_subgroup_shuffle* test coverage (#1402)
Test cases where the index/mask/delta is greater than or equal to the
maximum subgroup size.  These are cases that return undefined results
but are not undefined behavior.

The index/mask/delta values now include values less than twice the
subgroup size, and 0xffffffff.

Testing for sub_group_shuffle_xor() already allowed inputs that were
greater or equal to the subgroup size for the last subgroup in a
workgroup, but did not properly account for this in the verification
function, potentially resulting in out of bounds accesses.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-03-29 11:39:06 -07:00
Stuart Brady
f6dbc5b9b5 Add cluster size handling in subgroup test helpers (#1394)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-03-22 09:21:09 -07:00
Sreelakshmi Haridas Maruthur
0f4dc3166c conversions: Use volatile qualifier to prevent optimizations (#1399)
Use volatile to prevent clang optimizations, fix int2float
2022-03-17 13:27:24 -07:00
Ben Ashbaugh
bbc7ccfc58 add a prefix to OpenCL extension names (#1311)
* add a prefix to OpenCL extension names

* fix formatting
2022-03-02 18:34:06 +00:00
Jim Lewis
3c4a1a3ce6 Fix build error for linux with clang-8 (#1304)
-Wabsolute-value warning reported as error (long double truncated to
double)
2022-03-02 18:31:14 +00:00
Jack Frankland
ae217e8bd2 Check for non-uniform work-group support (#1383)
Only run sub-group tests with non-uniform work-groups on OpenCL 3.0 and
later if it is supported by the device.
2022-03-02 18:30:31 +00: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
Alastair Murray
d36196b662 Update format script and drop Travis badge for branch rename (#1393)
`master` is now `main`, so update `check-format.sh` accordingly.

Also completely drop the Travis badge as we now use GitHub actions.  There is
no replacement badge as the current action is pre-submission, not
post-submission.
2022-03-02 18:27:52 +00:00
Stuart Brady
279803abab Refactor kernel execution in subgroup tests (#1391)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-03-02 13:25:53 +00:00
Jim Lewis
2d93b122c3 Sync submission_details with conformance doc v26 (#1389)
Add "Patches" field
v2022-02-22-00
2022-02-22 16:49:35 +00:00
Stuart Brady
6b14d408dc Improve testing of kernel arg info in pipe_info test (#1326)
The test now checks that CL_KERNEL_ARG_INFO_NOT_AVAILABLE is returned
when calling clGetKernelArgInfo() with offline compilation modes.

The correct function name is printed if clGetKernelArgInfo() fails
when using online compilation (and not "clSetKernelArgInfo()").

When using online compilation, if the actual arg type is not as
expected, the actual arg type is now logged, and the return value
is now TEST_FAIL (-1) as per other failures (and not 1).

All other test pass/fail values used in the test now use TEST_PASS
and TEST_FAIL instead of 0 and -1 literals.

An unnecessary cast of pipe_kernel_code has been removed.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-02-09 22:24:33 -08:00
Stuart Brady
60471a5208 Improve testing of sub_group_ballot (#1382)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-01-28 09:15:44 +00:00
Stuart Brady
656886030b Refactor divergence mask handling in subgroup tests (#1379)
This changes compilation of subgroup test kernels so that a separate
compilation is no longer performed for each divergence mask value.

The divergence mask is now passed as a kernel argument.

This also fixes all subgroup_functions_non_uniform_arithmetic testing
and the sub_group_elect and sub_group_any/all_equal subtests of the
subgroup_functions_non_uniform_vote test to use the correct order of
vector components for GPUs with a subgroup size greater than 64.

The conversion of divergence mask bitsets to uint4 vectors has been
corrected to match code comments in WorkGroupParams::load_masks()
in test_conformance/subgroups/subhelpers.h.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-01-19 14:17:54 +00:00
Sreelakshmi Haridas Maruthur
06415f8b79 Fix memory leaks (#1378)
* Fix memory leaks

Fixed memory leaks in: buffers, basic, and vectors

* Formatting fixes

Co-authored-by: oramirez <oramirez@qti.qualcomm.com>
2022-01-11 16:52:11 +00:00
Jim Lewis
51c6d97d2f Fix test_api get_command_queue_info (#1324)
* Fix test_api get_command_queue_info

Decouple host and device out-of-order test enabling

* Rename property sets more generically

* Refactor to use std::vector to accumulate test permutations
2022-01-06 10:26:20 +00:00
Jim Lewis
f91daf3d06 Remove invalid negative_get_platform_info testcase (#1374)
* Remove invalid negative_get_platform_info testcase

* Implementations are only required to do null checks
* Fixes #1318

* Fix formatting
2022-01-06 10:23:07 +00:00
Grzegorz Wawiorko
b71c204794 test_subgroups - Set safe input values for half type and mul, add operations (#1346)
* Set safe input values for half type and mul, add operations

* Set safe values for all data types

* Typo fix

* Set constant seed for shuffle

* Change function name to more specific

* set_value takes an integer value, not a bit pattern
2022-01-05 08:08:52 -08:00
Sreelakshmi Haridas Maruthur
c2facedfa0 Remove dead threading code (#1339)
Remove unused code that hasn't been used for the last three years
and isn't included in makefiles.

Co-authored-by: oramirez <oramirez@qti.qualcomm.com>
2022-01-05 07:43:50 -08:00
Stuart Brady
1161d788dd Refactor logging of subgroup test start/pass messages (#1361)
Note that this also corrects the start messages logged for the
sub_group_ballot_bit_count/find_msb/find_lsb tests.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-12-14 17:52:44 +00:00
Ewan Crawford
73d71b6a76 Add cl_khr_command_buffer to list of extensions (#1365)
cl_khr_command_buffer is now public as a provisional khr extension
which implementations may report.
2021-12-08 16:08:15 +00:00
Grzegorz Wawiorko
8ffecf27c2 Fix build, glext should not be used with GLEW (#1337)
* Fix build, glext should not be used with GLEW

* Remove additional define GL_GLEXT_PROTOTYPES

* Remove includes which already defined in setup.h
2021-12-08 16:07:42 +00:00
Grzegorz Wawiorko
e106be14f9 Test api min max - fix printing cl_ulong data type (#1212)
* test api - fix code formatting only

* Fix printing cl_ulong type to avoid overloading.

* Fix printing size_t data type

* Fix printing size_t data type - set unsinged

* Fix formatting for maxArgs (uint) and numberOfInts (size_t)
2021-12-04 09:55:17 -08:00
Stuart Brady
f8ec235d3c Tidy up code to determine bit mask for ballot scans (#1363)
It seems more intuitive to set only the bits that are required, rather
than to set one more bit than is required, only to clear it again.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-12-02 15:27:30 +00:00
Stuart Brady
7625011b66 Remove unused inclusion of <cstdio> (#1362)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-11-26 15:30:23 +00:00
Grzegorz Wawiorko
6f50623ba8 Subgroups tests - sub_group_non_uniform_scan_exclusive function fixes (#1350)
* Fix - comparing results will never happen.

* No special action needed for one work item in the subgroup
2021-11-25 13:41:06 +00:00
BKoscielak
6dff4fdffa Fix conversion data loss in test_api min_max_constant_args (#1355) 2021-11-25 13:40:19 +00:00
Stuart Brady
3eb0f50d85 Use maximum subgroup size in sub_group_ballot tests (#1344)
sub_group_ballot_bit_count() and sub_group_ballot_find_msb() mask
their input according to a subgroup size, which is assumed to be the
maximum subgroup size, and not the actual subgroup size excluding
non-existent work-items in the "remainder" subgroup.

Fix this as per the the clarification made to the OpenCL C specification
in revision 3.0.9 for issue KhronosGroup/OpenCL-Docs#626 by pull request
KhronosGroup/OpenCL-Docs#689.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-11-25 13:36:20 +00: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
marcat03
3cd906aa9b Fix missing cl_khr_semaphore extensions in compiler tests (#1357)
* Added missing extensions related to cl_khr_semaphore

Signed-off-by: Marco Cattani <marco.cattani@arm.com>
2021-11-16 16:07:43 +00:00
Stuart Brady
1c6dbc23e7 Clean up logging in cl_khr_subgroup_ballot tests (#1351)
The tests were logging scalar results as vectors padded with zeroes for
no apparent benefit.  Fix this.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-11-16 14:03:06 +00:00
Stuart Brady
1116a71ba2 Improve error handling in subgroup tests (#1352)
* MPGCOMP-14761 Improve error handling in subgroup tests

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

* Add missing newline
2021-11-16 11:27:04 +00:00
Stuart Brady
e9cd9a446e Remove excessive logging in subgroup tests (#1343)
This also adds some missing data type logging to the
subgroup_functions_non_uniform_vote tests.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-11-08 11:00:50 +00:00
Stuart Brady
410f46f49f Add testing of sub_group_broadcast for (u)char and (u)short types (#1347)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2021-11-03 16:36:36 +00:00
Grzegorz Wawiorko
7147d072c7 Remove space character from extension name (#1336) v2021-10-04-00 2021-10-04 14:42:44 +01:00
Grzegorz Wawiorko
92844bead1 Extended subgroups - use 128bit masks (#1215)
* Extended subgroups - use 128bit masks

* Refactoring to avoid kernels code duplication

* unification kernel names as test_ prefix +subgroups function name
* use string literals that improve readability
* use kernel templates that limit code duplication
* WorkGroupParams allows define default kernel - kernel template for multiple functions
* WorkGroupParams allows define  kernel for specific one subgroup function

Co-authored-by: Stuart Brady <stuart.brady@arm.com>
2021-10-01 11:28:37 +01:00
Kévin Petit
903f1bf65d Report unsupported extended subgroup tests as skipped rather than passed (#1301)
* Report unsupported extended subgroup tests as skipped rather than passed

Also don't check the presence of extensions for each sub-test.

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

* address review comments
2021-09-30 13:33:18 +01:00
Kévin Petit
2b770c4f34 Update cl_khr_integer_dot_product tests for v2 (#1317)
* Update cl_khr_integer_dot_product tests for v2

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Signed-off-by: Marco Cattani <marco.cattani@arm.com>
Change-Id: I97dbd820f1f32f6b377e47d0bf638f36bb91930a

* only query acceleration properties with v2+

Change-Id: I3f13a0cba7f1f686365b10adf81690e089cd3d74
2021-09-29 12:38:42 +01:00
Sreelakshmi Haridas Maruthur
4fb5deeec1 api: Enable cl_khr_fp16 when using half types in kernel (#1327) 2021-09-28 10:19:40 -07:00
Sreelakshmi Haridas Maruthur
ddca0f802b gles: Fix double frees. (#1323)
* gles: Fix double frees.

Remove a few explicit frees in the redirect_buffers test which are
already handled by a wrapper.

* gles: Fix double frees

A recent update to the object wrapper classes (#1268) changed the
behavior of assigning to a wrapper, whereby the wrapped object is now
released upon assignment. A couple of tests were manually calling
clReleaseMemObject and then assigning `nullptr` to the wrapper,
resulting in the wrapper calling clReleaseMemObject on an object that
had already been destroyed.

Co-authored-by: spauls <spauls@qti.qualcomm.com>
2021-09-28 10:19:17 -07: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
Jeremy Kemp
1f26e1d8ba Fix memory model issue in atomic_flag. (#1283)
* Fix memory model issue in atomic_flag.

In atomic_flag sub-tests that modify local memory, compilers may re-order memory accesses between the local and global address spaces which can lead to incorrect test failures.

This commit ensures that both local and global memory operations are fenced to prevent this re-ordering from occurring.

Fixes #134.

* Clang format changes.

* Added missing global acquire which is necessary for the corresponding global release.

Thanks to @jlewis-austin for spotting.

* Clang format changes.

* Match the condition for applying acquire/release fences.
2021-09-07 12:47:44 +01:00
Senran (Stephen) Zhang
34e47322db Limit workgroup size for atomics tests (#1197)
* Limit workgroup size for atomics tests

This avoids extremely large local buffer size and slow run

* Always limit workgroup size
2021-09-06 17:14:36 +01:00
James Price
0601c6f765 Add missing include for gRandomSeed (#1307) 2021-08-31 11:45:24 -07:00
Ben Ashbaugh
995c7dbfbb suppress MSVC strdup warning (#1314) 2021-08-31 11:44:17 -07:00
Grzegorz Wawiorko
e27a97fbd8 Add cl_khr_integer_dot_product to known extensions in test compiler. (#1316) 2021-08-31 15:53:55 +01:00
Kévin Petit
7cfd3a6033 Report failures in simple_{read,write}_image_pitch tests (#1309) 2021-08-29 15:12:52 -07:00
Ben Ashbaugh
39fdb462be define NOMINMAX in the CMakefile to fix std::min and std::max on MSVC (#1308) 2021-08-28 10:21:34 +01:00