Building OpenCL API Host Code for x86
The AMD Vitis™
application
acceleration development flow also supports the use of OpenCL API to program your host application. Building OpenCL applications using
g++ uses the following command line:
g++ -g -std=c++1y -I$XILINX_XRT/include -L$XILINX_XRT/lib -o host.exe host.cpp \
-lOpenCL -pthread
The only difference is the use of the OpenCL library for the OpenCL API
in place of the xrt_coreutil library for the XRT
native API.
Note: In Vitis Accel_Examples you can see the addition of
xcl2.cpp source file, and the
-I../xcl2 include statement. These additions to the
host program and g++ command provide access to
helper utilities used by the example code, but are generally not required for your
own code.