Intel ArBB runtime-dynamic (JIT) compilation process
Intel ArBB programs are provided as functions, either general functions or element-wise operating "mapped" functions (kernels). The statements building the ArBB "code" are regular C++ statements. These statements are even compiled the "regular" way using one of the supported ISO-compliant C++ compilers.
To explain the runtime-dynamic execution one need to know the two different execution modes of Intel ArBB:
- ArBB is in immediate execution mode (ARBB_OPT_LEVEL=O0), then the expected behavior is taking immediate effect
- ArBB is in non-immediate mode, i.e. producing optimized code specific for the execution target (ARBB_OPT_LEVEL=O2|O3)
In the latter shown case runtime-dynamic execution is involved. ArBB statements are "recorded", or executed "as-if". The statements contribute to an intermediate representation (IR) which is picked-up by the just-in-time (JIT) compiler. JIT compilation is usually "triggered" by using the call() operator/function. This is the default way to get your ArBB code running is using call() which does the following in one step:
- C++ ArBB statements are executed "as-if" and recorded into an intermediate representation (IR)
- Just-in-time (JIT) compilation is triggered to generate optimized target-specific code
- Optimized code is executed
The figure below shows the ArBB execution model as a work flow. Moreover, the mechanism shows how the execution is intercepted in order to inspect the state of an ArBB program using a standard debugger (immediate execution mode using ARBB_OPT_LEVEL=O0).
