本文整理汇总了C++中Platform::id方法的典型用法代码示例。如果您正苦于以下问题:C++ Platform::id方法的具体用法?C++ Platform::id怎么用?C++ Platform::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Platform
的用法示例。
在下文中一共展示了Platform::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeviceList
/**
\param platform The platform which all devices in this list should
be associated with.
\param type The type which all devices in this list should
belong to. By default, CL_DEVICE_TYPE_DEFAULT is
specified.
*/
DeviceList(Platform platform, cl_device_type type = CL_DEVICE_TYPE_DEFAULT)
{
cl_uint num = 0;
cl_int err = clGetDeviceIDs(platform.id(), type, 0, NULL, &num);
if(num == 0) // check the number before error code
return;
CLPP_CHECK_ERROR(err);
my_list.resize(num);
err = clGetDeviceIDs(platform.id(), type, num, &my_list[0], NULL);
CLPP_CHECK_ERROR(err);
}
示例2: Context
/**
\param platform The specified platform.
\param type The type of devices to be used in the platform. By
default, CL_DEVICE_TYPE_DEFAULT is used.
*/
Context(Platform platform, cl_device_type type = CL_DEVICE_TYPE_DEFAULT)
: my_devices(platform, type)
{
initByPlatform(platform.id(), type);
}
示例3:
/* ----------------------------------------------------------------------- */
void Context_Properties::
set_platform(Platform const& platform)
{
this->set_platform_id(platform.id());
}