Hariharan
Hariharan

Reputation: 881

Creating device context in OpenCL for embedded profile

I am able to create context and devices in OpenCL by doing

     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>();

It is working well with CPU and GPU devices. If I try the same for FPGA devices I get error in method clCreateContextFromType(). The context constructor is wrapping this method.

How should I create context and devices for OpenCL devices such as FPGA with embedded profile.

Upvotes: 0

Views: 187

Answers (1)

doqtor
doqtor

Reputation: 8484

FPGA devices usually require to link additional vendor specific OpenCL driver libraries. What are the libraries to link with is usually specified in the vendor documentation and/or examples.

For Altera that can be found in their documentation: 1.7.6 Managing Host Application

For Xilinx in their examples (by OP): github.com/Xilinx/SDAccel_Examples

Upvotes: 1

Related Questions