This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Printing of a `size_t` requires the `%zu` specifier.
This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.
---------
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Fixes narrowing conversion build errors in test_common
Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to specific test_conformance suite's
CMakeLists.txt where there are many more build errors revealed
from this fix.
Fixes a few simple issues under test_conformance in the process.
Contributes #787
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
---------
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
fixes several issues:
* `generic_address_space` test: add check for program scope variables.
The test uses both generic AS and program-scope variables, however it
only checked the generic-AS presence in `clGetDeviceInfo`.
* `compiler/test_compiler_defines_for_extensions.cpp`: add
`cl_khr_command_buffer_multi_device` to the list of recognized
extensions
* `command_buffer_event_sync.cpp`: add delays for testing
`clSetEventCallback` - according to specification, these can be executed
asynchronously (in a separate thread) by the OpenCL implementation,
hence the event callback is not quaranteed to be called before
`clFinish()` returns. Existing test `events/test_callbacks.cpp` also
waits for callback with loops of usleep.
* `images/kernel_image_methods/test_1D_buffer.cpp`: fix allocation size
being too small for the 1D buffer backing the image
---------
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
The `test_compiler compiler_defines_for_extensions` test did not free
all `malloc`'ed memory.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
All of these warnings stem from printing `size_t` types, which should
be done using the `z` length modifier.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Update test_compile.cpp
Prevent the error:
"variable 'temp' is uninitialized when used here"
Since one of the generated kernels starts with:
__kernel void sample_test(__global float *src, __global int *dst)
{
float temp;
int tid = get_global_id(0);
dst[tid] = dst[tid] + temp;
* Update test_compile.cpp
clang format
* Update test_compile.cpp
Change the "0.0" literal to "0.0f" for devices that don't support FP64.
The result of the `strdup` was never freed. The string duplication
isn't necessary, so remove it.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The OpenCL Headers have cl_khr_external_memory_dx, cl_khr_external_memory_dma_buf and cl_khr_external_semaphore_dx_fence as extension strings, but CTS Compiler fails if an implementation says that it supports them.
Replace repetitions of extensions_supported[num_of_supported_extensions]
with a single pointer variable.
Replace character-by-character comparisons with a new string_has_prefix
function.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
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>
* Added integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed tests to feature_macro_test
* clang formatting
* Now the test checks whether the array of optional features returned by clGetDeviceInfo contains the standard optional features we are testing.
* Update test_conformance/compiler/test_feature_macro.cpp
Added printing the missing standard feature it it is not found inside the optional features array returned by clGetDeviceInfo.
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
GCC 11.2.0 warns about a possible string overflow (when
num_not_supported_extensions+num_of_supported_extensions == 0)
since no space would be allocated for the terminating
null byte that string manipulation fns expect to find.
This unconditionally adds an extra byte to the allocation to silence
the warning and fix building with -Werror.
* Fix implicit int->float warning inside kernel
This kernel is used to test various compiler options including
-Werror. Some compilers produce a warning about the implicit
conversion which results in this test failing when -Werror is used.
* Fix formatting
* 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>
The get_device_il_version_string() function throws an exception if the
device does not support the CL_DEVICE_IL_VERSION query, so don't call
this unless the version is recent enough.
* Skip compiler unload/reload tests if compiler is not available
Note that tests that use the compiler helper functions but won't work without a
compiler are in the `subtests_to_skip_with_offline_compiler` list. I didn't do
that here because they tests directly use `clBuildProgram` etc directly,
because they're specifically testing it's behaviour in edge-cases.
* Change type of status variable
- 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
* 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
* 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
* 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
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
* 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.
* Improve async build callback testing
Check that the program build status can be queried from inside the
program completion callback, and also add a test to ensure that the
completion callback is called when the build fails.
* Address review comments
* Fix formatting
* Enable -Werror for GCC/Clang builds
Fixes many of the errors this produces, and disables a handful that
didn't have solutions that were obvious (to me).
* Check for `-W*` flags empirically
* Remove cl_APPLE_fp64_basic_ops support
* Undo NAN conversion fix
* Add comments to warning override flags
* Remove unneeded STRINGIFY definition
* Fix tautological compare issue in basic
* Use ABS_ERROR macro in image tests
* Use fabs for ABS_ERROR macro
* Move ABS_ERROR definition to common header