本文整理汇总了C++中Image2D::height方法的典型用法代码示例。如果您正苦于以下问题:C++ Image2D::height方法的具体用法?C++ Image2D::height怎么用?C++ Image2D::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image2D
的用法示例。
在下文中一共展示了Image2D::height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
p_local_work_size[i] = local_work_size[i];
work_group_size *= local_work_size[i];
}
}
// initialize missing dimensions
for (; i < max_dims; i++)
{
p_global_work_offset[i] = 0;
p_global_work_size[i] = 1;
p_local_work_size[i] = 1;
}
// Check we don't ask too much to the device
if (work_group_size > max_work_group_size)
{
*errcode_ret = CL_INVALID_WORK_GROUP_SIZE;
return;
}
// Check arguments (buffer alignment, image size, ...)
for (unsigned int i=0; i<kernel->numArgs(); ++i)
{
const Kernel::Arg &a = kernel->arg(i);
if (a.kind() == Kernel::Arg::Buffer && a.file() != Kernel::Arg::Local)
{
MemObject *buffer = *(MemObject **)(a.value(0));
if (!BufferEvent::isSubBufferAligned(buffer, device))
{
*errcode_ret = CL_MISALIGNED_SUB_BUFFER_OFFSET;
return;
}
clRetainMemObject(desc(buffer));
p_mem_objects.push_back((MemObject *) buffer);
}
else if (a.kind() == Kernel::Arg::Image2D)
{
Image2D *image = *(Image2D **)(a.value(0));
size_t maxWidth, maxHeight;
*errcode_ret = device->info(CL_DEVICE_IMAGE2D_MAX_WIDTH,
sizeof(size_t), &maxWidth, 0);
*errcode_ret |= device->info(CL_DEVICE_IMAGE2D_MAX_HEIGHT,
sizeof(size_t), &maxHeight, 0);
if (*errcode_ret != CL_SUCCESS)
return;
if (image->width() > maxWidth || image->height() > maxHeight)
{
*errcode_ret = CL_INVALID_IMAGE_SIZE;
return;
}
clRetainMemObject(desc(image));
p_mem_objects.push_back((MemObject *) image);
}
else if (a.kind() == Kernel::Arg::Image3D)
{
Image3D *image = *(Image3D **)a.value(0);
size_t maxWidth, maxHeight, maxDepth;
*errcode_ret = device->info(CL_DEVICE_IMAGE3D_MAX_WIDTH,
sizeof(size_t), &maxWidth, 0);
*errcode_ret |= device->info(CL_DEVICE_IMAGE3D_MAX_HEIGHT,
sizeof(size_t), &maxHeight, 0);
*errcode_ret |= device->info(CL_DEVICE_IMAGE3D_MAX_DEPTH,
sizeof(size_t), &maxDepth, 0);
if (*errcode_ret != CL_SUCCESS)
return;
if (image->width() > maxWidth || image->height() > maxHeight ||
image->depth() > maxDepth)
{
*errcode_ret = CL_INVALID_IMAGE_SIZE;
return;
}
clRetainMemObject(desc(image));
p_mem_objects.push_back((MemObject *) image);
}
}
// Check if kernel has timeout specified and CommandQueue allows it
if (kernel->getTimeout() > 0)
{
cl_command_queue_properties queue_props;
*errcode_ret = parent->info(CL_QUEUE_PROPERTIES,
sizeof(cl_command_queue_properties),
&queue_props, 0);
if (*errcode_ret != CL_SUCCESS) return;
if ((queue_props & CL_QUEUE_KERNEL_TIMEOUT_COMPUTE_UNIT_TI) != 0)
p_timeout_ms = kernel->getTimeout();
}
}