Simplify code.

Change-Id: If730d02312da01515ae53b5faaeb5d33419ec4ba
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
Piotr Fusik
2019-02-28 11:21:01 +01:00
committed by sys_ocldev
parent 295d45f5ef
commit 33a9d3160b
9 changed files with 53 additions and 79 deletions

View File

@@ -353,10 +353,7 @@ GraphicsAllocation::AllocationType Buffer::getGraphicsAllocationType(const Memor
bool Buffer::isReadOnlyMemoryPermittedByFlags(cl_mem_flags flags) {
// Host won't access or will only read and kernel will only read
if ((flags & (CL_MEM_HOST_NO_ACCESS | CL_MEM_HOST_READ_ONLY)) && (flags & CL_MEM_READ_ONLY)) {
return true;
}
return false;
return (flags & (CL_MEM_HOST_NO_ACCESS | CL_MEM_HOST_READ_ONLY)) && (flags & CL_MEM_READ_ONLY);
}
Buffer *Buffer::createSubBuffer(cl_mem_flags flags,

View File

@@ -989,18 +989,15 @@ const SurfaceFormatInfo *Image::getSurfaceFormatFromTable(cl_mem_flags flags, co
}
bool Image::isImage2d(cl_mem_object_type imageType) {
return (imageType == CL_MEM_OBJECT_IMAGE2D);
return imageType == CL_MEM_OBJECT_IMAGE2D;
}
bool Image::isImage2dOr2dArray(cl_mem_object_type imageType) {
return (imageType == CL_MEM_OBJECT_IMAGE2D) || (imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY);
return imageType == CL_MEM_OBJECT_IMAGE2D || imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY;
}
bool Image::isDepthFormat(const cl_image_format &imageFormat) {
if (imageFormat.image_channel_order == CL_DEPTH || imageFormat.image_channel_order == CL_DEPTH_STENCIL) {
return true;
}
return false;
return imageFormat.image_channel_order == CL_DEPTH || imageFormat.image_channel_order == CL_DEPTH_STENCIL;
}
Image *Image::validateAndCreateImage(Context *context,