mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Simplify code.
Change-Id: If730d02312da01515ae53b5faaeb5d33419ec4ba Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user