Commit Graph

526 Commits

Author SHA1 Message Date
Kévin Petit
d59808ceda clang-format: indent continued lines (#739)
This addresses comments from recent PR reviews.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-04-17 10:54:58 +01:00
James Price
2ac3c2c1ef Use std::string for get_device_*_string helpers (#737)
* Use std::string for get_device_*_string helpers

Removes need to use BufferOwningPtr to avoid memory leaks.

* Rename get_device_info to get_device_info_string

Makes it more obvious that it should only be called for device queries
that return strings.

* Tokenize extensions in is_extension_available

Avoids the potential issue where one extension name is a prefix of
another.

* Throw exception when device info size is 0
2020-04-16 14:27:40 -04:00
John Kesapides
c911046f5b Fix minor resource leaks in test_api. (#735)
Added some missing clProgramWrapper/clkernelWrapper, to avoid
resource leaks.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-04-16 13:35:29 +01:00
Jim Lewis
f3a3ec2b47 Allow CL_HALF_FLOAT denorm flushing for write tests (#452) (#453)
* Allow CL_HALF_FLOAT denorm flushing for write tests (#452)

* On mismatch, add relaxation when denormal half result is expected
* Refactor to use common validation function
* Clean up some diagnostics

* Fix review comments

- use cl_half
- remove extraneous casts
- replace literals with sizeof()

* Document rollover trick for IsHalfSubnormal
2020-04-16 10:23:44 +01:00
Kévin Petit
2fa8611862 Make it possible for enqueue_map tests to catch more USE_HOST_PTR issues (#730)
* Make it possible for enqueue_map tests to catch more USE_HOST_PTR issues

Don't update the memory passed as host_ptr with the correct result
and compute the reference result using a separate allocation so that
implementations that use copies to manage the host_ptr and never update
as part of map/unmap commands the memory pointed to by host_ptr fail
the test.

Rename initialData to hostPtrData for clarity.

Fixes #700

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

* format fixes

* more format fixes?
2020-04-16 10:23:03 +01:00
James Price
da7c1b3498 Use clang-format-9 for Travis CI formatting checks (#736) 2020-04-15 22:05:00 +01:00
ellnor01
c19897ff0f Remove check_opencl_version function (#734)
Removing all references to check_opencl_version as similar
get_device_cl_version() can be used instead.

Fixes #527

Change-Id: I474b6f536033707e1beb9b5b39410de24672c040
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 16:03:19 +01:00
James Price
f413103970 Add clang-format config and check-format.sh script (#724)
* Add clang-format config and check-format.sh script

Travis CI is now configured to run check-format.sh and the job will
fail if any format violations are detected. This will only check the
format of new/modified code; existing code that violates the format
will not cause a CI failure.

* Make format checking the first Travis CI job

* Tweak format based on Jeremy's preferences

* Tweak format based on Kevin's preferences
2020-04-15 15:46:39 +01:00
ellnor01
3b79ecdb87 Replace get_device_version with get_cl_device_version (#733)
They are duplicate functions

Fixes #709

Change-Id: I8f7d6b8254047adb9e09ede4951dedc3ec5c1099
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 14:31:22 +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
Grzegorz Wawiorko
349da6e6fb Fix typo device -> devices (#728) 2020-04-15 11:05:59 +01:00
ellnor01
fea3e54e5a Add exceptions as errors in is_extension_available (#732)
is_extension_available is modified to handle errors by throwing
exceptions.

Contributes to #627

Change-Id: Ie9423df588892a0f8effa03d1cb48bf12400b983
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 11:05:46 +01:00
Jeremy Kemp
f4a4b5428e API: Fixed condition based on is_extension_available. (#726)
enqueue_kernel was being run when the cl_khr_create_command_queue was *not* present. The test should only be run when the extension *is* present.

Regressed in 93e76a8a4a.
2020-04-09 09:57:56 +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
Kévin Petit
cd3b552094 Clean up enqueue_map_{buffer,image} tests a bit (#701)
- Introduce MTdataHolder
- Use BufferOwningPtr to manage allocations (fixes a few leaks in error cases)
- Introduce variable for common expressions
- Remove image format support check as the format is required by OpenCL 1.0

Contributes to #700

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-04-02 21:46:41 +01:00
ellnor01
33e70615bd Ensure is_extension_available is used where possible (#721)
(Patch1)
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

Change-Id: I8dd2233719aa8c84841ac61776437d7f6e3fafe6
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-02 21:45:28 +01:00
ellnor01
ef3528e78a Ensure is_extension_available is used where possible (#721)
(Patch1)
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

Change-Id: I8dd2233719aa8c84841ac61776437d7f6e3fafe6
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-02 21:22:02 +01:00
Ewan Crawford
aee0a22ad2 Preserve existing release flags in MSVC (#704)
* Preserve existing release flags in MSVC

Without this the `/MD` flag is lost on Release builds,
resulting in the below error when using a Ninja CMake generator with
VS2019 compiler. Before replacement `/MD /O2 /Ob2 /DNDEBUG`, after replace
`/MD /Od /Ob0 /DNDEBUG`

```
harness.lib(testHarness.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in test_conversions.cpp.obj
```

* Remove Visual Studio 2005 release flag workarounds
2020-03-30 16:44:54 +01:00
Jeremy Kemp
5e84ad0c19 Generic Address Space: Skip tests utlilising SVM on devices that do n… (#712)
* Harness: Added an option for a test to skip itself.

New condtion in callSingleTestFunction. This allows a test to return TEST_SKIP if the device does not support the requested test.

* Split generic_ptr_to_host_mem into two tests.

The old generic_ptr_to_host_mem test tests two different device capabilities (SVM and not SVM). This is a prerequisite for the following commit.

* Generic Address Space: Skip tests utlilising SVM on devices that do not support SVM.

Where a device does not support SVM, do not run the generic address space test(s) that rely on SVM.
2020-03-27 12:38:30 +00:00
Jeremy Kemp
540d1175c7 Generic Address Space: Skip test on unsupported devices. (#708)
* Generic Address Space: Skip test on unsupported devices.

Where a device does not have to support this test, skip it.

* CI: Added USE_CL_EXPERIMENTAL to the CI build(s).
2020-03-27 12:16:17 +00:00
John Kesapides
d128fea964 Global variable gDeviceType correctly set (#611)
Add gDeviceType set on kernel_read_write tests(image_streams)
as the device type affects the way validation is performed in the test.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-03-26 22:14:46 +00:00
John Kesapides
687dc06254 Failure in copy_images max_images (#612)
An existing workaround on the max_image size calulcation that disallows
the width of an image to be less than 16 can stress the calculcation of
the remainder dimension to be less than 1.0 in size. In three dimentional
objects (3d,2d array) where one dimention is set to max and the other is
set to 16 there might not be enough space left for the 3rd one.
This workaround clamps the third dimension to a minimum of 1.0

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2020-03-26 18:41:32 +00:00
Jeremy Kemp
a83f7c3ed8 c11_atomics: do not overallocate local memory for embedded devices #690. (#691)
The spec states that the minimum amount of local memory for embedded devices is 1KB. This change clamps work group sizes to 1024 for embedded devices, and sets the number of local variables per thread to 1.

Fixes #690.
2020-03-26 17:56:26 +00:00
Kenneth Benzie
f38ed4c0b3 Skip, don't fail, image tests on no image support (#706)
Fixes #693 by returning `TEST_SKIP` instead of `TEST_FAIL` from the
`verifyImageSupport()` kernel helper function when
`checkForImageSupport()` reports the device does not support images.
2020-03-26 17:46:26 +00:00
Kenneth Benzie
c2dfe8cf25 Fix test executable names in CSV files (#705)
The following test executable name changes have been made in the
conformance CSV files to match those found in the `test_conformance`
build directory:

* `contractions` -> `test_contractions`
* `computeinfo` -> `test_computeinfo`
* `bruteforce` -> `test_bruteforce`
* `Test_half` -> `test_half`
* `test_SVM` -> `test_svm`
2020-03-25 14:27:36 +00:00
Jeremy Kemp
efaf024035 Thread Dimensions: Improve execution time. (#694)
Replaced a kernel used for memseting a large buffer with clEnqueueFillBuffer.

Fixes #692. Addresses #684.
2020-03-24 13:21:56 +00:00
Sreelakshmi Haridas Maruthur
46b6bae001 cl20: api: Allow vendor flags (#666)
Mask off vendor extensions when querying host command queue properties.

Khronos Bug: https://github.com/KhronosGroup/OpenCL-CTS/issues/642
Test Suite Affected: api
2020-03-23 15:58:20 +00:00
jianguang.li
b69f078ca6 update glew to 2.1.0, fix build and link error (#650) 2020-03-20 12:09:01 +00:00
ellnor01
08b52d036f Remove explicit_s2v_bool test (#688)
The test does not do anything other than print a skipping test
message.

Fixes #438

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-03-20 12:00:40 +00:00
Radek Szymanski
e6d81f5d43 Fix memory leak in api - zero_sized_enqueue (#687)
The test enqueues kernel and requests event associated with its
execution, but then never releases the event.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-03-19 16:32:11 +00:00
Grzegorz Wawiorko
0c5da9c777 Fix - add TEST_PASS test status in group of tests (#686) 2020-03-18 15:35:34 +00: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
Grzegorz Wawiorko
77da52a4f3 Fix image required format - sRGB (#678) 2020-03-17 10:20:58 +00:00
Marco Antognini
3e771b0070 Fixes #498 - Extend progvar_prog_scope_uninit checks (#544)
This adds checks to progvar_prog_scope_uninit which ensure that
program-scope variables are default-initialized to the zero-value for
their type.
2020-03-11 18:18:12 +00:00
Grzegorz Wawiorko
78fc283069 Fix test skip handling while test initialization (#670) 2020-03-11 18:14:29 +00:00
Grzegorz Wawiorko
db570f70e5 Set minimum expected OpenCL version for the test. (#674) 2020-03-11 18:14:16 +00:00
Grzegorz Wawiorko
8a00f4eced Test SVM: Fix - do not use unmapped pointer. (#661)
* Fix - do not use unmapped pointer.

* Exchanging variable names to more readable.
2020-03-11 10:10:51 +00:00
alan-baker
5ec04da102 Add a test that clSetKernelArg does not retain the arg (#665)
* Add `retain_mem_object_set_kernel_arg` to test that calling
clSetKernelArg with a cl_mem object does not retain that mem object
2020-03-11 10:09:51 +00: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
Grzegorz Wawiorko
51cd792e9e Fix test skip handling while test initialization - device_timer (#667) 2020-03-10 18:25:49 +00:00
Jeremy Kemp
4b281af946 Build: Ensure compilers required directory structure is present. (#662)
The compiler test requires that directories named "includeTestDirectory" and "secondIncludeTestDirectory" are present with the binary.
2020-03-07 14:36:53 +00:00
Grzegorz Wawiorko
bbbc27e6df Make it possible run test_gl on device OpenCL 1.2 (#659) 2020-03-06 18:27:46 +00:00
Grzegorz Wawiorko
d872d255f6 Add pragma cl_khr_3d_image_writes (#658) 2020-03-06 18:25:49 +00:00
Kévin Petit
4c5a8fff6d Conditionally test BGRA in Basic readimage3d (#623) (#624)
* imageHelpers: Created generic function that returns a vector of required image formats.

An upcoming commit requires access to the vector of required image formats, separatley from check_minimum_supported.

* imageHelpers: Added a new function is_image_format_required.

This function can be used to determine for any given cl_image_format, whether the implementaion is required to support it.

Conditionally test BGRA in Basic readimage3d (#623)

This change adds checks to see if testing against an embedded implementation and if so, queries whether BGRA is supported or not.

* Refactor based on PR review.

* Update passed message code.

* Changed scope of struct to be within test_readimage3d.
2020-03-05 18:47:51 +00:00
Kévin Petit
e62cd4a2b9 Test images - remove setting gDeviceType. (#653)
This is handled in testHarness.cpp
2020-03-05 14:11:37 +00:00
Kévin Petit
c9c3c73aa9 make execution of workgroups test optional (#643) 2020-03-05 08:22:36 +00:00
Kévin Petit
58eb2373a8 Add Travis CI jobs for Arm and AArch64 (#638)
* Add Travis CI jobs for Arm and AArch64

- Use fixed Linaro toolchains
- Move travis script to a shell file

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

* Fix Arm build and string comparisons added under #637

* Remove verbose flag on tar command
2020-03-04 15:18:16 +00:00
Kévin Petit
5e1dbfc49d Fix align_malloc on Linux (#645)
posix_memalign requires alignment to be a power of two and a multiple
of sizeof(void*). All powers of two greater than sizeof(void*) are
multiples of sizeof(void*) so we only need to make sure sizeof(void*)
is the minimum value passed to posix_memalign.

Fixes #644

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-03-04 15:17:50 +00:00
Kévin Petit
4ccc214abb Build a single library for the test harness (#646)
The common library stopped being useful when we got rid of the
last compatibility suite.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-03-04 12:38:33 +00:00
Jeremy Kemp
4c59bfa32f Update table of required image formats (#427) (#629)
* Update table of required image formats (#427)

This commit updates the table of required image formats. The table is built depending on the profile of the device, the requested image type, and the avaiablitiy of relevent extensions.

* Fixed incorrect argument to memcpy.

* Made image format arrays static.

* Utilised ARRAY_SIZE where appropriate.

* Re-named required image format bools to be more explicit.

* Made sRGBA, CL_UNORM_INT8 a required full format profile.

Misinterpretation of the spec had made this optional.

* check_minimum_supported: switched to using vectors.

* Added CL_sRGB CL_UNORM_INT8 to full profile required formats.

This matches the same channel data type requirement as CL_sRGBA.

* Overload <= and >= for the Version class.

* Correct the condition under which sRGB images are required.

* Correct the required image formats are based on OpenCL version.

The spec says that for different OpenCL versions, different sets of image formats are required.

* Print out the correct OpenCL version when required image format is not found.

* Improved the way in which image formats are added based on profile and version.

* Potential build fix regarding isnan namespace issues.

* Image Helpers: Remove duplicate copies when building required image format vectors.

Also re-ordered a branch to make it clearer.
2020-03-03 21:39:32 +00:00