opencl - SYCL设备选择器中的host_selector是什么?

标签 opencl gpu gpgpu sycl

我是 SYCL、OpenCL 和 GPU 编程的新手。我在 SYCL 中阅读了有关设备选择器的信息,发现了以下四个:

  1. default_selector : Devices selected by heuristics of the system. If no OpenCL device is found then it defaults to the SYCL host device.
  2. gpu_selector : Select devices according to device type info::device::device_type::gpu from all the available OpenCL devices. If no OpenCL GPU device is found the selector fails.
  3. cpu_selector : Select devices according to device type info::device::device_type::cpu from all the available devices and heuristics. If no OpenCL CPU device is found the selector fails.
  4. host_selector : Selects the SYCL host CPU device that does not require an OpenCL runtime.

我运行了computecpp_info来查找设备:

$ /usr/local/computecpp/bin/computecpp_info
/usr/local/computecpp/bin/computecpp_info: /usr/local/cuda-8.0/lib64/libOpenCL.so.1: no version information available (required by /usr/local/computecpp/bin/computecpp_info)
/usr/local/computecpp/bin/computecpp_info: /usr/local/cuda-8.0/lib64/libOpenCL.so.1: no version information available (required by /usr/local/computecpp/bin/computecpp_info)
********************************************************************************

ComputeCpp Info (CE 0.7.0)

********************************************************************************

Toolchain information:

GLIBC version: 2.19
GLIBCXX: 20150426
This version of libstdc++ is supported.

********************************************************************************


Device Info:

Discovered 3 devices matching:
  platform    : <any>
  device type : <any>

--------------------------------------------------------------------------------
Device 0:

  Device is supported                     : NO - Device does not support SPIR
  CL_DEVICE_NAME                          : GeForce GTX 750 Ti
  CL_DEVICE_VENDOR                        : NVIDIA Corporation
  CL_DRIVER_VERSION                       : 384.111
  CL_DEVICE_TYPE                          : CL_DEVICE_TYPE_GPU 
--------------------------------------------------------------------------------
Device 1:

  Device is supported                     : UNTESTED - Device not tested on this OS
  CL_DEVICE_NAME                          : Intel(R) HD Graphics
  CL_DEVICE_VENDOR                        : Intel(R) Corporation
  CL_DRIVER_VERSION                       : r5.0.63503
  CL_DEVICE_TYPE                          : CL_DEVICE_TYPE_GPU 
--------------------------------------------------------------------------------
Device 2:

  Device is supported                     : YES - Tested internally by Codeplay Software Ltd.
  CL_DEVICE_NAME                          : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  CL_DEVICE_VENDOR                        : Intel(R) Corporation
  CL_DRIVER_VERSION                       : 1.2.0.475
  CL_DEVICE_TYPE                          : CL_DEVICE_TYPE_CPU 

If you encounter problems when using any of these OpenCL devices, please consult
this website for known issues:
https://computecpp.codeplay.com/releases/v0.7.0/platform-support-notes

因此,GeForce GTX 750 TiIntel(R) HD Graphics 设备是 GPU 设备,Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz 是 CPU 设备。这里的主机设备怎么样?

如果我选择 host_selector,我的 SYCL 代码 将在哪里运行?

最佳答案

在 SYCL 中,有主机设备和 OpenCL 设备的概念。 OpenCL 设备是任何支持 OpenCL 的设备,例如 Intel GPU、AMD GPU、支持 OpenCL 的 FPGA 等。

另一方面,主机设备是运行 OpenCL 设备的设备。本质上,它是您的 cpu,它控制所有连接的支持 OpenCL 的设备,并且本身不使用 OpenCL。有时,一些 CPU 供应商提供 OpenCL 驱动程序,使您也可以在 CPU 上运行 OpenCL。在这种情况下,主机设备和 OpenCL 设备共享相同的硬件组件。

就您而言,英特尔为 CPU 和 GPU 提供了 OpenCL 实现,因此您的所有设备都支持 OpenCL。即使您没有 OpenCL 设备,主机设备也存在

我还想指出,ComputeCpp 包含对 NVidia 的实验性支持,因此您可以在其上运行 SYCL,但不能保证

关于opencl - SYCL设备选择器中的host_selector是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50714019/

相关文章:

opencl - 在 OpenCL 中,平台、上下文和设备之间有什么区别?

c++ - (渲染粒子)我应该学习shader还是OpenCL?

c - openCL 中的多维内核启动不起作用

cuda - GPGPU-CUDA : global store efficiency

cuda - 使用 Thrust 的向量数组

OpenCL 中的 HashMap?

OpenCL 内置函数 'select'

c++ - 您将如何读取 GPU 的前端缓冲区以获取屏幕?

c++ - 如何在 Intel HD Graphics 4000 中运行 C++ 代码?

ios - 在 iPhone 的 GPU( Metal )和 CPU(OpenCV)上处理摄像头馈送数据