Programming Guide

Contents

Targeting Multiple Homogeneous FPGA Devices

The Intel® oneAPI DPC++/C++ Compiler supports targeting multiple homogeneous FPGA devices from a single host CPU. This allows to improve your design’s throughput by parallelizing the execution of your program on multiple FPGAs.
Intel® recommends creating a single context with multiple device queues because, with multi-context, buffers at OpenCL layer must be copied between contexts, which introduces overhead and impacts overall performance. However, you can use multi-context if your design is simple and the overhead does not affect the overall performance.
Follow one of the following methods to target multiple FPGA devices:

Create a Single Context with Multiple Device Queues

Perform the following steps to target multiple FPGA devices with a single context:
  1. Create a single SYCL* context to encapsulate a collection of FPGA devices of the same platform.
    context ctxt(deviceList, &m_exception_handler);
  2. Create a SYCL queue for each FPGA device.
    std::vector<queue> queueList; for (unsigned int i = 0; i < ctxt.get_devices().size(); i++) { queue newQueue(ctxt, ctxt.get_devices()[i], &m_exception_handler); queueList.push_back(newQueue); }
  3. Submit either the same or different device codes to all available FPGA devices. If you want to target a subset of all available devices, then you must first perform device selection to filter out unwanted devices.
    for (unsigned int i = 0; i < queueList.size(); i++) { queueList[i].submit([&](handler& cgh) {...}); }

Create a Context For Each Device Queue (Multi-Context)

Perform the following steps to target multiple FPGA devices with multiple contexts:
  1. Obtain a list of all available FPGA devices. Optionally, you can select a device based on the device member or device property. For device properties such as device name, use the member function
    get_info()const
    with the desired device property.
    std::vector<device> deviceList = device::get_devices();
  2. Create a SYCL queue for each FPGA device.
    std::vector<queue> queueList; for (unsigned int i = 0; i < deviceList.size(); i++) { queue newQueue(deviceList[i], &m_exception_handler); queueList.push_back(newQueue); }
  3. Submit either the same or different device codes to all available FPGA devices. If you want to target a subset of all available devices, then you must first perform device selection to filter out unwanted devices.
    for (unsigned int i = 0; i < queueList.size(); i++) { queueList[i].submit([&](handler& cgh) {...}); }

Limitations

Consider the following limitations when targeting multiple FPGA devices:
  • All FPGA devices use the same FPGA bitstream.
  • All FPGA devices used must be of the same FPGA card (same -Xsboard target).

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.