* 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
They are duplicate functions
Fixes#709
Change-Id: I8f7d6b8254047adb9e09ede4951dedc3ec5c1099
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* 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.
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>
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.
(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
- 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>
(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>
(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>
* 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
* 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.
* 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).
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>
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>
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.
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.
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`
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>
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.
* 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.
* 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
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>
* 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.
* allow conditional execution of subgroups test suite
* make subgroups test suite execution optional
* make execution of subgroups suite optioanl
* allow conditional execution of subgroups test suite
* make subgroups test suite execution optional
* make execution of subgroups suite optioanl
* Fix conversions build with gcc 4.8.5 armhf.
Re-named fplib.c to fplib.cpp.
Updated the conditions under which fplib.cpp will be included in the build by CMake.
* Build: Added a global archtiecture variable, CLConform_TARGET_ARCH.
The reset of the build can query this variable whenever archtiecture specific options are required. The current supported values of this variable are "ARM", "x86", and "x86_64".
This change also replaces all existing locations where CMAKE_SYSTEM_PROCESSOR was queried.
* Build: Added ARM64 as a valid value for CLConform_TARGET_ARCH.
* Conversions: Don't build fplib.cpp for ARM64.