【发布时间】:2019-11-27 00:41:06
【问题描述】:
我目前正在使用 SYCL 对图像应用非锐化蒙版的项目。我的机器里面有一个 NVIDIA 和一个 Intel GPU。我从以下代码开始:
default_selector deviceSelector;
queue myQueue(deviceSelector);
问题在于代码行“default_selector deviceSelector;”自动抓取我机器内的 NVIDIA GPU,这会破坏后面的所有代码,因为 SYCL 不适用于 NVIDIA。
因此我的问题是 - 我如何强制“default_selector deviceSelector;”获取我的 Intel GPU 而不是 NVIDIA GPU?也许我可以这样说:
if (device.has_extension(cl::sycl::string_class("Intel")))
if (device.get_info<info::device::device_type>() == info::device_type::gpu)
then select this GPU;//pseudo code
从而使代码跳过NVIDIA GPU并保证选择我的Intel GPU。
【问题讨论】: