glutInit double called in CTS CLGL test case code, which will lead
to an error:
freeglut (./test_gl): illegal glutInit() reinitialization attempt
root cause is in: test_conformance/gl/main.cpp:343
if (glEnv->Init(&argc, (char **)argv, CL_TRUE))
the glEnv->Init has already called in same file line:260, the function
glutInit in glEnv->Init can not be called twice, then a error will occur
although all the gl / CLGL cases are passed. Then in the full quick CTS
running it will appear:
(12-Jul 03:54:01) BEGIN OpenCL-GL Sharing :
PASSED sub-test.
PASSED 23 of 23 tests.
(12-Jul 04:01:48) FAILED OpenCL-GL Sharing : (467s, test 34/53)
Although all the gl/CLGL cases are passed, but this group test is judged
to failed.
This issue already been found in
https://github.com/KhronosGroup/OpenCL-CTS/pull/1885
And fixed partly by:
02471c8f56
But I found in setup_osx.cpp, the glutInit still has double init issue,
I add the same fix like previous fix,
can you please help to review?
Signed-off-by: Honglei Huang <Honglei1.Huang@amd.com>
Co-authored-by: Honglei Huang <Honglei1.Huang@amd.com>
All of these are already set in the top-level `CMakeLists.txt` nowadays,
so no need to repeat them in the test's own `CMakeLists.txt`.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This will ensure consistent output on any conforming implementation.
Note that the specification does not define the output style when
precision is missing.
---------
Signed-off-by: Cui, Dele <dele.cui@intel.com>
fixes a few minor issues introduced by #1984.
edit: Tested with the updated command buffer emulation layer on a device
that supports out-of-order queues and SVM and all of the
`test_cl_khr_mutable_dispatch` tests pass.
fixes#2040
* Compiles the Vulkan SPIR-V files in a directory based off of
CMAKE_CURRENT_BINARY_DIR.
* Changes the search path for the Vulkan SPIR-V files to this directory
rather than a semi-arbitrary set of directories.
Include `cmath` instead of `math.h` in C++ mode under MSVC, to avoid
build errors inside the header. Ideally we would not condition this
on `_MSC_VER`, but issue 1833 currently prevents doing so.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The various forms of `TestInfoBase` have many members in common, so
avoid duplicating the struct definition and move it to `common.h`.
Provide a description and initializer for every struct member, and drop
initializations done with `memset`.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
An implementation may not support exportable semaphore, subtests
available in cl_khr_external_semaphore assumes support for exportable
semaphore, resulting in failure on such implementation. Allow
implementations to use importable semaphore in such cases.
The main sources of warnings were:
* Printing of a `size_t` which requires the `%zu` specifier.
* Printing of `cl_long`/`cl_ulong` which is now done using the `PRI*64`
macros to ensure portability across 32 and 64-bit builds.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Basic explicit_s2v:
The verification step was always using round to even when converting a
float to half even for round to zero cores.
Commonfns degrees:
The verification step was only taking into account infinities and not
values that over/underflow. This resulted in an incorrect error
calculation. E.g:
double cpu_result = 175668.85998711039;
cl_half gpu_result = 31743; // this is 65504 when converting to float,
we overflowed.
float error = (cpu_result - gpu_result) * some_factor;
The fix adds the check if( (cl_half) reference == test ) before
calculating the error.
This makes it literally impossible for drivers to constant fold the
IsTininessDetectedBeforeRounding kernel. Sure, drivers might have should
respect volatile here, but I'm not convinced this is actually required
by the spec in a very strict sense, because here there are no
side-effects possible in the first place.
And as far as I know, constant folding is allowed to give different
results than an actual GPU calculation would.
In any case, passing the constants via kernel arguments makes this
detection more reliable and one doesn't have to wonder why the fma test
is failing.
Side note: this was the last bug (known as of today) I had to fix in
order being able to make a CL CTS submission for Apple Silicon devices.
1. Fix memory leak by making `context2` use the context wrapper.
2. Create two separate events to associate with the two calls to
`clEnqueueSignalSemaphoresKHR()`, as events cannot be reused.
Also delete the unused helper function
`semaphore_external_cross_queue_helper()` (which was a duplicate of
`external_semaphore_cross_queue_helper()` anyway).
Some conformance tests use directly the size returned by the runtime
for max memory size to allocate buffers.
This doesn't leave enough memory for the system to run the tests.
Skip the correctly rounded divide (divide_cr) and sqrt (sqrt_cr) tests
for fp16 and fp64.
The corresponding build option to enable correctly rounded divide and
sqrt is named `-cl-fp32-correctly-rounded-divide-sqrt` and the
description refers only to "single precision floating-point", so this
option should not apply to fp16 or fp64.
The specification states that fp16 and fp64 divide and sqrt must be
correctly rounded for the full profile, without needing any additional
build options. This is already tested by the regular divide and sqrt
tests. For the embedded profile the ULP requirement is non-zero, but
there is no build option to request a correctly rounded implementation
anyway.
Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/1901 .
Relates to https://github.com/KhronosGroup/OpenCL-CTS/issues/1996 .
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The kernel_read_write tests have a lot of duplicate code. These are the
next steps to reducing the duplication, by using the functions in
test_common.cpp as common for 1D, 1D array and 2D array.
---------
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com>
The math_brute_force test has a link-check-only mode to quickly test if
all math functions are present.
In link-check-only mode, most tests return immediately after kernel
compilation, but some tests also run the kernel and read back the result
data before returning. Running the kernels takes a lot more time,
defeating the purpose of the `-l` mode.
Break out at the start of the main `for` loops in link-check-only mode
instead of returning directly, so that each test can still log its
trailing message (in most cases just a `\n`).
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The handling of NaN values in the templated function was incorrect due
to improper initialization of the input data source. Specifically, the
function ZeroNanToIntCases used a global pointer gIn, which was not
correctly set or did not point to the same data as the local input
pointer s used in the non-templated implementation.
to solve the issue I updated the templated function ZeroNanToIntCases to
take an additional parameter for the input data source.
and then passed the correct input data (s) to the templated function
during its invocation.
Co-authored-by: Banan Ashkar <banan.ashkar@mobileye.com>
MSVC on Windows was previously omitted from the list of CI platforms
that use sccache. Unify the CMAKE_CACHE_OPTIONS used for all CI
platforms.
In the case of a 100% cache hit, this cuts down the average checks time
from 8 minutes to 4 minutes, example:
https://github.com/ahesham-arm/OpenCL-CTS/actions/runs/9896449792
The `skipTestingRelaxed` check suffers the following problems:
- The use of `skipTestingRelaxed` in the `if` seems reversed: when
skipping correctness testing using the `-l` command line option, this
variable causes correctness testing to be run for relaxed-mode `tan`
regardless.
- Accuracy testing should only be skipped for derived `tan`
implementations. Non-derived `tan` implementations must still be tested
for accuracy, so the condition for setting the `skipTestingRelaxed`
variable is incomplete.
- It is unclear why only `tan` is conditionalized here. There are other
functions such as `tanpi` for which one would expect identical
behaviour.
The actual skipping of accuracy checks for derived implementations
happens in `Test()`, so just remove `skipTestingRelaxed` as it does not
seem to add any value.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
The computeinfo test already checks that the cl_khr_fp16 extension is
available before querying `CL_DEVICE_HALF_FP_CONFIG`, but never actually
made the `CL_DEVICE_HALF_FP_CONFIG` query.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Since GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
clang-format has already been disabled here. Make the function list a
bit easier to read. Make the currently commented out functions stand out
better on a line of their own.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Instead of selecting an arbitrary number for the number of parallel
build jobs, use CMake's `--parallel` option instead.
Option was introduced in version 3.12, GitHub runners currently use
CMake version 3.29.6 so this is supported.
Fixes#2003
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
The `vulkan-wrapper` helper library's purpose is to eliminate the need
to link targets directly to Vulkan, and load it dynamically instead at
runtime, using `dlopen` and `LoadLibrary`.
Remove the direct linking of the Vulkan library from targets that link
to `vulkan-wrapper`.
Fixes#1999
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>