Chess Directives and C++ Attributes - 2024.1 English

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
UG1079
Release Date
2024-06-05
Version
2024.1 English
In order to improve code readability, Chess loop directives can be written as C++ attributes in the AI Engine kernel.
Table 1. Chess Directive and Equivalent C++ Attribute
Chess Directive C++ Attribute Note
chess_prepare_for_pipelining [[chess::prepare_for_pipelining]]  
chess_loop_range(<minimum>, <maximum>) [[chess::min_loop_count(<minimum>)]]

[[chess::max_loop_count(<maximum>)]]

In the Chess directive, the minimum and maximum loop ranges are specified in the same directive. In C++, two attributes are needed, one for minimum loop range and one for maximum loop range.
chess_unroll_loop(N) [[chess::unroll_loop]] Partial loop unrolling is not supported by the C++ attribute, hence N cannot be specified.
chess_storage(<reg>) [[chess::storage(<reg>)]]