Akh*_*esh 2 gpu gpgpu opencl sycl
我是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
Run Code Online (Sandbox Code Playgroud)
所以,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会去哪里?
小智 9
在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但不保证