我刚刚开始使用SYCL,并在我的系统上运行了ComputeCpp_info,显示了3台设备上的以下数据
ComputeCpp信息(CE 1.1.0)
SYCL 1.2.1修订版3
设备1( GeForce GTX1050=否-设备不支持SPIR)
设备2(英特尔(R)核芯显卡630 =未经测试-未在此操作系统上测试的设备)
设备3(英特尔(R)酷睿(TM) i7-7700HQ CPU @2.80 CPU=未测试-运行未测试驱动程序的设备)
现在我的问题是,我可以在这些设备上工作,因为2个未经测试,1个不可能?还是我错过了一些驱动程序?
我还实现了一个简单的示例,但它给出了CL/cl.h not found错误
#include <CL/sycl.hpp>
#include <array>
#include <numeric>
#include <iostream>
int main() {
const size_t array_size = 1024 * 512;
std::array<cl::sycl::cl_int, array_size> in, out;
std::iota(begin(in), end(in), 0);
cl::sycl::queue device_queue;
cl::sycl::range<1> n_items{ array_size };
cl::sycl::buffer < cl::sycl::cl_int, 1> in_buffer(in.data(), n_items);
cl::sycl::buffer < cl::sycl::cl_int, 1> out_buffer(out.data(), n_items);
device_queue.submit([&](cl::sycl::handler &cgh) {
constexpr auto sycl_read = cl::sycl::access::mode::read;
constexpr auto sycl_write = cl::sycl::access::mode::write;
auto in_accessor = in_buffer.get_access<sycl_read>(cgh);
auto out_accessor = out_buffer.get_access<sycl_write>(cgh);
cgh.parallel_for<class VecScalMul>(n_items,
[=](cl::sycl::id<1> wiID) {
out_accessor[wiID] = in_accessor[wiID] * 2;
});
});
}
发布于 2019-03-27 00:49:50
computecpp_info工具显示系统上的ComputeCpp支持或不支持的设备。以下是对输出的解释:
未测试-设备未在此操作系统上测试:这意味着可以检测到该设备,并报告它支持SPIR指令。它应该可以与ComputeCpp一起工作,但是这个特定的设备还没有经过ComputeCpp团队的测试
cl.h标头丢失错误是因为您缺少OpenCL标头。它们可以在here中找到,并且在编译代码时需要指向它们。我建议在示例代码中使用Getting Started guide,然后修改hello world示例来测试您的代码。它有一个现有的CMake文件,用于搜索所需的所有依赖项。
发布于 2019-03-26 22:37:07
之上的
免责声明:我是在ComputeCpp工作的Codeplay员工!
https://stackoverflow.com/questions/55358915
复制相似问题