从 OpenCL 中获得的设备列表中确定主机 CPU? [英] Determine host CPU from list of devices obtained in OpenCL?

查看:67
本文介绍了从 OpenCL 中获得的设备列表中确定主机 CPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过传递一个 cl_device_id 数组并获取所有可能的设备来调用 clGetDeviceIDs.现在从这个列表中我想删除实际上是主机 CPU 的设备?有没有傻瓜证明方法来做到这一点?因为可能安装了 2 个完全相同的 CPU,那么 cl_device_info 可能无法区分 2 个 CPU?

I am calling clGetDeviceIDs by passing an array of cl_device_id and getting all possible devices. Now from this list I want to remove the device which is actually the host CPU? Is there any fool proof way to do this? Because there might be 2 exactly identical CPU installed then cl_device_info might not be helpful in differentiating the 2 CPU?

推荐答案

在 OpenCL 1.1 及更高版本中,您可以使用 CL_DEVICE_HOST_UNIFIED_MEMORYclGetDeviceInfo.

In OpenCL 1.1 and later, you can check if the device and the host have a unified memory subsystem by using CL_DEVICE_HOST_UNIFIED_MEMORY with clGetDeviceInfo.

这篇关于从 OpenCL 中获得的设备列表中确定主机 CPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆