In order to improve code readability, Chess loop directives can be written as
C++ attributes in the AI Engine kernel.
Chess Directive | C++ Attribute | Note |
---|---|---|
chess_prepare_for_pipelining
|
[[chess::prepare_for_pipelining]]
|
|
chess_loop_range(<minimum>,
<maximum>)
|
[[chess::min_loop_count(<minimum>)]]
|
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>)]]
|