Commit Graph

5 Commits

Author SHA1 Message Date
Sven van Haastregt
ea934a7648 basic: fix size_t Wformat warnings (#2264)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-18 09:11:32 -08:00
John Kesapides
dd029cab8f Deduplicate test_imagedim (#1546)
Signed-off-by: John Kesapides <john.kesapides@arm.com>

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2024-07-09 09:56:42 -07:00
Nikhil Joshi
0130c24fe5 Fix malloc-size calculation in test imagedim (#1100)
* Fix enqueue_flags test to use correct barrier type.

Currently, enqueue_flags test uses CLK_LOCAL_MEM_FENCE.
Use CLK_GLOBAL_MEM_FENCE instead as all threads across work-groups
need to wait here.

* Add check for support for Read-Wrie images

Read-Write images have required OpenCL 2.x.
Read-Write image tests are already being skipped
for 1.x devices.
With OpenCL 3.0, read-write images being optional,
the tests should be run or skipped
depending on the implementation support.

Add a check to decide if Read-Write images are
supported or required to be supported depending
on OpenCL version and decide if the tests should
be run on skipped.

Fixes issue #894

* Fix formatting in case of Read-Write image checks.

Fix formatting in case of Read-write image checks.
Also, combine two ifs into one in case of
kerne_read_write tests

* Fix some more formatting for RW-image checks

Remove unnecessary spaces at various places.
Also, fix lengthy lines.

* Fix malloc-size calculation in test imagedim

unsigned char size is silently assumed to be 1
in imagedim test of test_basic.
Pass sizeof(type) in malloc size calculation.
Also, change loop variable from signed to unsigned.
Add checks for null pointer for malloced memory.

* Use size_t instead of int for imagedim

The size calculation for image with larger dimensions
is overflowing with int values.
Change image dim variables to use size_t
to avoid overflow.
While at it, fix formatting at various places.

* Use new instead of malloc in test imagedim

Use new and delete in place of malloc
and free through test_basic imagedim
to avoid NULL pointer checks.

* Revert sizeof changes from size calculation

As the types of width and height are now
changed to size_t, sizeof is not required
in size calculation.
Revert the same.
2021-01-21 13:31:54 +00:00
ellnor01
a6809710ea Remove unnecessary cl_mem_flags casts (#1018)
* api, atomics: remove unnecessary cl_mem_flags casts

Instances in api, atomics, buffers and c11_atomics suites

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* basic: remove unnecessary cl_mem_flags casts

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* spir, thread_dimensions: remove unnecessary cl_mem_flags casts

Instances in spir, thread_dimensions and workgroups tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* profiling, relationals: remove unnecessary cl_mem_flags casts

Includes relationals, profiling, muliple_device_context, integer_ops
tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* clcpp: remove unnecessary cl_mem_flags casts

Contibutes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* events, geometrics: remove unnecessary cl_mem_flags casts

Includes events, geometrics, gl and images tests

Contributes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* commonfs, compiler: remove unnecessary cl_mem_flags casts

Includes cast removal in commonfs, compiler and device_partition tests

Fixes #759

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>

* Fix up formatting

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
2020-10-19 13:56:02 +01:00
James Price
40f50d77a3 Rename test .c sources to .cpp where necessary (#604)
Remove hacks to force language from CMake files.

Closes KhronosGroup/OpenCL-CTS#25
2020-02-21 17:34:31 +00:00