本文整理汇总了C++中boost::compute::device::name方法的典型用法代码示例。如果您正苦于以下问题:C++ device::name方法的具体用法?C++ device::name怎么用?C++ device::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::compute::device
的用法示例。
在下文中一共展示了device::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printDeviceInfo
void printDeviceInfo(const boost::compute::device & dev)
{
INFOM("====================================================================");
INFOM("name : " << dev.name());
// misc information
INFOM("--- misc info -----------------------------");
INFOM("CL_DEVICE_ERROR_CORRECTION_SUPPORT : " << dev.get_info<cl_bool>(CL_DEVICE_ERROR_CORRECTION_SUPPORT));
INFOM("CL_DEVICE_HOST_UNIFIED_MEMORY : " << dev.get_info<cl_bool>(CL_DEVICE_HOST_UNIFIED_MEMORY));
INFOM("CL_DEVICE_MAX_COMPUTE_UNITS : " << dev.get_info<cl_uint>(CL_DEVICE_MAX_COMPUTE_UNITS));
INFOM("CL_DEVICE_PROFILING_TIMER_RESOLUTION (ns) : " << dev.get_info<size_t>(CL_DEVICE_PROFILING_TIMER_RESOLUTION));
// global memory information
INFOM("--- global memory info --------------------");
INFOM("CL_DEVICE_GLOBAL_MEM_CACHE_SIZE (KB) : " << dev.get_info<cl_ulong>(CL_DEVICE_GLOBAL_MEM_CACHE_SIZE) / 1024);
INFOM("CL_DEVICE_GLOBAL_MEM_CACHE_TYPE : " << cacheTypeToString(dev.get_info<cl_device_mem_cache_type>(CL_DEVICE_GLOBAL_MEM_CACHE_TYPE)));
INFOM("CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE (B) : " << dev.get_info<cl_uint>(CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE));
INFOM("CL_DEVICE_GLOBAL_MEM_SIZE (MB) : " << dev.get_info<cl_ulong>(CL_DEVICE_GLOBAL_MEM_SIZE) / 1024 / 1024);
// local memory information
INFOM("--- local memory info ---------------------");
INFOM("CL_DEVICE_LOCAL_MEM_SIZE (KB) : " << dev.get_info<cl_ulong>(CL_DEVICE_LOCAL_MEM_SIZE) / 1024);
INFOM("CL_DEVICE_LOCAL_MEM_TYPE : " << localMemTypeToString(dev.get_info<cl_device_local_mem_type>(CL_DEVICE_LOCAL_MEM_TYPE)));
// constant memory information
INFOM("--- constant memory info ------------------");
INFOM("CL_DEVICE_MAX_CONSTANT_ARGS : " << dev.get_info<cl_uint>(CL_DEVICE_MAX_CONSTANT_ARGS));
INFOM("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE (KB) : " << dev.get_info<cl_ulong>(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE) / 1024);
// memory object information
INFOM("--- memory object info --------------------");
INFOM("CL_DEVICE_MAX_MEM_ALLOC_SIZE (MB) : " << dev.get_info<cl_ulong>(CL_DEVICE_MAX_MEM_ALLOC_SIZE) / 1024 / 1024);
// work group information
INFOM("--- work group info -----------------------");
INFOM("CL_DEVICE_MAX_WORK_GROUP_SIZE : " << dev.get_info<size_t>(CL_DEVICE_MAX_WORK_GROUP_SIZE));
INFOM("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS : " << dev.get_info<size_t>(CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS));
INFOM("CL_DEVICE_MAX_WORK_ITEM_SIZES : " << dev.get_info<std::vector<size_t>>(CL_DEVICE_MAX_WORK_ITEM_SIZES));
INFOM("====================================================================");
}
示例2: findGPUDevice
bool findGPUDevice(boost::compute::device & dev)
{
std::vector<boost::compute::device> devs(boost::compute::system::devices());
for (const boost::compute::device & dev_ : devs)
{
if (dev_.type() == CL_DEVICE_TYPE_GPU)
{
INFOM("Using device: " << dev_.name());
dev = dev_;
return true;
}
}
dev = boost::compute::system::default_device();
WARNM("Could not find any GPU device. Using device: " << dev.name());
return false;
}
示例3: operator
bool operator()(const boost::compute::device &d) const {
return d.name().find(devname) != std::string::npos;
}