我是 SYCL、OpenCL 和 GPU 编程的新手。我在 SYCL 中阅读了有关设备选择器的信息,发现了以下四个:
- default_selector :系统启发式选择的设备。如果未找到 OpenCL 设备,则默认为 SYCL 主机设备。
- gpu_selector :根据设备类型 info::device::device_type::gpu 从所有可用的 OpenCL 设备中选择设备。如果未找到 OpenCL GPU 设备,则选择器失败。
- cpu_selector :根据设备类型 info::device::device_type::cpu 从所有可用设备和启发式中选择设备。如果没有找到 OpenCL CPU 设备,则选择器失败。
- host_selector :选择不需要 OpenCL 运行时的 SYCL 主机 CPU 设备。
我跑去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 Ti
设备Intel(R) HD Graphics
是 GPU 设备,Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
也是 CPU 设备。这里是怎么host devices
回事?
如果我选择host_selector
,我SYCL code
会在哪里运行?