Fixes several compile issues I am seeing for my version of Visual Studio
related to an ambiguous call to `fpclassify`, which is called by `isnan`
and other similar functions, specifically for the `cl_half` type:
```
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): error C2668: 'fpclassify': ambiguous call to overloaded function
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(298,31): message : could be 'int fpclassify(long double) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(293,31): message : or 'int fpclassify(double) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(288,31): message : or 'int fpclassify(float) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): message : while trying to match the argument list '(_Ty)'
```
Some of these issues seem like differences in compiler behavior, but at
least one appears to have identified a legitimate bug.
Specifically, this change:
* Removes the special-case checks for finite half numbers for commonfns,
since this is already handled by `UlpFn`. (test with: `test_commonfns
degrees radians`)
* Assigns to temporary variables to eliminate the ambiguous function
call for relationals. (test with: `test_relationals relational*`)
* Properly converts from half to float when checking for NaNs for
select. This is the one that seems like a legitimate bug. (test with:
`test_select select_half_ushort select_half_short`)
* Uses `std::enable_if` to disambiguate a function call for spirv_new.
(test with: `test_spirv_new decorate_saturated*`)
If it's helpful, my specific Visual Studio version is:
```
Microsoft Visual Studio Professional 2019
Version 16.11.20
VisualStudio.16.Release/16.11.20+32929.386
```
I also have the Windows Software Development Kit 10.0.19041.685
installed.
Images with a `CL_UNSIGNED_INT_RAW10_EXT` and
`CL_UNSIGNED_INT_RAW12_EXT` data type are unnormalised, so the
normalised tests with theses images are invalid and will be skipped.
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
Signed-off-by: Xin Jin <xin.jin@arm.com>
Co-authored-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
fixes#2247
* For the `negative_create_command_buffer_not_supported_properties`
test, the only property we can check for is simultaneous use. All other
properties are part of other extensions and hence will generate
`CL_INVALID_VALUE`, not `CL_INVALID_PROPERTY`.
* Checks whether the `cl_khr_command_buffer_multi_device` extension is
supported when using `CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR`, instead
of `device_side_enqueue_support`.
* If the `cl_khr_command_buffer_multi_device` extension is NOT supported
and the `CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR` command buffer creation
flag is used, the expected error code is `CL_INVALID_VALUE`, not
`CL_INVALID_PROPERTY`.
Update cl_khr_command_buffer tests to reflect changes from
https://github.com/KhronosGroup/OpenCL-Docs/pull/1292
* Moves negative test for
`CL_DEVICE_COMMAND_BUFFER_SUPPORTED_QUEUE_PROPERTIES_KHR` from
command-buffer creation to enqueue.
* Moves negative test for
`CL_DEVICE_COMMAND_BUFFER_REQUIRED_QUEUE_PROPERTIES_KHR` from
command-buffer creation to enqueue.
* Introduces a negative test for `CL_INVALID_DEVICE` on command-buffer
enqueue for new error condition in spec. Although it requires a context
to be contain more than 1 device, which I'm not sure if possible in
current test framework.
* Introduces a new test that created a command-buffer using a queue
without the profiling property set, then enqueues the command-buffer to
a queue with the profiling property set.
* Introduces a new test that creates a command-buffer with an in-order
queue, enqueued on an out-of-order queue.
* Introduces a new test that creates a command-buffer with an
out-of-order queue, enqueued on an in-order queue.
1. In vector test, prepare RTZ answer for RTZ rounding.
2. In mixed_format_random test, for a given float 'arg', the test
previously used 'arg' directly to generate ref_str:
```
ref_str << str_sprintf(format, arg);
```
This approach incorrectly assumes:
```
(float) arg == to_fp(to_str(arg));
```
However, this assumption fails under RTZ rounding. For example:
```
arg = 0xC642549C
to_str(arg) = -12437.152343f
to_fp_rtz(-12437.152343f) = 0xC642549B (-0X1.84A936P+13)
to_fp_rte(-12437.152343f) = 0xC642549C (-0X1.84A938P+13)
```
To address this, the reference result is now computed based on the
literal float string rather than the original 'arg' value.
Add custom commands and targets to automatically assemble and validate
the SPIR-V shaders used by the test.
Automatic assembly depends on finding `python3`, `spirv-as` and
`spirv-val`. `SPIRV_TOOLS_DIR` can be defined by the user during
configuration to provide an override path. Default behaviour assumes
that the binaries exist in `PATH`.
---------
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
`LogBuildError` was only ever called after `clSetKernelArg`, but setting
a kernel argument has no impact on the program build log. Printing of
the actual build log in case of a build failure is already handled via
`create_single_kernel_helper`.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit links to issue (#2234).
When cross-compiling for AArch64, using gcc 13.3, you encounter three
warnings types that turn into errors:
- maybe-uninitialized
- stringop-truncation
- strict-aliasing
This commit fixes all the warnings found, in regards to the first two
rules. To resolve the warnigns due to strict-aliasing, I am editing the
CMake build system.
Signed-off-by: Antonios Christidis <a-christidis@ti.com>
fixes#2145
As suggested by @svenvh reciprocal has different precision requirements
than divide. This PR introduces special path for reciprocal for
binar_float_operator to test reciprocal with relaxed math. If this PR
will get approvals, invalidate PR #2162
The buffer size input to the test function clEnqueueReadBuffer was
incorrect, which cause segmentation fault. And it didn't match the size
for the host allocation outptr
In the half-precision `fdim` test, the original code used `CL_HALF_RTE`
to convert the float result back to half, causing a mismatch in
computation results when the hardware uses RTZ. Some of the examples:
```
fdim(0x365f, 0xdc63) = fdim( 0.398193f, -280.75f) = 281.148193f (RTE=0x5c65, RTZ=0x5c64)
fdim(0xa4a3, 0xf0e9) = fdim(-0.018112f, 10056.0f) = 10055.981445f (RTE=0x70e9, RTZ=0x70e8)
fdim(0x1904, 0x9ab7) = fdim( 0.002449f, -0.003279f) = 0.005728f (RTE=0x1dde, RTZ=0x1ddd)
```
Fixed this by using the hardware's default rounding mode when converting
the result back to half.
This fixes three problems in `test_vulkan`:
1. One negative test is violating the OpenCL specification. A call to
`clEnqueue{Wait,Signal}SemaphoresKHR` with an invalid semaphore should
return `CL_INVALID_SEMAPHORE_KHR` and not `CL_INVALID_VALUE`.
>
[CL_INVALID_SEMAPHORE_KHR](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_INVALID_SEMAPHORE_KHR)
if any of the semaphore objects specified by sema_objects is not valid.
2. When populating the list of supported external memory handle types
for Vulkan, the types are unconditionally added to the list, without
checking if the device supports it or not, this fix is namely for
`VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`.
3. If a device does not support an optional extension (that is required
for a test), the test should skip, not throw an exception and fail. A
test failure should be reserved for the cases where a device claims
support for an extension but then fails to execute the test correctly.
---------
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
- generate spv files into VULKAN_TEST_RESOURCES directory
- works with change that generates spv at build time
Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
Avoid a
```
‘%zu’ directive writing between 1 and 20 bytes into a region of size 16
```
warning by using `std::string` for `generate_shuffle_mask`.
As this fixes the last remaining Wformat warning in the relationals
suite, drop the local `-Wno-format` compiler option.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
It was noticed during another PR review
https://github.com/KhronosGroup/OpenCL-CTS/pull/2207/files#r1903921283
that there
was a case where the return value of a `Skip()` check was ignored, this
is fixed in this PR.
I've also tracking down occurrences of derived class overriding the
`Skip()` test fixture method, but not calling the parents class `Skip()`
check inside of the method. I believe omitting this parent skip check
wasn't intentional, it's clearer to explicitly respect the parent
classes skip conditions, even if we've got away with not needing too due
to the way the derived class skip conditions have been defined.
As described in Issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/2152 we currently
check the provisional extension version supported by a vendor is the
same or older than a test specified version. However, it was discussed
in the WG that this should be a check for equality to avoid hitting
issues when a implementation tests against an older version of the CTS
using a lower extension version, with API breaking changes having
occurred since.
The tests for the command-buffer family of extensions are the only
provisional KHR tests using this versioning check, so this PR updates
all those cases to equality.
fixes#2140
Adds testing for SPIR-V 1.5 features:
* Adds a test for bitcasts between pointers and vectors of integers.
Note, SPIR-V 1.5 only supports bitcasts to vectors of two 32-bit
integers. Therefore, the SPIR-V 1.5 behavior will only be exercised on
devices with 64-bit pointers. The test will run on devices with 32-bit
pointers, but will instead bitcast to scalars.
* Adds a test for OpGroupNonUniformBroadcast with a dynamic index. Note,
this is not an exhaustive test, and only unsigned integer types are
tested, to avoid duplicating testing for cl_khr_subgroup_ballot.
The `svm_pointer_passing` test has unflushed buffer unmap commands
queued, which a runtime might process after the `clSVMFree` calls at the
end of the test (through implicit flushing when destroying the queues at
e.g. program exit handlers).
This is only an issue when running the test with multiple devices.
However I think this was caused by a simple typo given the `clFinish`
was simply in the wrong block.
Use `add_custom_command` and `add_custom_target` instead of
`execute_process` so the generation of the Vulkan shader is done at
build time and not configuration time.
Use `configure_file` instead of string replacement.
Fixes#2179
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Move the global `-Wno-format` compiler option to the individual tests
that still trigger Wformat warnings. The majority of the tests now
compile cleanly with `-Wformat` enabled.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
- to be able to have deterministic results it is useful to have a
mechanism
to force the same count of workers
- this commit doesn't change the default settings but expands
functionality
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
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>
This change fixes the following issues when running `clCopyImage` test
with `use_pitches` flag for 1D buffer images.
1. Query device CL version using `get_device_cl_version` rather than
using `CL_DEVICE_VERSION`. Previously, using `char` may not be enough to
store the return value.
2. Pass `host_ptr` to `clCreateBuffer` when creating the buffer for the
1D image. `host_ptr` may not be `nullptr` if use_pitches flag is used.
Also, `buffer_flags` will contain `CL_MEM_USE_HOST_PTR` which requires a
host pointer to be passed.
3. Conditionally use the `host_ptr` when calling `clCreateImage`, it
will not be used with 1D image buffer. This is made to align with the
spec, in which if `mem_flags` has `CL_MEM_USE_HOST_PTR` a host pointer
must be present, but if the memory flag is not present, host pointer
must be `nullptr`.
4. Use the correct free function `free` and `align_free` based on the
allocation function that was used.
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This change addresses a free function mis-match issue where `delete` is
used to free memory allocated via `malloc` within `create_random_data`
and in the test function.
The change involves the following tests:
1. arrayimagecopy
2. arrayimagecopy3d
3. imagearraycopy
4. imagearraycopy3d
This should address #2173
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>