Debugging OpenCL Kernels - 2024.1 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2024-07-03
Version
2024.1 English

For OpenCL kernels, additional runtime checks can be performed during software emulation. These additional checks include:

  • Checking whether an OpenCL kernel makes out-of-bounds accesses to the interface buffers (fsanitize=address).
  • Checking whether the kernel makes accesses to uninitialized local memory (fsanitize=memory).

These are Vitis compiler options that are enabled through the --advanced compiler option as described in --advanced Options, using the following command syntax:

--advanced.param compiler.fsanitize=address,memory

When applied, the emulation run produces a debug log with emulation diagnostic messages that are written to <project_dir>/Emulation-SW/<proj_name>-Default>/emulation_debug.log.

The fsanitize directive can also be specified in a config file, as follows:

[advanced]
#param=<param_type>:<param_name>.<value>
param=compiler.fsanitize=address,memory

The config file is specified on the v++ command line:

v++ -l –t sw_emu --config ./advanced.cfg -o bin_kernel.xclbin

Refer to the Vitis Compiler Configuration File for more information on the --config option.