当前位置: 首页>>代码示例>>C++>>正文


C++ device::name方法代码示例

本文整理汇总了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("====================================================================");
}
开发者ID:jcxz,项目名称:DIP,代码行数:42,代码来源:ocl.cpp

示例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;
}
开发者ID:jcxz,项目名称:DIP,代码行数:20,代码来源:ocl.cpp

示例3: operator

 bool operator()(const boost::compute::device &d) const {
     return d.name().find(devname) != std::string::npos;
 }
开发者ID:,项目名称:,代码行数:3,代码来源:


注:本文中的boost::compute::device::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。