Although run_conformance.py runs from test_conformance, it will change
the current working directory before launching each individual test.
Adjust the path accordingly.
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
In C++17 the return type of std::filesystem::path::u8string() is
std::string, but in C++20 the return type changed to std::u8string.
Add a helper to copy a std::u8string to a std::string, to be used when a
std::string is required. This fixes the build for C++20.
Add a command line argument to override the SPIR-V file paths if needed,
similar to `test_spirv_new`. Set the default path to the one required by
`run_conformance.py`, which assumes the current working directory to be
`<build_dir>/test_conformance`.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
There are two changes in total. The first one to fix a small issue of
current working directory so that second change can be applied. And the
second one is for resolving #852 Removing hard-coded SPIR-V binaries in
clUnloadPlatformCompiler tests.
Fixes#852
---------
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Signed-off-by: Xing Huang <xing.huang@arm.com>
While #2409 is under review, could we please add "cl_khr_spirv_queries"
to the list of known extensions? This will prevent test "failures" for
implementations that support the extension.
Found while developing #2376.
Parts of "test_opencl_c_versions" were intending to build programs for
different OpenCL C versions, but unfortunately the helper function the
test was calling only created the program and did not build it. Switch
to a helper function that builds the program, instead.
Add installation rules for all the binary targets.
Targets are installed under `<CMAKE_INSTALL_PREFIX>/bin/<CONFIG>` where
`<CONFIG>` is `CMAKE_BUILD_TYPE` for single-config generators, e.g. Unix
Makefiles and Ninja, or the build configuration for multi-config
generators, e.g. Ninja Multi-Config and Visual Studio.
This creates the target `install` on Unix and `INSTALL` on Windows.
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.