Commit Graph

53 Commits

Author SHA1 Message Date
Jose Lopez
16cd0afe4f Add case for clSetKernelExecInfo with empty set (#2551)
Adds a special case to ensure that calling `clSetKernelExecInfo` with
`CL_KERNEL_EXEC_INFO_SVM_PTRS` and an empty set of pointers is valid
2025-10-28 08:54:41 -07:00
Antonios Christidis
2031e21a58 Fix Build Warnings for AArch64 (#2242)
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>
2025-02-05 13:58:17 +01:00
Karol Herbst
34feb6e008 svm: finish all queues in svm_pointer_passing (#2209)
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.
2025-01-07 09:35:46 -08:00
Kévin Petit
5b7af4b36d [NFC] Change the name of the default device provided by the new registration framework (#2186)
The code base uses a mix of 'device' and 'deviceID'. I suggest we
standardise on 'device' which is shorter and slightly more prevalent.

Contributes to #2181

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-12-12 13:24:04 -08:00
Ben Ashbaugh
d99b302f90 switch SVM tests to the new test registration framework (#2168)
Switches the SVM tests to the new test registration framework.

The first commit is the best to review and contains the actual changes.
The second commit purely has formatting changes.

Note that several of these changes were a bit more than mechanical
because many of the SVM tests create a new context vs. using the context
provided by the harness and passed to each test function. The previous
code named the context provided by the harness differently, and hence
could use the name "context" in each test function, but with the new
test registration framework this is no longer possible. Instead, I am
creating the new context using the name "contextWrapper" and then
assigning it to the "context" passed to the test function, which seems
like the best way to avoid using the wrong context unintentionally. I am
open to suggestions to do this differently.

I have verified that the same calls are made before and after these
changes, and specifically that there are no context leaks.
2024-12-03 14:51:23 -08:00
Sven van Haastregt
e360d2de5b Fix various Wformat warnings (#2135)
test_copy_1D.cpp: num_mip_levels is a cl_uint, so don't cast and just
print using `%u`.

test_pipe_info.cpp: arg_type_qualifier is a 64-bit wide bitfield, so
print in hexadecimal format using the correct length modifier.

test_device_partition.cpp: it is not clear what the bit width of
`cl_device_partition_property` should be, so cast the operands to align
with the format specifiers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-11-26 09:25:38 -08:00
niranjanjoshi121
a406b34091 Fix error return and TEST_PASS for negative SVM tests (#2027)
Fix error return and TEST_PASS for negative SVM tests
Fix review comments from #1802 

Fixes #1964
2024-08-06 22:50:21 +05:30
niranjanjoshi121
0353c0bdbe Add negative test for test_svm size check (#1802)
Isuue #875 clarified that CL_INVALID_BUFFER_SIZE should be returned if
clCreateBuffer is passed a pointer returned by clSVMAlloc as its
host_ptr and the size of the buffer exceeds the size of the SVM
allocation.

Add a new negative test to ensure CL_INVALID_BUFFER_SIZE is returned
when the size of buffer exceeds the size of the SVM allocation.

Fixes #1701
2024-05-21 08:43:55 -07:00
Sven van Haastregt
e0a31a03fc Fix -Wformat warnings in various tests (#1868)
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>
2024-02-27 09:59:39 -08:00
Haonan Yang
a73f2b38fb Fix windows stack overflow. (#1839) 2023-12-12 09:33:09 -08:00
Sven van Haastregt
aa953aaa51 [NFC] cmake: do not suppress -Wsign-compare globally (#1810)
Only disable `-Wsign-compare` for tests that do not compile cleanly
with this warning enabled.  Re-enable the warning for the other tests,
so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-20 15:48:25 +01:00
Sven van Haastregt
ce17549812 cmake: do not suppress -Wsometimes-uninitialized globally (#1741)
Fix an instance of this warning in mem_host_flags.

Only disable `-Wsometimes-uninitialized` for the SVM test, which does
not compile cleanly with this warning enabled.  Re-enable the warning
for the other tests, so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-02 10:57:10 +01:00
Sven van Haastregt
a70fa56003 Fix some Wunused-but-set warnings (#1666)
To the best of my understanding, these occurrences of the
`-Wunused-but-set` warnings do not reveal any underlying issues, so we
can safely remove these variables.  There are more occurrences of this
warning in other places (not touched by this commit) that require
further analysis.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-03-30 09:34:00 +01:00
Sven van Haastregt
a61fa63054 [NFC] cmake: Remove redundant CMAKE_CXX_STANDARD (#1558)
`CMAKE_CXX_STANDARD` is already set in the top-level CMakeLists.txt
file, so there is no need to have it repeated for individual modules.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-11-04 08:53:42 -07:00
Sreelakshmi Haridas Maruthur
30500fba06 SVM: Fix memory allocation size. (#1514)
* SVM: Fix memory allocation size.

9ad48998 generally made memory allocation and mapping consistent with a
size of size_t. Apply that fix to the final two allocations.

* check-format fixes

Co-authored-by: spauls <spauls@qti.qualcomm.com>
2022-09-27 09:28:57 -07:00
niranjanjoshi121
d928ac059c Use correct size for memory allocation in SVM test (#1496)
Memory is allocated for cl_int, but mapped as size_t.

Use size_t instead of cl_int during allocation and mapping for consistency.
2022-09-12 12:42:06 +01:00
Sven van Haastregt
6554c49018 [NFCI] Remove unused variables and enable -Wunused-variable (#1483)
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>
2022-09-08 12:54:36 +01:00
niranjanjoshi121
9ad4899862 Use size_t instead of cl_int (#1414)
* Use size_t instead of cl_int

Memory is allocated for cl_int,
but mapped as size_t.
Use size_t instead of cl_int during
allocation and mapping for consistency.

* Use size_t instead of cl_int

Memory is allocated for cl_int,
but mapped as size_t.
Use size_t instead of cl_int during
allocation and mapping for consistency.

* Use size_t instead of cl_int

Memory is allocated for cl_int,
but mapped as size_t.
Use size_t instead of cl_int during
allocation and mapping for consistency.

* Remove test_half changes.

Remove test_half changes from other fix
that got included in this commit.

* Final formatting fix.
2022-08-31 22:58:13 -07:00
Grzegorz Wawiorko
216455842d Change arg type to unsigned int from signed int (#1078)
* Change arg type to unsigned int from signed int

* Fix formatting issues
2021-02-02 16:43:37 +00:00
Grzegorz Wawiorko
2597027737 Use highest OpenCL C version (#1081)
* Set the highest supported OpenCL C version.

* Remove gDeviceLt20 variable - not used anymore.

* Fix formatting issues
2021-01-11 13:54:19 +00:00
Ben Ashbaugh
d3eba8571a add OpenCL 3.0 test for CL_COMMAND_SVM_MIGRATE_MEM (#856) 2020-07-31 13:10:05 +01:00
Grzegorz Wawiorko
450f583800 Fix code format errors vs.2 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
44a240367e Fix code format errors 2020-07-23 17:21:07 +01:00
Grzegorz Wawiorko
d643dc5399 Add API name to version_expected_info function 2020-07-23 17:21:07 +01:00
Kévin Petit
5e2f5b857e Accept OpenCL 3.0 in version parsing code and use where appropriate (#752)
* Accept OpenCL 3.0 in version parsing code and use where appropriate

There were a number of tests against 2.2 that are clearer against 3.0.

Fixes #751

Signed-off-by: Kévin Petit <kpet@free.fr>

* Remove CL_EXPERIMENTAL guards

Signed-off-by: Kévin Petit <kpet@free.fr>

* formatting

* Configure the headers for OpenCL 3.0

* more format fixes
2020-04-30 11:51:06 +01:00
ellnor01
3b79ecdb87 Replace get_device_version with get_cl_device_version (#733)
They are duplicate functions

Fixes #709

Change-Id: I8f7d6b8254047adb9e09ede4951dedc3ec5c1099
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 14:31:22 +01:00
Grzegorz Wawiorko
78fc283069 Fix test skip handling while test initialization (#670) 2020-03-11 18:14:29 +00:00
Grzegorz Wawiorko
8a00f4eced Test SVM: Fix - do not use unmapped pointer. (#661)
* Fix - do not use unmapped pointer.

* Exchanging variable names to more readable.
2020-03-11 10:10:51 +00:00
Radek Szymanski
80c3a27a6a Remove unused parameter (#630)
The imageSupportRequired param is not needed in runTestHarnessWithCheck,
so just remove it.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-02-27 15:36:28 +00:00
Kévin Petit
3f11868e11 Fix warnings reported by -Wconversion-null (#603)
Fix error reporting in clFillImage as a result.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2020-02-21 12:21:53 +00:00
boazo
fa6b9e671e Svm optional (#580)
* svm test optional

* make svm test suite execution optional
2020-02-20 19:39:40 +00:00
Grzegorz Wawiorko
1ca9d9dca7 test_svm - enqueue_api - lack of synchronization points (#571)
* Fixes #570 - test_svm - enqueue_api - lack of synchronization points

* Review fixes - use variable, use CL_MAP_READ

* Review fix - use nullptr instead of 0
2020-02-03 13:47:50 +00:00
Kévin Petit
d7e8e5040a Mark SVM and pipes tests as requiring OpenCL 2.0 (#475)
Signed-off-by: Kévin Petit <kpet@free.fr>
2019-11-14 17:26:32 +00:00
Grzegorz Wawiorko
d6e1e7c870 Fix Issue 462 - test_svm crash (#463) 2019-10-02 11:57:40 +01:00
Kévin Petit
da0f375226 Add host/host test for clEnqueueSVMMemcpy (#460)
This was the only combination that was not exercised.

Fixes #419

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-09-26 11:56:34 +01:00
Grzegorz Wawiorko
f4682a9181 Fix compilation issues (#448) 2019-09-12 13:05:46 +01:00
Grzegorz Wawiorko
e880869559 Fix verification if atomics 64bit extensions supported by device (#441) 2019-08-23 10:24:02 +01:00
Kévin Petit
0b9329a9d6 Add missing event release calls in SVM tests (#437)
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
2019-08-16 15:51:25 +01:00
Kévin Petit
fa4b278432 Build the harness as a static library (#430)
This reduces by a factor of roughly two the number of files to build.

Fixes #193.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-07 17:18:10 +01:00
Grzegorz Wawiorko
da313500a5 test clEnqueueSVMMemcpy in case of host memory allocation (#300)
* test clEnqueueSVMMemcpy in case of host memory allocation

* test clEnqueueSVMMemcpy - refactored to call once API function

* test clEnqueueSVMMemcpy - review fixes
2019-08-05 10:54:21 +01:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Kevin Petit
75a26fdc44 Specify minimum required version for all OpenCL 2.1 tests
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 10:02:28 +01:00
Wenju He
1d2e0ca248 Fix SVM if 64-bit atomic extensions are supported (#396)
Need to enable 64-bit atomic extensions in kernel source.
Use InterlockedCompareExchange64 for 64-bit type.
2019-07-24 18:54:20 +01:00
Grzegorz Wawiorko
53189e3fba Intel compiler - fix assert when checking OCL version (#287) 2019-06-11 09:25:39 +01:00
Grzegorz Wawiorko
6c999818ee cl22: Improved CRC calculation (#133)
* Improved CRC calculation

* Improved CRC calculation - review fix

* Improved CRC calculation - build brake fix

* Improved CRC calculation - remove external initializaiton
2019-04-18 15:00:45 +01:00
Kevin Petit
d43f576588 Fix error message in SVM test
Signed-off-by: Xin Jin <xin.jin@arm.com>
2019-04-11 13:03:46 +01:00
Radek Szymanski
07196c351a cl22: Use single array for function list (#148)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:30:38 +01:00
Grzegorz Wawiorko
394dece0d7 Khronos Bug 15617 SVM memory migrate test issues (#125) 2019-04-10 10:54:03 +01:00
Grzegorz Wawiorko
07ae6422b6 Khronos Bug 15208 test_set_kernel_exec_info_svm_ptrs stack corruption (#121) 2019-04-10 10:26:58 +01:00
Grzegorz Wawiorko
5a0ef9fef7 Fix resource leak in SVM test (#127)
The buffer was never unmapped.

Change-Id: If8be7f9f08ae7c26a537039f2bbeeb674cc30059
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
2019-03-26 09:10:15 +00:00