Commit Graph

679 Commits

Author SHA1 Message Date
Sreelakshmi Haridas Maruthur
6adf4ead5c build: Various improvements. (#743) (#1006)
- Remove the build_<platform> scripts that were simply calling cmake in favor of
  using cmake directly
- Move flag  CRT_SECURE_NO_WARNING into a section specifically for visual studio
- Change vendor file selection to just use the file if present
- Add a variable for determining whether to link against pthread
- Delete all lines in CMakeVendor.txt so each implementation can define their own

Change-Id: Ibbd83521ce4d42d09dcbd0b16efa9fbe6cbf785d
2020-10-21 10:02:22 +01:00
Kenneth Benzie
8d44302935 Return a non-zero exit-code when a sub-test fails (#951)
When running sub-tests explicitly on the command line and that sub-test
fails, the test harness returns `0` from `main()`. This is problematic
in automated testing environments as failed tests can be hidden.

This patch iterates over all the test results in the `resultTestList`
after all sub-tests have completed, if any of the tests failed a
non-zero value is returned from `parseAndCallCommandLineTests()` which
is then propagated up the call stack to `main()`.
2020-10-19 23:08:40 -07:00
Sreelakshmi Haridas Maruthur
b165de7649 conversions: Use ARM emulation for aarch64 (#967)
The host compiler will not always calculate reference values
the same, depending on optimization level.  It generates
instructions that do not respond to CPU rounding mode in
the same way.  Use QCOM rounding mode emulation to correctly
calculate reference values on aarch64.
2020-10-19 15:08:06 -07:00
Stuart Brady
90c9ea5d7c Fix compilation failure with -Werror=narrowing (#901)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-10-19 13:58:35 +01:00
james-morrissey-arm
0a8c5feed7 Fix floating point validation in write_image tests (#1017)
Fix validate_float/half_write_results so that when nan/inf is
encountered on a channel, the rest of the channel values are still
considered for correctness.

Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: James Morrissey <james.morrissey@arm.com>

Co-authored-by: John Kesapides <john.kesapides@arm.com>
2020-10-19 13:57:01 +01:00
ellnor01
a6809710ea Remove unnecessary cl_mem_flags casts (#1018)
* api, atomics: remove unnecessary cl_mem_flags casts

Instances in api, atomics, buffers and c11_atomics suites

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* basic: remove unnecessary cl_mem_flags casts

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* spir, thread_dimensions: remove unnecessary cl_mem_flags casts

Instances in spir, thread_dimensions and workgroups tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* profiling, relationals: remove unnecessary cl_mem_flags casts

Includes relationals, profiling, muliple_device_context, integer_ops
tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* clcpp: remove unnecessary cl_mem_flags casts

Contibutes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* events, geometrics: remove unnecessary cl_mem_flags casts

Includes events, geometrics, gl and images tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* commonfs, compiler: remove unnecessary cl_mem_flags casts

Includes cast removal in commonfs, compiler and device_partition tests

Fixes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Fix up formatting

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-10-19 13:56:02 +01:00
julienhascoet
8ca1537157 Fix api/test_api_min_max for Embedded profile with cles_khr_int64 support (#994)
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.
2020-10-13 09:27:27 +01:00
Alastair Murray
d0e97361ae Add a binary compile mode CSV (#987)
This is identical to the SPIR-V spreadsheet, except spir-v mode is replaced by
binary mode.
2020-10-13 09:24:22 +01:00
Kévin Petit
020eea9e52 Don't require support for 3D image writes in tests that don't need it (#1003)
Also fix PASSIVE_REQUIRE_* macros to report tests as skipped instead of passed.

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-10-05 13:20:51 -04:00
Chetan Mistry
7a735b74e3 Replace cl_ushort with cl_half (#885) (#1000)
* test_common: Replace cl_ushort with cl_half (#885)

Change-Id: I507eca2084629c3b6f3e7331f062f006edbce434
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* buffers, pipes, profiling: Replace cl_ushort with cl_half (#885)

Change-Id: Id9799322b636af6aa0eec3d4e846d7af8c7f9602
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* images/kernel_read_write: Replace cl_ushort with cl_half (#885)

Change-Id: I922ddb593b6e5631d0f4ea1522c7f75f8770be40
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>

* half: Replace cl_ushort with cl_half (#885)

Change-Id: I484a5bb2b33a7e87805fc6079953c66e5f8d9239
Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
2020-10-02 16:29:05 +01:00
julienhascoet
615ab64db5 Fix error handling for test_half (#997)
For vLoadHalf test, the error was
not properly returned leading to
test success whereas it failed.
2020-10-02 11:22:35 +01:00
Ben Ashbaugh
81cea4775e added extended versioning tests for OpenCL 3.0 (#996)
* added extended versioning tests for OpenCL 3.0

* address review feedback
v2020-10-01-00
2020-09-30 21:47:42 +01:00
Ben Ashbaugh
a9d06dcd81 add a basic test for CL_PIPE_PROPERTIES (#995) 2020-09-30 15:18:55 +01:00
Alastair Murray
26cacf056e Fail feature macro compare if compiler has more features than runtime (#982)
* 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
2020-09-30 11:06:45 +01:00
Chetan Mistry
a41e5a9ee0 samplerlessReads: Release Image to stop Memory Leak (#984)
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>
2020-09-30 09:50:21 +01:00
Kévin Petit
3320035581 Align with updated conformance process (#989)
- 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>
2020-09-29 13:51:49 -07:00
Ben Ashbaugh
beaecb71a3 add checks for OpenCL C versions (#968)
* 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
2020-09-28 00:26:57 +01:00
Ben Ashbaugh
951d010eaf add a new test to verify reported image formats (#963) 2020-09-28 00:22:49 +01:00
Stuart Brady
f732cd5b7e Remove invalid SPIR-V image decoration tests (#22) (#958)
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>
2020-09-25 14:57:41 +01:00
Ben Ashbaugh
bd86e2aa9b temporarily disable the unload_invalid test case (#978)
Different implementations of the OpenCL ICD loader treat a null
platform differently, so this case does not reliably return
CL_INVALID_PLATFORM.
2020-09-25 14:25:49 +01:00
Alastair Murray
59a57de9bf Replace use of -ILPath with --spirv-binaries-path in CSV (#981) 2020-09-25 14:25:26 +01:00
Alastair Murray
0bff9b6674 Skip feature macro consistency tests if no compiler is available (#983)
The test compiles programs to determine compiler support, which isn't possible
if the compiler is not available, so skip the test.
2020-09-25 14:24:57 +01:00
Ben Ashbaugh
02fc5809e3 simple vector swizzle test (#960)
* 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
2020-09-24 20:41:04 +01:00
Jeremy Kemp
4d3a3e8b16 Update CTS csv files. (#971)
* 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.
2020-09-24 20:36:52 +01:00
Grzegorz Wawiorko
e1cf741f1c Test feature macro OpenCL 3.0 (#762)
* 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
2020-09-24 20:34:56 +01:00
Ben Ashbaugh
eb1bb88a19 add a test case for subbuffer property queries (#961) 2020-09-24 16:40:18 +01:00
Kévin Petit
20b507a386 A first set of updates to the submission template (#969)
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-09-24 13:18:46 +01:00
Jeremy Kemp
10a30afeb2 Fix kernel compilation issue in c11 atomics. (#973) 2020-09-23 17:16:26 +01:00
Alastair Murray
1a3e19c37e Use Version type for cl_khr_spir extension version checks (#953)
* 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.
2020-09-22 21:49:13 +01:00
Jack Frankland
61cfb505ae Skip atomic_flag Test on for OpenCL-3.0 not Supporting Device Scope (#954)
* 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.
2020-09-22 09:26:05 -07:00
Sreelakshmi Haridas Maruthur
60b731ce15 c11_atomics: Fix to iteratively reduce workgroup size (#939) (#941)
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
2020-09-22 09:15:09 -07:00
Jack Frankland
9178524d02 Change Behaviour of C11 Atomic Tests for OpenCL-3.0 (#944)
* 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.
2020-09-22 09:08:32 -07:00
Nikhil Joshi
f7a0936879 Add check for Read-Write images support (#965)
* 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.
2020-09-22 09:05:58 -07:00
Kévin Petit
aee9131f87 Print the latest conformance version passed reported by the device (#959)
Fixes #798

Signed-off-by: Kévin Petit <kpet@free.fr>
2020-09-22 09:04:02 -07:00
Sreelakshmi Haridas Maruthur
fffd4f2474 compiler: Modify the IL check code to check for an empty string (#964)
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
2020-09-21 17:51:54 +01:00
David Avedissian
3db1a9b3aa Ensure that test_preprocessors checks __OPENCL_C_VERSION__ correctly for CL 3.0 contexts. (#938) 2020-09-17 09:42:58 +01:00
Sreelakshmi Haridas Maruthur
f627a68dd6 device_execution: Modify the check in profiling subtest (#962)
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
2020-09-17 09:36:43 +01:00
Sreelakshmi Haridas Maruthur
90b57a2d7a api: Allow vendor flags (#957)
Mask off vendor extensions when querying host command queue properties.
2020-09-15 11:19:20 +01:00
Jesse Natalie
7fd87c704a Use power-of-two alignment values for allocating pixel data (#827) 2020-09-11 00:25:58 +01:00
Einar Hov
172322e155 Add async_build test to list of tests to skip during offline compilation mode (#950)
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>
2020-09-10 16:58:29 +01:00
Ben Ashbaugh
c67868834a switch back to CL_INVALID_MEM_OBJECT for clGetPipeInfo (#947)
* switch back to CL_INVALID_MEM_OBJECT for clGetPipeInfo

* fix formatting

* correct error message to CL_INVALID_MEM_OBJECT
2020-09-10 11:59:15 +01:00
Ben Ashbaugh
4421713cd4 add checks for atomic feature consistency (#946) 2020-09-09 18:13:43 +01:00
Kévin Petit
869d5a1032 Merge vec_step and vec_align binaries into a new vectors binary (#926)
* 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
2020-09-08 18:16:08 +01:00
Ben Ashbaugh
75ce4c5b0e API Feature Consistency Test, Part 2 (#912)
* 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
2020-09-08 17:24:09 +01:00
Sreelakshmi Haridas Maruthur
6b1e61f9de bruteforce: Fix out-of-domain input handling in bruteforce (#699)
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
2020-09-06 08:57:27 +01:00
Ben Ashbaugh
ab106e97f9 specialization constant test fixes (#927)
* 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.
2020-09-04 11:46:22 +01:00
Stuart Brady
11f3eaaceb [MinGW] Fix if statements with stray semicolons after condition (#934)
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>
2020-09-04 11:25:52 +01:00
Jeremy Kemp
822c5a5fc0 queue_flush_on_release: pass event by reference (#937) 2020-09-03 16:55:43 +01:00
Stuart Brady
5f63747c2e Remove empty statements due to use of double semicolons (#935)
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2020-09-03 14:36:38 +01:00
Jack Frankland
d1a63f8041 Change Behviour of non-uniform-work-group tests for OpenCL-3.0 (#877)
* 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.
2020-09-01 08:16:17 -07:00