Deduplicate create_image from Copy/Fill image tests (#2262)

1. Remove duplicate `create_image` code that is in both clFillImage and
clCopyImage test directories.
2. Unify how pitch buffer's memory is deallocated; The buffer can be
allocated with either `malloc` or `align_malloc` and the free function
is pre-set in `pitch_buffe_data`'s member variable `free_fn` and used
when the buffer is deallocated. With this, the change removes
`is_aligned` conditional variable that was used to select the
appropriate free function.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This commit is contained in:
Michael Rizkalla
2025-02-19 04:50:43 +00:00
committed by GitHub
parent 84fd99da76
commit 6d3d199b42
4 changed files with 458 additions and 734 deletions

View File

@@ -50,4 +50,9 @@ int get_format_list(cl_context context, cl_mem_object_type imageType,
cl_mem_flags flags);
size_t random_in_ranges(size_t minimum, size_t rangeA, size_t rangeB, MTdata d);
clMemWrapper create_image(cl_context context, cl_command_queue queue,
BufferOwningPtr<char> &data,
image_descriptor *imageInfo, bool enable_pitch,
bool create_mipmaps, int *error);
#endif // IMAGES_COMMON_H