Commit Graph

12 Commits

Author SHA1 Message Date
Joerg
1cede6dc2b Skip testing mipmaps if extension is not available (#2085)
'./test_image_streams test_mipmaps CL_FILTER_NEAREST' already skips many
tests, but doesn't do so for cl_ext_image_raw10_raw12, causing it to
fail.

Add a check similar to how it is done in the other tests already.

On a device which doesn't support mipmap'd access:
W/o fix
```
./test_image_streams test_mipmaps CL_FILTER_NEAREST
...
1Darray passed
2Darray...
-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

2Darray passed
cl_image_requirements_size_ext_negative...
...
image_from_buffer_read_positive passed
cl_ext_image_raw10_raw12...
---- Supported 2D read formats for this device for cl_ext_image_raw10_raw12---- 
  CL_R    CL_UNSIGNED_INT_RAW10_EXT 0
  CL_R    CL_UNSIGNED_INT_RAW12_EXT 0
------------------------------------------- 
read_image (normalized float coords, uint results) *****************************
[CL_R    CL_UNSIGNED_INT_RAW10_EXT 1] - CL_FILTER_NEAREST - CL_ADDRESS_CLAMP_TO_EDGE - NORMALIZED
ERROR: clBuildProgram failed! (CL_BUILD_PROGRAM_FAILURE from <>/OpenCL-CTS/test_common/harness/kernelHelpers.cpp:844)
Build options:  -cl-std=CL3.0
Original source is: ------------
#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
__kernel void sample_kernel( read_only image2d_t input, sampler_t imageSampler, __global float *xOffsets, __global float *yOffsets, __global uint4 *results , float lod)
{
   int tidX = get_global_id(0), tidY = get_global_id(1);
   unsigned int lod_int = (unsigned int) lod;
   int width_lod = (get_image_width(input) >> lod_int) ?(get_image_width(input) >> lod_int):1 ;
   int offset = tidY*width_lod + tidX;
   float2 coords = (float2)( (float)( xOffsets[offset] ), (float)( yOffsets[offset] ) );
   results[offset] = read_imageui( input, imageSampler, coords , lod);
}Build not successful for device <>, status: CL_BUILD_ERROR
Build log for device <> is: ------------
<source>:1:26: warning: unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring
#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
                         ^

<source>:9:22: error: no matching function for call to 'read_imageui'
   results[offset] = read_imageui( input, imageSampler, coords , lod);
                     ^~~~~~~~~~~~

error: Compiler frontend failed (error code <unknown>)
```


With fix:
```
./test_image_streams test_mipmaps CL_FILTER_NEAREST
....
image_from_buffer_read_positive...
image_from_buffer_read_positive passed
cl_ext_image_raw10_raw12...
---- Supported 2D read formats for this device for cl_ext_image_raw10_raw12---- 
  CL_R    CL_UNSIGNED_INT_RAW10_EXT 0
  CL_R    CL_UNSIGNED_INT_RAW12_EXT 0
------------------------------------------- 
-----------------------------------------------------
This device does not support cl_khr_mipmap_image.
Skipping mipmapped image test. 
-----------------------------------------------------

cl_ext_image_raw10_raw12 passed
PASSED sub-test.
PASSED 18 of 18 tests.
```
2024-09-24 08:52:10 -07:00
Jason Ekstrand
6e6249fb48 images: Stop checking gDeviceType != CL_DEVICE_TYPE_GPU (#1418)
* images: Stop checking gDeviceType != CL_DEVICE_TYPE_GPU

If the device type also advertises CL_DEVICE_TYPE_DEFAULT (which should
be valid), this causes it to be considered a CPU device and the tests
enforce different precision and rounding expectations.

* Fix clang-format

* Drop redundant NORM_OFFSET checks
2022-05-17 08:51:53 -07:00
James Price
03a0989998 Use std::vector for format lists in images suite (#1105)
* Use std::vector for format lists in images suite

Avoids memory deallocation issues and generally simplifies the code.

* Fixup formatting with git-clang-format
2021-01-14 13:27:59 +00:00
Radek Szymanski
956d9a05e6 Remove unused code in kernel_read_write (#1050)
These declarations either aren't used or aren't needed, as testBase.h
already declares them.

Some definitions got moved to test_common.h, as these are duplicated
across few files. There's further opportunity to improve code reuse
via test_common.h, but that's for future patch.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-11-20 14:06:40 +00:00
Ben Ashbaugh
0424fc7f12 skip test cases rather than fail without cl_khr_3d_image_writes (#874)
* skip test cases rather than fail without cl_khr_3d_image_writes

cl_khr_3d_image_writes is required for OpenCL 2.x devices, but is not
required for OpenCL 1.x or OpenCL 3.0 devices.  A check for the presence
of the extension on OpenCL 2.x devices already exists in
test_min_max_device_version, so we don't need any failure conditions
here, and can just skip tests if the extension is not supported.

* clang-format changes
2020-08-14 11:17:44 +01:00
Radek Szymanski
54c21467ad Reduce code duplication in images (#749)
Some of the image code is needlessly copied over, where all you need is
a simple for loop.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-05-05 09:49:28 +01:00
Radek Szymanski
e72cff3e7d Remove duplicate format functions (#738)
This moves the filter_formats and get_format_list functions to a common
file. These functions were roughly the same, with an optional filtering
in some tests for testing mipmaps.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2020-04-17 10:55:17 +01:00
ellnor01
c19897ff0f Remove check_opencl_version function (#734)
Removing all references to check_opencl_version as similar
get_device_cl_version() can be used instead.

Fixes #527

Change-Id: I474b6f536033707e1beb9b5b39410de24672c040
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-04-15 16:03:19 +01:00
Grzegorz Wawiorko
daafdac555 Fixes issue #497 - Image tests from master branch on OCL 1.2 device (#501)
* Fixes issue #497 - Image tests from master branch on OCL 1.2 device

* Fixes issue #497 - use get_device_cl_version
2019-12-20 11:30:03 +00:00
Radek Szymanski
03650057bb Move printing sub-test information into test harness (#421)
This removes all the duplicated code from each test, and moves it to
test harness so that we have single place where this information is
printed.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-08-05 15:16:12 +01:00
Radek Szymanski
f635b604f7 cl22: Reuse test harness code in kernel_read_write (#243)
Some of the setup functionality is already there in the test harness, so
use that and remove the duplicated code from within the suite.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-05-01 21:20:30 +08:00
Kedar Patil
2821bf1323 Initial open source release of OpenCL 2.2 CTS. 2017-05-16 18:44:33 +05:30