Refactor clCopyImage and clFillImage tests (#2283)

This change mainly extends `clFillImage` and `clCopyImage` test function
to include memory flags to be used during creating the image instead of
hard-coding these values. The memory flags are also different parameters
for source and destination images in `clCopyImage` tests.

---------

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This commit is contained in:
Michael Rizkalla
2025-04-01 17:53:37 +01:00
committed by GitHub
parent 78bd3ddece
commit 5930d45fc6
19 changed files with 1762 additions and 1043 deletions

View File

@@ -173,7 +173,6 @@ clMemWrapper create_image(cl_context context, cl_command_queue queue,
{
cl_mem img;
cl_image_desc imageDesc;
cl_mem_flags mem_flags = CL_MEM_READ_ONLY;
void *host_ptr = nullptr;
bool is_host_ptr_aligned = false;
@@ -310,21 +309,17 @@ clMemWrapper create_image(cl_context context, cl_command_queue queue,
imageInfo->depth * imageInfo->slicePitch);
return nullptr;
}
if (imageInfo->type != CL_MEM_OBJECT_IMAGE1D_BUFFER)
{
mem_flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR;
}
}
if (imageInfo->type != CL_MEM_OBJECT_IMAGE1D_BUFFER)
{
img = clCreateImage(context, mem_flags, imageInfo->format, &imageDesc,
host_ptr, error);
img = clCreateImage(context, imageInfo->mem_flags, imageInfo->format,
&imageDesc, host_ptr, error);
}
else
{
img = clCreateImage(context, mem_flags, imageInfo->format, &imageDesc,
nullptr, error);
img = clCreateImage(context, imageInfo->mem_flags, imageInfo->format,
&imageDesc, nullptr, error);
}
if (enable_pitch)