By default, the linker builds a single hardware instance from a kernel. However, you can instantiate multiple hardware compute units (CUs) from a single kernel. This can improve performance as the host program can now make multiple calls to a given kernel, and see them executed in parallel on the different compute units.
Multiple CUs of a kernel can be created by using the connectivity.nk
option in the v++
config file during linking. Edit a config file to include the needed options, and
specify it in the v++
command line with the --config
option, as described in
v++
Command in the Vitis
Reference Guide (UG1702).
vadd
kernel,
two hardware instances can be implemented in the config file as follows:
[connectivity]
#nk=<kernel name>:<number>:<cu_name>,<cu_name>...
nk=vadd:2
Where:
-
<kernel_name>
- Specifies the name of the kernel to instantiate multiple times.
-
<number>
- The number of kernel instances, or CUs, to implement in hardware.
-
<cu_name>,<cu_name>...
- Specifies the instance names for the specified number of instances. This is optional, and the CU name will default to kernel_1 when it is not specified. The delimiter between kernel instances is a comma.
v++
command line:
v++ --config vadd_config.cfg ...
xclbinutil
command to examine the
contents of the xclbin file. Refer to
xclbinutil
Utility in the Vitis
Reference Guide (UG1702). vadd
kernel, named vadd_X
, vadd_Y
, and vadd_Z
in the xclbin
binary file:
[connectivity]
nk=vadd:3:vadd_X,vadd_Y,vadd_Z