在 OpenCL 中为嵌入式配置文件创建设备上下文

Creating device context in OpenCL for embedded profile

我可以通过

在 OpenCL 中创建上下文和设备
     using namespace cl;
     std::vector<Platform> platforms;
     Platform::get(&platforms);
     cl_context_properties properties[] = 
                        {CL_PLATFORM_NAME,
                      (cl_context_properties) (platforms.at(0))(),0};
            context = Context(CL_DEVICE_TYPE_ALL, properties);
            devices = context.getInfo<CL_CONTEXT_DEVICES>();

它在 CPU 和 GPU 设备上运行良好。如果我对 FPGA 设备尝试相同的方法,我会在方法 clCreateContextFromType() 中遇到错误。上下文构造函数正在包装此方法。

我应该如何为 OpenCL 设备(例如具有嵌入式配置文件的 FPGA)创建上下文和设备。

FPGA 设备通常需要 link 额外的供应商特定 OpenCL 驱动程序库。 link 的库通常在供应商文档 and/or 示例中指定。

对于可在其文档中找到的 Altera:1.7.6 Managing Host Application

Xilinx 在他们的示例中(按 OP):github.com/Xilinx/SDAccel_Examples