* Fail feature macro compare if compiler has more features than runtime
Because a C++11 `std::equal` only iterates over the first container, and
matches with items in the second, if the second container contains more items
the check can still pass even though they're not identical. Just use `==`
instead.
Fixes#979
* Move an expression to its point of use
A previously created Image was not being released leading to a
memory leak.
Change-Id: I9715b5c4193a8e89c6c182b443959009ce1f1129
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
- Remove the requirement to detail values for device queries and list
extensions in the submission template. They are printed by computeinfo.
- Require that tests skipped in accordance with the conformance
process be listed in the submission template.
- Remove support for OPENCL_1_0_DEVICE. This variable doesn't control
anything anymore and the updated conformance process no longer refers
to it.
- Require that implementations running via a loader document the loader
that was used.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* add test_compiler test for OpenCL C versions
* add checks for required OpenCL C versions
* bugfix: only OpenCL C 2.0 is required for OpenCL 2.1 and 2.2
* pass reference to feature struct vs. pointer
* address review comments regarding C++ identifiers and 3d image writes
The Volatile, Coherent, NonWritable and NonReadable decorations can
only be applied to images if they are storage images, which require
the Shader capability.
Note that in SPIR-V 1.4 and later, the NonWritable decoration can
also be applied to objects in the Private and Function storage classes
(although Private also requires the Shader capability), but this was
not covered by the existing test for the NonWritable decoration.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
* initial version, tests vec2 and vec4
* added all types and vector sizes
* fix formatting
* add checks for long and ulong support
* test floats unconditionally, not tied to long support (oops)
* fix for vec3 kernel arguments
* remove generic address space dependency
* This removes API specific csv files, as these are no longer required.
This also updates opencl_conformance_tests_quick.csv to include >= 2.0 tests.
No changes were required for opencl_conformance_tests_full.csv.
Addresses #863
* Pass the correct arguments to test_spirv_new.
* Test feature macro OpenCL 3.0
* Test feature macro OpenCL 3.0 - refactor to template function
* Use test_error and format fix issues
* Fix returned value type for CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE
* Code format fix
* Feature macro test - refactor code to have one test case
* add consistency checking comparing supported features to CL_DEVICE_OPENCL_C_FEATURES
* fix minor issues
* Feature macro test - fix test version
* Feature macro test - add -cl-std=CL3.0 build option
* Feature macro test - compilation errors
* Feature macro test - compilation errors OSX
* Feature macro test - fix adding build options
* Feature macro test - share function OutputBuildLogs
* Feature macro test - back removed cases
* Feature macro test - review fixes
* Feature macro test - split check image formats
* Feature macro test - fixed version
* Use Version type for cl_khr_spir extension version checks
The current method of using `std::find(versions, 1.2f)` is unreliable due to
performing a floating point comparison. I.e. on some compiles it will
spuriously report that the required version is missing and skip the tests.
* Address clang-format failure.
* Correct typo.
* The `atomic_flag` test assumes support for the `atomic_scope_device`
scope in the global scope test case. Since `atomic_scope_device` is
optional on an OpenCL-3.0 driver, this test should check for support and
skip otherwise.
The generator function for atomic_fence uses the current workgroup
size to determine the number of non atomic variables per thread
in the kernel. The kernel should hence be regenerated when the
workgroup size changes.
However regenerating the kernel can itself change the workgroup
size. This change introduces an iterative loop that reduces the
workgroup sizes by 2 each time re-generating the kernel until
we find one that works (or exit at groupsize == 1)
Change-Id: Ic32fe967e32de6643e01c6775f4bddbcad0a299a
* Change setup code in `KernelCode()` to use `_explicit` builtin
variants that are common to both OpenCL-2.X and OpenCL-3.0.
* Only test optional supported builtin variants (`_explicit` signature
memory_order/scope) for OpenCL-3.0.
* Disable program scope global variable and generic address space tests
for a OpenCL-3.0 driver which does not optionally support these
features.
* Fix enqueue_flags test to use correct barrier type.
Currently, enqueue_flags test uses CLK_LOCAL_MEM_FENCE.
Use CLK_GLOBAL_MEM_FENCE instead as all threads across work-groups
need to wait here.
* Add check for support for Read-Wrie images
Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.
Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.
Fixes issue #894
* Fix formatting in case of Read-Write image checks.
Fix formatting in case of Read-write image checks.
Also, combine two ifs into one in case of
kerne_read_write tests
* Fix some more formatting for RW-image checks
Remove unnecessary spaces at various places.
Also, fix lengthy lines.
The called function (get_device_info_string) subtracts 1 from
length before returning it. Hence, to check for an empty string
(that the spec requires the implementation to return when
CL_DEVICE_IL_VERSION is not supported) the check should be modified
to check for empty and not length == 1
As per the spec CL_PROFILING_COMMAND_COMPLETE is required to
be equal to CL_PROFILING_COMMAND_END only on devices that
do not support the on-device queue.
For other cases it can be >= CL_PROFILING_COMMAND_END
The test attempts to build a program from source containing invalid code, to
provoke a build failure. In offline compilation mode, this causes the offline
compiler to give an error, failing the test.
Signed-off-by: Einar Hov <einar.hov@arm.com>
* Merge vec_step and vec_align binaries into a new vectors binary
This change just merges the two suites to reuse common functions
and definitions. There is probably room for further code consolidation
but probably best done as a separate change.
Contributes to #683
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* format fixes
* added pipes test
clang-format fixes
* simplify diffs
* added pipes test
clang-format fixes
* simplify diffs
* add Program Scope Global Variables consistency test
* switched other checks to test_assert_error
* add non-uniform work group consistency test
* added read-write images consistency test
* add Creating 2D Images from Buffers consistency test
* add Device and Host Timer Synchronization consistency test
* add Intermediate Language Programs consistency test
* add Subgroups consistency test
* add Program Initialization and Clean-Up Kernels consistency test
* add 3D Image Writes consistency test
* clang-format fixes
* switch the check for 3D image writes extension for clarity
* add Depth Images consistency test
* update test for CL_QUEUE_SIZE, must return CL_INVALID_COMMAND_QUEUE
* formatting fixes
* fix copy-paste typo
* change expected error codes to CL_INVALID_OPERATION
* address review comments
* fix formatting
* address review feedback
Since pipes are cl_mems, We can spec and test that clGetPipeInfo
returns CL_INVALID_OPERATION when pipes are not supported by
passing a non-pipe memory object to the function.
* use the CTS framework to choose the OpenCL C version
* address review feedback
Cast input array to floats before setting NANs which are also floats to
prevent large nonsensical numbers outside of the valid domains of
several math functions from being tested.
Khronos Bug: https://github.com/KhronosGroup/OpenCL-CTS/issues/491
Test Suite Affected: bruteforce Subtests: sin, cos, sincos, reciprocal
Change-Id: Ie029837f4f9dfc73d6a9c356b73158e2ad41b871
* remove SPV_KHR_no_integer_wrap_decoration
* address review comments
* remove the assemble_spirv script
There is another PR in flight that adds a much more complete
script that we should merge instead.
In two places, a stray semicolon between an if statement and its body
would cause the body to be executed unconditionally. Fix this.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
* Pass `-cl-std=CL3.0` as build option for OpenCL-3.0.
* For an OpenCL-3.0 driver that optionally does not support non-uniform
work-groups round up the global size and run the tests with uniform
work-groups. This increases coverage and allows testing of the
`get_enqueued_local_size` builtin for uniform work-groups.
... as required by the OpenCL specification.
Also introduce a utility function to manage polling for changes
via a user-supplied function. Several tests we introduced lately
could have used this.
Signed-off-by: Kévin Petit <kpet@free.fr>
* OpenCL 3.0 test CL_QUEUE_PROPERTIES_ARRAY
* add verification if requested_size <= CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE
* remove test_case - set NULL properties, get not empty array with 0 terminator
* add printing test_case description
* change logic of checking if requested properties are supported by device
depending on host/device type queue.
* fix a few bugs, rename test for consistency
* add utility function for comparing properties
Co-authored-by: Grzegorz Wawiorko <grzegorz.wawiorko@intel.com>
* Skip `rw_image_access_qualifier` if images are not supported.
* Skip `rw_image_access_qualifier` if read-write images are optionally
not supported on a OpenCL-3.0 or later device.
* Stop assuming `-cl-std=CL3.0` and default to latest OpenCL C supported
by the device.
* Automatically select the `-cl-std` build option (stop assuming
`CL2.0`) in the `compiler_defines_for_extensions` test. This will allow
us to test `test_compiler_defines_for_extensions` with an OpenCL-3.0
driver that optionally might not support OpenCL C 2.0. Use the CTS
framework to automatically select the latest version of OpenCL C
supported by the device.
* Stop assuming `-cl-std=CL2.0` for the `pragma unroll` test. This
allows us to run this test for OpenCL-3.0 drivers which optionally do
not support OpenCL C 2.0. Use the CTS framework to automatically select
the latest OpenCL C supported by the driver.
* Test minimum memory consistency capabilities for a device reporting >= 3.0.
Skip tests where unsupported memory consistency capabilities are being requested.
* Pass nullptr as program build option.
Allows the CTS framework to select an appropriate CL C version.
* Removed redundant braces.
The test checks profiling value CL_PROFILING_COMMAND_COMPLETE
compared to CL_PROFILING_COMMAND_END for two cases:
1) kernel with children with different levels of nesting
2) kernel without children
* Adds testing for CL_PROGRAM_IL
Added a test to check SpirV as an IL for programs built with IL
which includes a negative test for programs built without IL.
Added a test_fail macro.
Fixes#164
Change-Id: I908241242b369551806e43b90ab414f895d5c8f7
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
* COMPUTE-11739 Removing unused platform and device_version
Fixes#164
Change-Id: Ib1168f6396132b69996d07166e1b593fa933d245
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>