* Add NULL CL_MEM_HOST_PTR check for clGetMemObjectInfo
The spec requires implementations return NULL for CL_MEM_HOST_PTR
when the flags passed at memory object creation time do not contain
CL_MEM_USE_HOST_PTR
CTS was not checking this. Add the same check.
Fixes#1752
* Add NULL CL_MEM_HOST_PTR check for all flag combinations
As part of suggestions to #1801, add NULL CL_MEM_HOST_PTR
check for all flag combinations.
Fixes#1752
* Fix formatting issues
It seemed to be a typo; the comment says that it
tries to fetch local size for a subgroup count with
above max WG size, but it just used the previous
subgroup count.
The test on purpose sets a SG count to be a larger
number than the max work-items in the work group.
Given the minimum SG size is 1 WI, it means that there
can be a maximum of maximum work-group size of SGs (of
1 WI of size). Thus, if we request a number of SGs that
exceeds the local size, the query should fail as expected.
The spec requires implementations return NULL for CL_MEM_HOST_PTR
when the flags passed at memory object creation time do not contain
CL_MEM_USE_HOST_PTR
CTS was not checking this. Add the same check.
Fixes#1752
OpenCL FULL profile requires that online compiler be available.
OpenCL-CTS currently queries profile as well as online compiler
availability via device queries, but doesn't check for the consistency.
Check for consistency that if CL_DEVICE_PROFILE is "FULL_PROFILE"
(or technically is not "EMBEDDED_PROFILE") then CL_DEVICE_COMPILER_AVAILABLE
is CL_TRUE for that device.
Fixes#1763
test_conformance/api/test_queue_properties.cpp uses a cl_queue_properties_khr value
to query CL_DEVICE_QUEUE_PROPERTIES, however this should be a cl_command_queue_properties
typed variable.
Fixes issue #1640
All of these if-else chains compare against enums, which is better
done using switch statements. This helps avoid some
`-Wsometimes-uninitialized` warnings of variables that are assigned
inside the switch.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
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>
Move functions in .h files to .cpp files where appropriate; align
prototypes and definitions; and remove functions that are not used.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Remove invalid assumption from sub-group tests
The sub-group dispatch tests were making the invalid assumption that
querying the local size (via `CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT`)
for a sub-group count obtained from a
`CL_KERNEL_SUB_GROUP_COUNT_FOR_ND_RANGE` with local size `{x, y, z}`
will result in the same local size i.e. that
`CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT` is the inverse of
`CL_KERNEL_SUB_GROUP_COUNT_FOR_ND_RANGE`. To take a trivial example
consider the case that there is only ever one sub-group per work
group(i.e. sub-group == work-group). Then regardless of the local size
passed to `CL_KERNEL_SUB_GROUP_COUNT_FOR_ND_RANGE` the sub-group count
will always be `1`, and `CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT` can
return any valid local size since all local sizes result in `1`
sub-group.
* Format surrounding changes
Remove unused variables throughout the code base and enable the
`-Wunused-variable` warning flag globally to prevent new unused
variable issues being introduced in the future.
This is mostly a non-functional change, with one exception:
- In `test_conformance/api/test_kernel_arg_info.cpp`, an error check
of the clGetDeviceInfo return value was added.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
test_error returns the err given as the first argument. As the
run_test function returns a bool, we end up returning true (meaning
pass) when an api function fails.
Instead return explicitly false (meaning fail).
* 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
* 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)
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.
* Improve Functionality of Harness
In the harness we previously were able to determine whether or
not a device supports the half or double data types, but doing so
required unintuitive function calls and would need to be repeated
per test.
A new pair of functions have been added which clearly state
what they do, and makes it easier to determine whether or not
a device supports the types.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Add Test for CL_KERNEL_ATTRIBUTES (#832)
This test generates dummy kernels which have any
permutation combining the following attributes:
* vec_type_hint
* work_group_size_hint
* reqd_work_group_size
It then gets the attributes by using clGetKernelInfo
and validates that the attributes returned are correct.
By matching the attributes which were used to generate
the kernel are present in the returned string from
clGetKernelInfo.
This test has been implemented as part of the
test_conformance/api suite.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove Signed Vector Attribute Hints
As per comments, SPIR-V does not distinguish the signedness
of an argument. This change removes the "signed" types
to ensure that the test passes in all scenarios.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Add TODO for Signed Vector Hints
As the current version only tests for unsigned
vector types (uchar/uint/etc), add a TODO in the code
as a reference to future work to introduce signed vector
tests
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Improve Functionality of Harness
In the harness we previously were able to determine whether or
not a device supports the half or double data types, but doing so
required unintuitive function calls and would need to be repeated
per test.
A new pair of functions have been added which clearly state
what they do, and makes it easier to determine whether or not
a device supports the types.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Remove Old GetKernelArgInfo Tests (#522)
In the API test suite we have 2 versions which test the
clGetKernelArgInfo API. As part of this ticket we are redesigning
the implementation of this test. This change removes all of
the old code and makes it so that the tests simply pass. A later
commit will add the redesigned test
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Redesign GetKernelArgInfo (#522)
The previous test for this API consisted of 5K+ lines
of code which would define the test kernels and the
expected outputs from this API. This redesign
instead generates the kernels and expected outputs
leading to incresased maintanability and a significantly
reduce line-of-code count.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Address Review Comments
This commit does the following:
1) Update the Copyright to 2021
2) Fixes a typo in a comment
3) Explicitly declares a vector variable
(previously auto)
4) Output subtest result after completion rather than
all of them at the end
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure Kernel Arguments do not exceed CL_DEVICE_MAX_PARAMETER_SIZE
As per upstream comments, this change ensures that the total
size of parameters passed into a kernel does not exceed the
limit specified by CL_DEVICE_MAX_PARAMETER_SIZE for the device
used.
Additionally this change replaces ASSERT_SUCCESS() with test_error()
as per upstream requests.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Address Image and Vector Failures
This change aligns vector 3 types to be sized 4.
Additionally it ensures that image arguments do not
have the address space qualifier specified because
they are by default in the __global space.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure that the size of pipe arguments are correct
As mentioned in PR comments, the test previously assumed that
sizeof(char) == sizeof(pipe char). The Clang implementation
treats a pipe to take the same size as a pointer, which
is now reflected in the code.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Ensure that CL_DEVICE_MAX_PIPE_ARGS is not Exceeded
This commit refactors the code so that Pipes are handled
separately.
Additionally, it removes signed char and char signed as
scalar types to test and removes some redundent code
for modifiying the expected type when processing unsigned
scalar types.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove compatibility test from skip-list
There is a list of tests which should be skipped when
using an offline compiler. As get_kernel_arg_compatibility
has been removed, it should also be removed here.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Disable Pipe Tests
This change disables the Pipe tests for clGetKernelArgInfo
as pipe metadata is not accurately reported on clang
which leads to the pipe tests failing.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
Part of the negative CTS test for clGetPlatformInfo
incorrectly tested with a NULL platform. As this is a
special case it meant that the test was not correct.
This change removes the incorrect part of the test so that
it conforms with the OpenCL specification.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Implement Negative Tests for clPlatform Functions
This change introduces negative tests for clPlatform
functions as well as changes to the Harness to help with
other negative tests.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* [SQUASH] Remove magic macro from Negative Platform Tests
This change removes the negative-testing macro and all
other changes related to its usage.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
The current test would always end up assuming a minimum of 16 KB
regardless of the exposed OpenCL version, and the logic for testing the
OpenCL version was hard to follow.
Besides fixing the test for OpenCL 1.1 through 2.1, it also
* adds support for OpenCL 2.2, 3.0, and future OpenCL versions (as long
as `get_device_cl_version()` supports those);
* adapts the error message to mention the currently exposed OpenCL
version rather than a hardcoded OpenCL 1.1;
* reports the advertised local memory size as KB and not Kb, since local
memory size is given in bytes.
* Using helper functions for clCreateKernel
Uses of clCreateKernel following create program helper
functions, have been incorporated into
create_single_kernel_helper when suitable.
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Skip tests using clCompileProgram in offline mode
Contributes #31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Using type wrappers when using kernel helper functions
Also includes fix for windows build
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove clReleaseKernel for wrapped kernel
Fixes#31
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
In this test we repeated call create_single_kernel_helper
to create different kernels but reuse the same clProgramWrapper.
create_single_kernel_helper() creates a new program each time it
is called, creating a new reference on the underlying context.
When the test ends, the program is released (as it should when
using the clProgramWrapper), however there are multiple program
objects attached to the context resulting in reference leak errors.
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
* Making object queries tests exhaustive
Tests which were only testing fixed values have been made exhaustive
and refactored. They only use properties from the core spec.
Associated Macros have been turned into templated functions.
Comparison of devices with cl_device_id rather than vendor ids.
All object queries tests are now in test_queries.cpp.
Fixes#508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Remove unnecessary arguments from test_queries.cpp functions
Fixes#508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Using test_assert_error in test_queries.cpp
This commit also fixes the queue properties array and
corrects for on device queues being optional in CL3.0
test_queries_compatibility.cpp has been removed as
tests are now in test_queries.cpp
Contributes #508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Correct api test boolean for device queue support
Contributes #508
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Tests requiring image support use runTestHarnessWithCheck
Removing special case for images in runTestHarness.
Fixes#710
* Remove imageSupportRequired argument
Tests which require image support now specify this while
calling runTestHarnessWithCheck.
Fixes#710
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* Add kernel private memory size to CMake build
* Fix kernel private memory size build error
* Use uint for kernel private memory size test
Not all devices support 64-bit types.
* Register kernel private memory size test
Implement a test to ensure that the CL_KERNEL_PRIVATE_MEM_SIZE
flag for clGetKernelWorkGroupInfo passes.
Change-Id: Ibd6d64d185c00ddbd23467692717c534498bb901
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
In embedded profile with cles_khr_int64 support,
the test did not consider the size of long. Thus the
number of argument computation was not coherent with
the returned CL_DEVICE_MAX_PARAMETER_SIZE leaded to test failure.
We fix this by taking the size of long when cles_khr_int64
is available in the device extension.