Intel® FPGA SDK for OpenCL™ Standard Edition: Programming Guide

ID 683342
Date 4/22/2019
Public
Document Table of Contents
Give Feedback

6.6.4.1.2. Querying Device Information

You can direct the host to query information on your OpenCL™ FPGA devices.
To direct the host to output a list of OpenCL FPGA devices installed into your system, add the following lines of code to your host application:
char buf[1024];
for (unsigned i = 0; i < ciDeviceCount; i++);
{
    clGetDeviceInfo(cdDevices[i], CL_DEVICE_NAME, 1023, buf, 0);
    printf("Device %d: '%s'\n", i, buf);
}
When you query the device information, the host will list your FPGA devices in the following manner:

Device <N>: <board_name>: <name_of_FPGA_board>

Where:

  • <N> is the device number.
  • <board_name> is the board designation you use to target your FPGA device when you invoke the aoc command.
  • <name_of_FPGA_board> is the advertised name of the FPGA board.

For example, if you have two identical FPGA boards on your system, the host generates an output that resembles the following:

Device 0: board_1: Stratix V FPGA Board
Device 1: board_1: Stratix V FPGA Board
Note: The clGetDeviceInfo function returns the board type (for example, board_1) that the Intel® FPGA SDK for OpenCL™ Offline Compiler lists on-screen when you invoke the aoc -list-boards command. If your accelerator board contains more than one FPGA, each device is treated as a "board" and is given a unique name.