mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Handle NULL hostptr in conformance image tests (#1087)
* 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.
* Handle NULL hostptr in conformance image tests
As per the spec, clCreateBuffer and clCreateImage return
CL_INVALID_HOST_PTR if host_ptr is NULL
and CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are set in flags
or if host_ptr is not NULL
but CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR are not set in flags."
Host pointer should be NULL when USE/COPY_HOST_PTR is not set in flags.
* Revert "Handle NULL hostptr in conformance image tests"
This reverts commit 49fa049f9b.
* Move cl_mem_flag and host_ptr check to ImageHelper
Add a check to see if cl_mem_flag has
USE_HOST_PTR or COPY_HOST_PTR.
Override host_ptr with NULL if none of them
are specified.
This commit is contained in:
@@ -37,6 +37,11 @@ static inline cl_mem create_image_2d(cl_context context, cl_mem_flags flags,
|
|||||||
{
|
{
|
||||||
cl_mem mImage = NULL;
|
cl_mem mImage = NULL;
|
||||||
|
|
||||||
|
if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)))
|
||||||
|
{
|
||||||
|
host_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CL_VERSION_1_2
|
#ifdef CL_VERSION_1_2
|
||||||
cl_image_desc image_desc_dest;
|
cl_image_desc image_desc_dest;
|
||||||
image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D;
|
image_desc_dest.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||||
@@ -119,6 +124,11 @@ static inline cl_mem create_image_3d(cl_context context, cl_mem_flags flags,
|
|||||||
{
|
{
|
||||||
cl_mem mImage;
|
cl_mem mImage;
|
||||||
|
|
||||||
|
if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)))
|
||||||
|
{
|
||||||
|
host_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CL_VERSION_1_2
|
#ifdef CL_VERSION_1_2
|
||||||
cl_image_desc image_desc;
|
cl_image_desc image_desc;
|
||||||
image_desc.image_type = CL_MEM_OBJECT_IMAGE3D;
|
image_desc.image_type = CL_MEM_OBJECT_IMAGE3D;
|
||||||
@@ -166,6 +176,11 @@ create_image_2d_array(cl_context context, cl_mem_flags flags,
|
|||||||
{
|
{
|
||||||
cl_mem mImage;
|
cl_mem mImage;
|
||||||
|
|
||||||
|
if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)))
|
||||||
|
{
|
||||||
|
host_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cl_image_desc image_desc;
|
cl_image_desc image_desc;
|
||||||
image_desc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
|
image_desc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
|
||||||
image_desc.image_width = image_width;
|
image_desc.image_width = image_width;
|
||||||
@@ -196,6 +211,11 @@ static inline cl_mem create_image_1d_array(
|
|||||||
{
|
{
|
||||||
cl_mem mImage;
|
cl_mem mImage;
|
||||||
|
|
||||||
|
if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)))
|
||||||
|
{
|
||||||
|
host_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cl_image_desc image_desc;
|
cl_image_desc image_desc;
|
||||||
image_desc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY;
|
image_desc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY;
|
||||||
image_desc.image_width = image_width;
|
image_desc.image_width = image_width;
|
||||||
@@ -227,6 +247,11 @@ static inline cl_mem create_image_1d(cl_context context, cl_mem_flags flags,
|
|||||||
{
|
{
|
||||||
cl_mem mImage;
|
cl_mem mImage;
|
||||||
|
|
||||||
|
if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)))
|
||||||
|
{
|
||||||
|
host_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cl_image_desc image_desc;
|
cl_image_desc image_desc;
|
||||||
image_desc.image_type =
|
image_desc.image_type =
|
||||||
buffer ? CL_MEM_OBJECT_IMAGE1D_BUFFER : CL_MEM_OBJECT_IMAGE1D;
|
buffer ? CL_MEM_OBJECT_IMAGE1D_BUFFER : CL_MEM_OBJECT_IMAGE1D;
|
||||||
|
|||||||
Reference in New Issue
Block a user