Commit Graph

248 Commits

Author SHA1 Message Date
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
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
Grzegorz Wawiorko
77da52a4f3 Fix image required format - sRGB (#678) 2020-03-17 10:20:58 +00:00
Grzegorz Wawiorko
51cd792e9e Fix test skip handling while test initialization - device_timer (#667) 2020-03-10 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
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
Kévin Petit
b2eba77d42 Get rid of test_finish macro and related ATF cruft (#633)
Closes #431

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-03-02 15:06:44 +00:00
James Price
7c82f6a9b8 Fix sterror_r usage for Android API >=23 (#636)
Fixes KhronosGroup/OpenCL-CTS#493
2020-02-28 12:24:13 +00:00
Kévin Petit
b93c1df933 Remove duplicate definition of align_{malloc,free} (#631)
Also use it instead of duplicating the code.

Fixes #326

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-28 12:22:38 +00:00
James Price
5f77d763ea Do not include sys/sysctl.h on Android (#635)
Android has linux/sysctl.h, but the functions that need it are not
used when targeting Android at the moment.
2020-02-28 08:38:52 +00:00
Radek Szymanski
80c3a27a6a Remove unused parameter (#630)
The imageSupportRequired param is not needed in runTestHarnessWithCheck,
so just remove it.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-02-27 15:36:28 +00:00
Kévin Petit
d5334dc61d Get rid of checkDeviceTypeOverride (#602)
This is now done in the test harness.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-24 10:34:04 +00:00
Grzegorz Wawiorko
2cb73ba685 Fix - Windows build errors (#620) 2020-02-24 10:28:40 +00:00
Grzegorz Wawiorko
452adcd7be Fix - Windows build errors - utsname sysctl files (#621) 2020-02-24 10:28:05 +00:00
Bhargav Das
b2cb18073c Improved PrintArch functions (#595) (#601)
Moved all duplicate 'PrintArch' functions to testHarness.c
Replaced sysctl system call used in 'PrintArch' function with uname
system call

Signed-off-by: bhargavdas <bhargav_das@mentor.com>

Update testHarness.c
2020-02-21 16:47:54 +00:00
Grzegorz Wawiorko
3a628cfae2 Fix - Windows build errors (#608) 2020-02-21 10:07:34 -05:00
Ben Ashbaugh
170784c193 use strtok_s in place of strtok_r on Windows (#606)
Signed-off-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2020-02-21 08:05:27 +00:00
James Price
bce4e48c89 Rename harness .c sources to .cpp where necessary (#513)
Remove hacks from harness CMakeLists.txt to force language.

Contributes to KhronosGroup/OpenCL-CTS#25
2020-02-20 21:09:36 +00:00
jiabaxie
943ba04c0c set gDeviceType in testharness.c (#597)
* set gDeviceType in testharness.c, also moved gTestRounding to imageHelpers.cpp & .h and removed duplicate code from host_atomics.cpp

* Cleaned up some redundant code

* Reversed the change in testharness.c
2020-02-20 10:39:55 +00:00
jiabaxie
68d08e07bf Moved all instances of gDeviceType to imageHelper.cpp (#575)
* Moved all instances of gDeviceType to imageHelper.cpp

* Missed one instance of gDeviceType

* Removed all instances of extern cl_device_type gDeviceType, except in imageHelpers.h
2020-02-06 08:27:13 +01:00
Grzegorz Wawiorko
7127b2a05f Fixes Issue #514 - Offline compilation does not work. Null device reported (#515) 2019-12-11 10:31:42 +00:00
Grzegorz Wawiorko
1d7bd0d10d GL sharing: Test name adjustment and Windows compilation clarification. (#336)
* Test name adjustment and Windows compilation clarification.

* Add CLConform_GL_LIBRARIES_DIR CmakeLists variable for GL support

* GL sharing tests - library names justification

* Fix compilation errors function are overridden in glext.h.
2019-12-03 09:32:43 +00:00
Kévin Petit
4a8cae4ae2 harness: select queue creation function based on OpenCL version (#490)
Use clCreateCommandQueue before OpenCL 2.0.

This enables most of the binaries to run to completion on a
1.2 implementation.

Signed-off-by: Kévin Petit <kpet@free.fr>
2019-11-19 18:59:04 +00:00
boazo
60101c24cf Save Kernel Sources to Disk - Infrastructure Change (#412)
* Introduces the ability to capture the kernel sources and the build
options used by the conformance tests to a .cl and .options files.
This is achieved via a new compilation cache mode called dump-cl-files.
Files will be generated to the folder pointed by the compilation cache
path.

When a conformance test is executed with dump-cl-files cache mode and online
compilation mode, the files will be saved to the disk and the regular execution
flow of the conformance continues uninterrupted.

When a conformance test is executed with dump-cl-files cache mode and binary or spir-v
compilation mode, the files will be saved to the disk as well, however the compilation
will fail - leading to a failure in all test cases.

* Introduces the ability to capture the kernel sources and the build
options used by the conformance tests to a .cl and .options files.
This is achieved via a new compilation cache mode called dump-cl-files.
Files will be generated to the folder pointed by the compilation cache
path.

When a conformance test is executed with dump-cl-files cache mode and online
compilation mode, the files will be saved to the disk and the regular execution
flow of the conformance continues uninterrupted.

When a conformance test is executed with dump-cl-files cache mode and binary or spir-v
compilation mode, the files will be saved to the disk as well, however the compilation
will fail - leading to a failure in all test cases.

* merged with latest CTS code
2019-11-18 09:45:44 +00:00
Jim Lewis
040321d8b9 Allow CL_FLOAT denorm flushing for write tests (#28) (#456)
* Require exact for match normals, instead of arbitrary .005 relative error
* Add relaxation to allow 0 when float denormal is expected
* Refactor to use common validation function
2019-11-15 13:38:15 +00:00
Jim Lewis
cce8fd90b1 Fix dll linking warnings for VS 2015/17 (#467)
-- #ifdef out duplicate definitions
-- remove make_nan() dead code
2019-10-04 12:28:55 +01:00
Pavan K Lanka
79d1a14aa0 Fix for https://github.com/KhronosGroup/OpenCL-CTS/issues/346 - causing special float number generation to be skipped (#443) 2019-09-16 11:37:32 +01:00
Stuart Brady
0d96c198ee Reimplement invocation of offline compilation program
This change reimplements offline compiler invocation, using a new command
line interface that allows the passing of relevant CL device information
to the offline compiler.  The information that is passed is as follows:

 * CL_DEVICE_ADDRESS_BITS
 * CL_DEVICE_EXTENSIONS
 * CL_DEVICE_IL_VERSION (with --compilation-mode=spir-v only)
 * CL_DEVICE_VERSION

The interface for the offline compiler script is as follows:

   usage: cl_offline_compiler --source FILE --output FILE
                              --cl-device-info FILE --mode MODE
                              -- [BUILD_OPTIONS [BUILD_OPTIONS ...]]

   positional arguments:
     BUILD_OPTIONS          additional options to pass to the compiler

   optional arguments:
     --source FILE          OpenCL C source file to compile
     --output FILE          SPIR-V or binary file to create
     --cl-device-info FILE  OpenCL device info file
     --mode                 compilation mode (spir-v or binary)

The OpenCL C version for compilation is now specified in BUILD_OPTIONS,
as normal for online compilation, i.e. with -cl-std=VERSION.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
2c43504923 Cleanup offline compilation code
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
4d891b67bd Separate out device information functions
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Stuart Brady
245e11ec67 Allow device ID to be specified for offline compilation
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2019-08-12 10:18:06 +01:00
Kévin Petit
fa4b278432 Build the harness as a static library (#430)
This reduces by a factor of roughly two the number of files to build.

Fixes #193.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 17:18:10 +01:00
Kevin Petit
4cb8fc49f8 Remove almost duplicate compatibility common code
Use the non-compatibility version.

In each case the diff was minimal, didn't have modifications that
would invalidate compatibility testing and it was clear that the
"latest/best" version was not the one in the compatibility copy.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 11:59:28 +01:00
Radek Szymanski
03650057bb Move printing sub-test information into test harness (#421)
This removes all the duplicated code from each test, and moves it to
test harness so that we have single place where this information is
printed.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:16:12 +01:00
Alastair Murray
85d474f06a Reintroduce M_PI compatibility
M_PI is not part of C99 or C++ and thus aren't provided in all configurations.
This used to be handled in reference_math.c directly but was recently removed.
Just tweak the M_PI handling in the compatibility headers to restore builds.
2019-08-02 18:38:23 +01:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Kevin Petit
9dff128d42 Extend version checks in subgroup test to support all cases
To prepare for merging the cl20_trunk branch.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 10:02:49 +01:00
Samuel Pauls
627c180a31 cl20: Khronos Bug 16080 Fix local work size limit.
Problem: Some tests assume that all local work-items can be used in a
single dimension of an NDRange.

Spec References: OpenCL C 2.0 r19, table 4.3,
CL_DEVICE_MAX_WORK_ITEM_SIZES.

Solution: The overall maximum local work size is trimmed to that of an
NDRange's first dimension or all dimensions, as appropriate.

Test Suite Affected: atomics, non_uniform_work_group, and workgroups.

Side Effects: None

Change-Id: I2e8179ca15c2c090f47ea84d1d3c109dd69ec185
2019-07-31 14:10:07 +01:00
Kevin Petit
4c31b69980 Merge branch 'cl21_trunk'
# Conflicts:
#	.travis.yml
#	CMakeLists.txt
#	CMakeVendor.txt
#	README.md
#	build_android.py
#	build_lnx.sh
#	build_win.bat
#	readme-spir-v-binaries.txt
#	test_common/harness/kernelHelpers.c
#	test_common/harness/kernelHelpers.h
#	test_conformance/CMakeLists.txt
#	test_conformance/opencl_conformance_tests_21_full_spirv.csv
#	test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv
#	test_conformance/opencl_conformance_tests_full.csv
#	test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv
#	test_conformance/opencl_conformance_tests_quick.csv
#	test_conformance/run_conformance.py
2019-07-30 12:10:52 +01:00
Kévin Petit
be80a7feaf Align offline compilation with cl21_trunk (#400)
Add a special case for the Khronos compiler and always use it for
OpenCL C++, otherwise use the same logic as on the cl21_trunk
branch.

The CMake option to pass the path to the khronos compiler has
been renamed to KHRONOS_OFFLINE_COMPILER_OPTIONS and is no longer
mandatory.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-30 11:52:31 +01:00
Kévin Petit
996dd659fc Reduce diff with master branch (#399)
A first round of whitespace, formatting and uncontroversial changes.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-07-30 09:51:03 +01:00
Stuart Brady
912bfbe466 Split offline compilation into multiple functions 2019-07-19 10:47:32 +01:00
Stuart Brady
9c337d5f37 Refactor handling of device ID for offline compilation
This also cleans up error handling in get_device_address_bits().
2019-07-19 10:47:32 +01:00
Stuart Brady
979405d84d Fix error handling in create_single_kernel_helper() 2019-07-19 10:47:32 +01:00
Stuart Brady
9cfca7e69e Split offline compilation into multiple functions 2019-07-19 10:45:57 +01:00
Stuart Brady
fe3049a491 Refactor handling of device ID for offline compilation
This also cleans up error handling in get_device_address_bits().
2019-07-19 10:45:57 +01:00
Stuart Brady
c45d5b6a20 Update command line parameters for offline compilation
This change simplifies the command line interface for controlling offline
compilation.  It replaces special command line syntax for controlling the
compilation cache for SPIR-V compilation, with generic command line
parameters that can now also be used for binary offline compilation.
2019-07-08 11:34:02 +01:00