gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 00:14:18 34 4
gpt4 key购买 nike

我是 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/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com